ItemComponent HUD isn't drawn for ItemComponents that can't be selected

This commit is contained in:
Regalis
2016-12-01 16:11:29 +02:00
parent a2442bfcb8
commit bf88e2b8de
7 changed files with 12 additions and 15 deletions

View File

@@ -227,11 +227,9 @@
</Containable>
</ItemContainer>
<LightComponent lightcolor="0.6,0.8,1.0,1.0" range="800.0" IsOn="true"/>
<LightComponent lightcolor="0.6,0.8,1.0,1.0" canbeselected="false" range="800.0" IsOn="true"/>
<PowerContainer capacity="20000.0" maxrechargespeed="10000.0" maxoutput="10000.0">
<StatusEffect type="OnActive" target="Contained" targetnames="loadable" Condition="2.0"/>
</PowerContainer>
<PowerContainer capacity="20000.0" canbeselected="false" maxrechargespeed="10000.0" maxoutput="10000.0"/>
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
<requireditem name="Screwdriver,Wire" type="Equipped"/>

View File

@@ -50,7 +50,7 @@
<StatusEffect type="OnActive" target="Contained" targetnames="loadable" Condition="2.0"/>
</PowerContainer>
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
<ConnectionPanel selectkey="Action" canbeselected="true" msg="Rewire [Screwdriver]">
<StatusEffect type="OnFailure" target="Character">
<Explosion range="100.0" damage="15" stun="10" force="3.0" flames="false" shockwave="false" sparks="true"/>
</StatusEffect>
@@ -59,7 +59,7 @@
<input name="power_in"/>
</ConnectionPanel>
<ItemContainer capacity="3" hideitems="true">
<ItemContainer capacity="3" canbeselected="true" hideitems="true">
<Containable name="loadable"/>
</ItemContainer>
</Item>

View File

@@ -39,7 +39,7 @@
<input name="shutdown"/>
</ConnectionPanel>
<ItemContainer capacity="5">
<ItemContainer capacity="5" canbeselected="true">
<Containable name="Fuel Rod">
<StatusEffect type="OnContaining" target="This" AvailableFuel="2000.0" disabledeltatime="true"/>
</Containable>

View File

@@ -45,7 +45,7 @@
<Item name="Steel Bar"/>
</Deconstruct>
<Sprite texture="railgunetc.png" sourcerect="114,210,68,47" depth ="0.5"/>
<Sprite texture="railgunetc.png" sourcerect="114,210,68,47" depth ="0.55"/>
<Body width="68" height="47" density="30"/>

View File

@@ -91,7 +91,7 @@
<requireditem name="Wrench" type="Equipped"/>
</Holdable>
<ItemContainer capacity="1" itempos="0,0" hideitems="false">
<ItemContainer canbeselected="true" capacity="1" itempos="0,0" hideitems="false">
<Containable name="explosive"/>
</ItemContainer>

View File

@@ -74,7 +74,7 @@
<Item name="Polycarbonate Bar"/>
</Deconstruct>
<Sprite texture="weapons.png" sourcerect="0,58,88,20" depth ="0.5"/>
<Sprite texture="weapons.png" sourcerect="0,58,88,20" depth ="0.55"/>
<Body width="87" height="18" density="30"/>
@@ -106,7 +106,7 @@
<Item name="Polycarbonate Bar"/>
</Deconstruct>
<Sprite texture="weapons.png" sourcerect="0,77,88,20" depth ="0.5"/>
<Sprite texture="weapons.png" sourcerect="0,77,88,20" depth ="0.55"/>
<Body width="87" height="18" density="35"/>

View File

@@ -1144,7 +1144,7 @@ namespace Barotrauma
foreach (ItemComponent ic in components)
{
ic.DrawHUD(spriteBatch, character);
if (ic.CanBeSelected) ic.DrawHUD(spriteBatch, character);
}
}
@@ -1164,7 +1164,6 @@ namespace Barotrauma
if (Character.Controlled!=null && Character.Controlled.SelectedConstruction == this)
{
if (condition <= 0.0f)
{
FixRequirement.AddToGUIUpdateList();
@@ -1173,7 +1172,7 @@ namespace Barotrauma
foreach (ItemComponent ic in components)
{
ic.AddToGUIUpdateList();
if (ic.CanBeSelected) ic.AddToGUIUpdateList();
}
}
}
@@ -1193,7 +1192,7 @@ namespace Barotrauma
foreach (ItemComponent ic in components)
{
ic.UpdateHUD(character);
if (ic.CanBeSelected) ic.UpdateHUD(character);
}
}