All items and structures have to define a sourcerect for the sprite because otherwise the dedicated server won't know the size of the entity. Closes #321
This commit is contained in:
@@ -263,10 +263,9 @@
|
|||||||
name="Artifact Holder"
|
name="Artifact Holder"
|
||||||
linkable="true"
|
linkable="true"
|
||||||
category="Alien"
|
category="Alien"
|
||||||
Tags="alien"
|
Tags="alien">
|
||||||
>
|
|
||||||
|
|
||||||
<Sprite texture="artifactholder.png" depth="0.8"/>
|
<Sprite texture="artifactholder.png" depth="0.8" sourcerect="0,0,256,256"/>
|
||||||
|
|
||||||
<ItemContainer capacity="1" canbeselected="true" hideitems="false" itempos="128,-128">
|
<ItemContainer capacity="1" canbeselected="true" hideitems="false" itempos="128,-128">
|
||||||
<Containable name="Alien"/>
|
<Containable name="Alien"/>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
linkable="true"
|
linkable="true"
|
||||||
pickdistance ="150">
|
pickdistance ="150">
|
||||||
|
|
||||||
<Sprite texture ="locker.png" depth="0.84"/>
|
<Sprite texture ="locker.png" depth="0.84" sourcerect="0,0,128,128"/>
|
||||||
|
|
||||||
<ItemContainer capacity="20" canbeselected="true" hideitems="true">
|
<ItemContainer capacity="20" canbeselected="true" hideitems="true">
|
||||||
<Containable name="smallitem"/>
|
<Containable name="smallitem"/>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<Item name="Polycarbonate Bar"/>
|
<Item name="Polycarbonate Bar"/>
|
||||||
</Deconstruct>
|
</Deconstruct>
|
||||||
|
|
||||||
<Sprite texture ="DivingMask.png" depth="0.55"/>
|
<Sprite texture ="DivingMask.png" depth="0.55" sourcerect="0,0,37,38"/>
|
||||||
|
|
||||||
<Body width="26" height="18" density="15"/>
|
<Body width="26" height="18" density="15"/>
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@
|
|||||||
<Item name="FPGA Circuit"/>
|
<Item name="FPGA Circuit"/>
|
||||||
</Deconstruct>
|
</Deconstruct>
|
||||||
|
|
||||||
<Sprite texture ="Scooter.png" depth="0.55"/>
|
<Sprite texture ="Scooter.png" depth="0.55" sourcerect="0,0,64,64"/>
|
||||||
|
|
||||||
<Body width="55" height="30" density="15"/>
|
<Body width="55" height="30" density="15"/>
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<Item
|
<Item
|
||||||
name="Monitor"
|
name="Monitor"
|
||||||
linkable="true"
|
linkable="true">
|
||||||
>
|
|
||||||
|
|
||||||
<Sprite texture ="monitor.png" depth="0.85"/>
|
<Sprite texture ="monitor.png" depth="0.85" sourcerect="0,0,16,16"/>
|
||||||
|
|
||||||
<Body width="16" height="16" density="30"/>
|
<Body width="16" height="16" density="30"/>
|
||||||
|
|
||||||
|
|||||||
@@ -70,10 +70,9 @@
|
|||||||
name="Supercapacitor"
|
name="Supercapacitor"
|
||||||
category="Electrical"
|
category="Electrical"
|
||||||
linkable="true"
|
linkable="true"
|
||||||
|
|
||||||
description="Can deliver charge much faster than batteries.">
|
description="Can deliver charge much faster than batteries.">
|
||||||
|
|
||||||
<Sprite texture ="supercapacitor.png" depth="0.8"/>
|
<Sprite texture="supercapacitor.png" depth="0.8" sourcerect="0,0,77,88"/>
|
||||||
|
|
||||||
<PowerContainer capacity="20.0" maxrechargespeed="20.0" maxoutput="2000000.0" canbeselected = "true">
|
<PowerContainer capacity="20.0" maxrechargespeed="20.0" maxoutput="2000000.0" canbeselected = "true">
|
||||||
<GuiFrame rect="0,0,0.3,0.3" alignment="Center" style="ItemUI"/>
|
<GuiFrame rect="0,0,0.3,0.3" alignment="Center" style="ItemUI"/>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
cargocontainername="Metal Crate"
|
cargocontainername="Metal Crate"
|
||||||
description="A token of the Captain's unquestionable authority.">
|
description="A token of the Captain's unquestionable authority.">
|
||||||
|
|
||||||
<Sprite texture ="captainhat.png" depth="0.6"/>
|
<Sprite texture="captainhat.png" depth="0.6" sourcerect="0,0,32,32"/>
|
||||||
|
|
||||||
<Body width="25" height="15" density="30"/>
|
<Body width="25" height="15" density="30"/>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
cargocontainername="Metal Crate"
|
cargocontainername="Metal Crate"
|
||||||
price="10">
|
price="10">
|
||||||
|
|
||||||
<Sprite texture ="headset.png" depth="0.6"/>
|
<Sprite texture="headset.png" depth="0.6" sourcerect="0,0,16,16"/>
|
||||||
|
|
||||||
<Body width="12" height="8" density="10"/>
|
<Body width="12" height="8" density="10"/>
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
tags="smallitem"
|
tags="smallitem"
|
||||||
description="Praise the honkmother.">
|
description="Praise the honkmother.">
|
||||||
|
|
||||||
<Sprite texture ="clownmask.png" depth="0.6"/>
|
<Sprite texture="clownmask.png" depth="0.6" sourcerect="0,0,37,38"/>
|
||||||
|
|
||||||
<Body width="10" radius="10" density="10"/>
|
<Body width="10" radius="10" density="10"/>
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
tags="smallitem"
|
tags="smallitem"
|
||||||
description="Praise the honkmother.">
|
description="Praise the honkmother.">
|
||||||
|
|
||||||
<Sprite texture ="clownpants.png" sourcerect="0,62,53,18" depth="0.6"/>
|
<Sprite texture="clownpants.png" sourcerect="0,62,53,18" depth="0.6"/>
|
||||||
|
|
||||||
<Body width="53" height="18" density="30"/>
|
<Body width="53" height="18" density="30"/>
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,9 @@
|
|||||||
name="Ladder"
|
name="Ladder"
|
||||||
resizevertical="true">
|
resizevertical="true">
|
||||||
|
|
||||||
|
<Sprite texture="ladder.png" depth="0.05" sourcerect="0,0,11,121"/>
|
||||||
|
|
||||||
<Sprite texture ="ladder.png" depth="0.05"/>
|
<Ladder canbeselected="true"/>
|
||||||
|
|
||||||
<Ladder canbeselected = "true"/>
|
<trigger x="-40" y="20" width="90"/>
|
||||||
|
|
||||||
<trigger x="-40" y ="20" width="90"/>
|
|
||||||
</Item>
|
</Item>
|
||||||
@@ -4,8 +4,7 @@
|
|||||||
category="Machine"
|
category="Machine"
|
||||||
linkable="true">
|
linkable="true">
|
||||||
|
|
||||||
|
<Sprite texture="oxygengenerator.png" depth="0.8" sourcerect="0,0,128,128"/>
|
||||||
<Sprite texture ="oxygengenerator.png" depth="0.8"/>
|
|
||||||
|
|
||||||
<OxygenGenerator powerconsumption="1000.0" minvoltage="0.5" canbeselected = "true">
|
<OxygenGenerator powerconsumption="1000.0" minvoltage="0.5" canbeselected = "true">
|
||||||
<StatusEffect type="OnActive" target="Contained" targetnames="Oxygen Tank" Condition="0.5"/>
|
<StatusEffect type="OnActive" target="Contained" targetnames="Oxygen Tank" Condition="0.5"/>
|
||||||
@@ -29,7 +28,7 @@
|
|||||||
category="Machine"
|
category="Machine"
|
||||||
linkable="true">
|
linkable="true">
|
||||||
|
|
||||||
<Sprite texture ="vent.png" depth="0.91"/>
|
<Sprite texture="vent.png" depth="0.91" sourcerect="0,0,64,64"/>
|
||||||
|
|
||||||
<Vent>
|
<Vent>
|
||||||
<sound file="ventilation.ogg" type="OnActive" range="600.0" volume="OxygenFlow" volumemultiplier="0.001f" loop="true"/>
|
<sound file="ventilation.ogg" type="OnActive" range="600.0" volume="OxygenFlow" volumemultiplier="0.001f" loop="true"/>
|
||||||
|
|||||||
@@ -2,10 +2,9 @@
|
|||||||
<Item
|
<Item
|
||||||
name="Pump"
|
name="Pump"
|
||||||
linkable="true"
|
linkable="true"
|
||||||
category="Machine"
|
category="Machine">
|
||||||
>
|
|
||||||
|
|
||||||
<Sprite texture ="pump.png" depth="0.8"/>
|
<Sprite texture ="pump.png" depth="0.8" sourcerect="0,0,128,128"/>
|
||||||
|
|
||||||
<Pump canbeselected = "true" maxflow="500" PowerConsumption="300.0" MinVoltage="0.3">
|
<Pump canbeselected = "true" maxflow="500" PowerConsumption="300.0" MinVoltage="0.3">
|
||||||
<GuiFrame rect="0,0,330,145" alignment="Center" style="ItemUI"/>
|
<GuiFrame rect="0,0,330,145" alignment="Center" style="ItemUI"/>
|
||||||
@@ -25,8 +24,7 @@
|
|||||||
<Item
|
<Item
|
||||||
name="Small Pump"
|
name="Small Pump"
|
||||||
linkable="true"
|
linkable="true"
|
||||||
category="Machine"
|
category="Machine">
|
||||||
>
|
|
||||||
|
|
||||||
<Sprite texture ="smallpump.png" depth="0.8" sourcerect="0,0,64,48"/>
|
<Sprite texture ="smallpump.png" depth="0.8" sourcerect="0,0,64,48"/>
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
<Item name="Uranium Bar" mincondition="0.9"/>
|
<Item name="Uranium Bar" mincondition="0.9"/>
|
||||||
</Deconstruct>
|
</Deconstruct>
|
||||||
|
|
||||||
<Sprite texture ="fuelrod.png" depth="0.55"/>
|
<Sprite texture="fuelrod.png" depth="0.55" sourcerect="0,0,8,39"/>
|
||||||
|
|
||||||
<Body radius="6" height="22" density="5"/>
|
<Body radius="6" height="22" density="5"/>
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
<Item name="Incendium Bar" mincondition="0.95"/>
|
<Item name="Incendium Bar" mincondition="0.95"/>
|
||||||
</Deconstruct>
|
</Deconstruct>
|
||||||
|
|
||||||
<Sprite texture ="fuelrod.png" depth="0.55"/>
|
<Sprite texture ="fuelrod.png" depth="0.55" sourcerect="0,0,8,39"/>
|
||||||
|
|
||||||
<Body radius="6" height="22" density="5"/>
|
<Body radius="6" height="22" density="5"/>
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,9 @@
|
|||||||
category="Machine"
|
category="Machine"
|
||||||
focusonselected="true"
|
focusonselected="true"
|
||||||
offsetonselected="700"
|
offsetonselected="700"
|
||||||
linkable="true"
|
linkable="true">
|
||||||
>
|
|
||||||
|
|
||||||
<Sprite texture="railgunbase.png" depth = "0.01"/>
|
<Sprite texture="railgunbase.png" depth="0.01" sourcerect="0,0,256,256"/>
|
||||||
|
|
||||||
<Turret barrelsprite="railgunbarrel.png" canbeselected = "true" linkable="true" origin="0.5, 0.85" barrelpos="128, 128"
|
<Turret barrelsprite="railgunbarrel.png" canbeselected = "true" linkable="true" origin="0.5, 0.85" barrelpos="128, 128"
|
||||||
rotationlimits="180,360"
|
rotationlimits="180,360"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
Tags="smallitem"
|
Tags="smallitem"
|
||||||
cargocontainername="Metal Crate">
|
cargocontainername="Metal Crate">
|
||||||
|
|
||||||
<Sprite texture ="idcard.png" depth="0.8"/>
|
<Sprite texture ="idcard.png" depth="0.8" sourcerect="0,0,16,16"/>
|
||||||
|
|
||||||
<Body width="16" height="16" density="20"/>
|
<Body width="16" height="16" density="20"/>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
resizehorizontal="true"
|
resizehorizontal="true"
|
||||||
resizevertical="true">
|
resizevertical="true">
|
||||||
|
|
||||||
<Sprite texture ="blank.png" depth="0.85"/>
|
<Sprite texture ="blank.png" depth="0.85" sourcerect="0,0,16,16"/>
|
||||||
|
|
||||||
<ItemLabel/>
|
<ItemLabel/>
|
||||||
</Item>
|
</Item>
|
||||||
|
|||||||
@@ -308,6 +308,10 @@ namespace Barotrauma
|
|||||||
canSpriteFlipX = subElement.GetAttributeBool("canflipx", true);
|
canSpriteFlipX = subElement.GetAttributeBool("canflipx", true);
|
||||||
|
|
||||||
sprite = new Sprite(subElement, spriteFolder);
|
sprite = new Sprite(subElement, spriteFolder);
|
||||||
|
if (subElement.Attribute("sourcerect") == null)
|
||||||
|
{
|
||||||
|
DebugConsole.ThrowError("Warning - sprite sourcerect not configured for item \"" + Name + "\"!");
|
||||||
|
}
|
||||||
size = sprite.size;
|
size = sprite.size;
|
||||||
break;
|
break;
|
||||||
#if CLIENT
|
#if CLIENT
|
||||||
|
|||||||
@@ -99,6 +99,10 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
case "sprite":
|
case "sprite":
|
||||||
sp.sprite = new Sprite(subElement);
|
sp.sprite = new Sprite(subElement);
|
||||||
|
if (subElement.Attribute("sourcerect") == null)
|
||||||
|
{
|
||||||
|
DebugConsole.ThrowError("Warning - sprite sourcerect not configured for structure \"" + sp.name + "\"!");
|
||||||
|
}
|
||||||
|
|
||||||
if (subElement.GetAttributeBool("fliphorizontal", false))
|
if (subElement.GetAttributeBool("fliphorizontal", false))
|
||||||
sp.sprite.effects = SpriteEffects.FlipHorizontally;
|
sp.sprite.effects = SpriteEffects.FlipHorizontally;
|
||||||
|
|||||||
Reference in New Issue
Block a user