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
@@ -227,11 +227,9 @@
</Containable> </Containable>
</ItemContainer> </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"> <PowerContainer capacity="20000.0" canbeselected="false" maxrechargespeed="10000.0" maxoutput="10000.0"/>
<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]">
<requireditem name="Screwdriver,Wire" type="Equipped"/> <requireditem name="Screwdriver,Wire" type="Equipped"/>
@@ -50,7 +50,7 @@
<StatusEffect type="OnActive" target="Contained" targetnames="loadable" Condition="2.0"/> <StatusEffect type="OnActive" target="Contained" targetnames="loadable" Condition="2.0"/>
</PowerContainer> </PowerContainer>
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]"> <ConnectionPanel selectkey="Action" canbeselected="true" msg="Rewire [Screwdriver]">
<StatusEffect type="OnFailure" target="Character"> <StatusEffect type="OnFailure" target="Character">
<Explosion range="100.0" damage="15" stun="10" force="3.0" flames="false" shockwave="false" sparks="true"/> <Explosion range="100.0" damage="15" stun="10" force="3.0" flames="false" shockwave="false" sparks="true"/>
</StatusEffect> </StatusEffect>
@@ -59,7 +59,7 @@
<input name="power_in"/> <input name="power_in"/>
</ConnectionPanel> </ConnectionPanel>
<ItemContainer capacity="3" hideitems="true"> <ItemContainer capacity="3" canbeselected="true" hideitems="true">
<Containable name="loadable"/> <Containable name="loadable"/>
</ItemContainer> </ItemContainer>
</Item> </Item>
+1 -1
View File
@@ -39,7 +39,7 @@
<input name="shutdown"/> <input name="shutdown"/>
</ConnectionPanel> </ConnectionPanel>
<ItemContainer capacity="5"> <ItemContainer capacity="5" canbeselected="true">
<Containable name="Fuel Rod"> <Containable name="Fuel Rod">
<StatusEffect type="OnContaining" target="This" AvailableFuel="2000.0" disabledeltatime="true"/> <StatusEffect type="OnContaining" target="This" AvailableFuel="2000.0" disabledeltatime="true"/>
</Containable> </Containable>
@@ -45,7 +45,7 @@
<Item name="Steel Bar"/> <Item name="Steel Bar"/>
</Deconstruct> </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"/> <Body width="68" height="47" density="30"/>
@@ -91,7 +91,7 @@
<requireditem name="Wrench" type="Equipped"/> <requireditem name="Wrench" type="Equipped"/>
</Holdable> </Holdable>
<ItemContainer capacity="1" itempos="0,0" hideitems="false"> <ItemContainer canbeselected="true" capacity="1" itempos="0,0" hideitems="false">
<Containable name="explosive"/> <Containable name="explosive"/>
</ItemContainer> </ItemContainer>
+2 -2
View File
@@ -74,7 +74,7 @@
<Item name="Polycarbonate Bar"/> <Item name="Polycarbonate Bar"/>
</Deconstruct> </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"/> <Body width="87" height="18" density="30"/>
@@ -106,7 +106,7 @@
<Item name="Polycarbonate Bar"/> <Item name="Polycarbonate Bar"/>
</Deconstruct> </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"/> <Body width="87" height="18" density="35"/>
+3 -4
View File
@@ -1144,7 +1144,7 @@ namespace Barotrauma
foreach (ItemComponent ic in components) 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 (Character.Controlled!=null && Character.Controlled.SelectedConstruction == this)
{ {
if (condition <= 0.0f) if (condition <= 0.0f)
{ {
FixRequirement.AddToGUIUpdateList(); FixRequirement.AddToGUIUpdateList();
@@ -1173,7 +1172,7 @@ namespace Barotrauma
foreach (ItemComponent ic in components) foreach (ItemComponent ic in components)
{ {
ic.AddToGUIUpdateList(); if (ic.CanBeSelected) ic.AddToGUIUpdateList();
} }
} }
} }
@@ -1193,7 +1192,7 @@ namespace Barotrauma
foreach (ItemComponent ic in components) foreach (ItemComponent ic in components)
{ {
ic.UpdateHUD(character); if (ic.CanBeSelected) ic.UpdateHUD(character);
} }
} }