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"
|
||||
linkable="true"
|
||||
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">
|
||||
<Containable name="Alien"/>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
linkable="true"
|
||||
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">
|
||||
<Containable name="smallitem"/>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<Item name="Polycarbonate Bar"/>
|
||||
</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"/>
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
<Item name="FPGA Circuit"/>
|
||||
</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"/>
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Item
|
||||
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"/>
|
||||
|
||||
|
||||
@@ -69,11 +69,10 @@
|
||||
<Item
|
||||
name="Supercapacitor"
|
||||
category="Electrical"
|
||||
linkable="true"
|
||||
|
||||
linkable="true"
|
||||
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">
|
||||
<GuiFrame rect="0,0,0.3,0.3" alignment="Center" style="ItemUI"/>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
cargocontainername="Metal Crate"
|
||||
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"/>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
cargocontainername="Metal Crate"
|
||||
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"/>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
tags="smallitem"
|
||||
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"/>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
tags="smallitem"
|
||||
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"/>
|
||||
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
name="Ladder"
|
||||
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>
|
||||
@@ -3,9 +3,8 @@
|
||||
name="Oxygen Generator"
|
||||
category="Machine"
|
||||
linkable="true">
|
||||
|
||||
|
||||
<Sprite texture ="oxygengenerator.png" depth="0.8"/>
|
||||
|
||||
<Sprite texture="oxygengenerator.png" depth="0.8" sourcerect="0,0,128,128"/>
|
||||
|
||||
<OxygenGenerator powerconsumption="1000.0" minvoltage="0.5" canbeselected = "true">
|
||||
<StatusEffect type="OnActive" target="Contained" targetnames="Oxygen Tank" Condition="0.5"/>
|
||||
@@ -29,7 +28,7 @@
|
||||
category="Machine"
|
||||
linkable="true">
|
||||
|
||||
<Sprite texture ="vent.png" depth="0.91"/>
|
||||
<Sprite texture="vent.png" depth="0.91" sourcerect="0,0,64,64"/>
|
||||
|
||||
<Vent>
|
||||
<sound file="ventilation.ogg" type="OnActive" range="600.0" volume="OxygenFlow" volumemultiplier="0.001f" loop="true"/>
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
<Item
|
||||
name="Pump"
|
||||
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">
|
||||
<GuiFrame rect="0,0,330,145" alignment="Center" style="ItemUI"/>
|
||||
@@ -25,8 +24,7 @@
|
||||
<Item
|
||||
name="Small Pump"
|
||||
linkable="true"
|
||||
category="Machine"
|
||||
>
|
||||
category="Machine">
|
||||
|
||||
<Sprite texture ="smallpump.png" depth="0.8" sourcerect="0,0,64,48"/>
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<Item name="Uranium Bar" mincondition="0.9"/>
|
||||
</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"/>
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
<Item name="Incendium Bar" mincondition="0.95"/>
|
||||
</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"/>
|
||||
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
category="Machine"
|
||||
focusonselected="true"
|
||||
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"
|
||||
rotationlimits="180,360"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
Tags="smallitem"
|
||||
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"/>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
resizehorizontal="true"
|
||||
resizevertical="true">
|
||||
|
||||
<Sprite texture ="blank.png" depth="0.85"/>
|
||||
<Sprite texture ="blank.png" depth="0.85" sourcerect="0,0,16,16"/>
|
||||
|
||||
<ItemLabel/>
|
||||
</Item>
|
||||
|
||||
@@ -308,6 +308,10 @@ namespace Barotrauma
|
||||
canSpriteFlipX = subElement.GetAttributeBool("canflipx", true);
|
||||
|
||||
sprite = new Sprite(subElement, spriteFolder);
|
||||
if (subElement.Attribute("sourcerect") == null)
|
||||
{
|
||||
DebugConsole.ThrowError("Warning - sprite sourcerect not configured for item \"" + Name + "\"!");
|
||||
}
|
||||
size = sprite.size;
|
||||
break;
|
||||
#if CLIENT
|
||||
|
||||
@@ -99,6 +99,10 @@ namespace Barotrauma
|
||||
{
|
||||
case "sprite":
|
||||
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))
|
||||
sp.sprite.effects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Reference in New Issue
Block a user