Resetting fixrequirements if an item is broken more than once, launcher & selecting graphics mode, some new sounds
This commit is contained in:
@@ -28,7 +28,7 @@ namespace Subsurface
|
||||
{
|
||||
this.character = character;
|
||||
|
||||
if (icons == null) icons = Game1.textureLoader.FromFile("Content/UI/inventoryIcons.png");
|
||||
if (icons == null) icons = Game1.TextureLoader.FromFile("Content/UI/inventoryIcons.png");
|
||||
|
||||
slotPositions = new Vector2[limbSlots.Length];
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Subsurface.Items.Components
|
||||
pt.currPowerConsumption += (-fullPower - pt.currPowerConsumption) / inertia;
|
||||
pt.Item.SendSignal("",
|
||||
"power", fullPower / Math.Max(fullLoad, 1.0f));
|
||||
|
||||
if (-pt.currPowerConsumption > pt.powerLoad * 2.0f) pt.item.Condition = 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -53,7 +53,8 @@ namespace Subsurface
|
||||
GUIComponent component = reqFrame.children.Find(c => c.UserData as string == itemName);
|
||||
|
||||
GUITextBlock text = component as GUITextBlock;
|
||||
bool itemFound = (character.Inventory.items.FirstOrDefault(i => i !=null && i.Name == itemName) != null);
|
||||
Item item = character.Inventory.items.FirstOrDefault(i => i !=null && i.Name == itemName);
|
||||
bool itemFound = (item != null);
|
||||
|
||||
if (!itemFound) success = false;
|
||||
|
||||
@@ -178,7 +179,7 @@ namespace Subsurface
|
||||
CreateGUIFrame(item);
|
||||
|
||||
}
|
||||
UpdateGUIFrame(item, character);
|
||||
UpdateGUIFrame(item, character);
|
||||
frame.Update((float)Physics.step);
|
||||
frame.Draw(spriteBatch);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,18 @@ namespace Subsurface
|
||||
public float Condition
|
||||
{
|
||||
get { return condition; }
|
||||
set { condition = MathHelper.Clamp(value, 0.0f, 100.0f); }
|
||||
set
|
||||
{
|
||||
float prev = condition;
|
||||
condition = MathHelper.Clamp(value, 0.0f, 100.0f);
|
||||
if (condition==0.0f && prev>0.0f)
|
||||
{
|
||||
foreach (FixRequirement req in FixRequirements)
|
||||
{
|
||||
req.Fixed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public float Health
|
||||
|
||||
Reference in New Issue
Block a user