Item/structure sprites flip by default

This commit is contained in:
Regalis
2016-10-03 16:43:03 +03:00
parent e1296e4a8e
commit 3ec6f008d5
5 changed files with 19 additions and 20 deletions

View File

@@ -16,7 +16,7 @@
linkable="true"
pickdistance ="150">
<Sprite texture ="cabinets.png" depth="0.84" sourcerect="0,0,48,64"/>
<Sprite texture ="cabinets.png" depth="0.84" sourcerect="0,0,48,64" canflipx="false"/>
<ItemContainer capacity="20" canbeselected="true" hideitems="true">
<Containable name="chem"/>
@@ -29,7 +29,7 @@
linkable="true"
pickdistance ="150">
<Sprite texture ="cabinets.png" depth="0.84" sourcerect="0,64,48,64"/>
<Sprite texture ="cabinets.png" depth="0.84" sourcerect="0,64,48,64" canflipx="false"/>
<ItemContainer capacity="20" canbeselected="true" hideitems="true">
<Containable name="chem"/>

View File

@@ -7,7 +7,7 @@
pickdistance="150"
description="Serves as a hub for power distribution and relaying signals between devices.">
<Sprite texture ="junctionbox.png" depth="0.8"/>
<Sprite texture="junctionbox.png" depth="0.8" canflipx="false"/>
<fixrequirement name="Electrical repairs">
<skill name="Electrical Engineering" level="40"/>

View File

@@ -29,39 +29,39 @@
</smallverticalback2>
<engineeringLabel width="153" height="16">
<sprite texture="Content/Map/structures2.png" sourcerect="0,426,153,16" depth ="0.99"/>
<sprite texture="Content/Map/structures2.png" sourcerect="0,426,153,16" depth="0.99" canflipx="false"/>
</engineeringLabel>
<commandLabel width="128" height="16">
<sprite texture="Content/Map/structures2.png" sourcerect="0,443,128,16" depth ="0.99"/>
<sprite texture="Content/Map/structures2.png" sourcerect="0,443,128,16" depth="0.99" canflipx="false"/>
</commandLabel>
<airlockLabel width = "99" height ="16">
<sprite texture="Content/Map/structures2.png" sourcerect="0,460,199,16" depth ="0.99"/>
<sprite texture="Content/Map/structures2.png" sourcerect="0,460,199,16" depth="0.99" canflipx="false"/>
</airlockLabel>
<cabinsLabel width="83" height="16">
<sprite texture="Content/Map/structures2.png" sourcerect="0,477,83,16" depth ="0.99"/>
<sprite texture="Content/Map/structures2.png" sourcerect="0,477,83,16" depth="0.99" canflipx="false"/>
</cabinsLabel>
<medicalLabel width="110" height="16">
<sprite texture="Content/Map/structures2.png" sourcerect="0,494,110,16" depth="0.99"/>
<sprite texture="Content/Map/structures2.png" sourcerect="0,494,110,16" depth="0.99" canflipx="false"/>
</medicalLabel>
<arrowUp width="16" height="16">
<sprite texture="Content/Map/structures2.png" sourcerect="129,460,16,16" depth ="0.99" canflipx="true"/>
<sprite texture="Content/Map/structures2.png" sourcerect="129,460,16,16" depth ="0.99"/>
</arrowUp>
<arrowDown width="16" height="16">
<sprite texture="Content/Map/structures2.png" sourcerect="146,460,16,16" depth ="0.99" canflipx="true"/>
<sprite texture="Content/Map/structures2.png" sourcerect="146,460,16,16" depth ="0.99"/>
</arrowDown>
<arrowLeft width="16" height="16">
<sprite texture="Content/Map/structures2.png" sourcerect="129,477,16,16" depth ="0.99" canflipx="true"/>
<sprite texture="Content/Map/structures2.png" sourcerect="129,477,16,16" depth ="0.99"/>
</arrowLeft>
<arrowRight width="16" height="16">
<sprite texture="Content/Map/structures2.png" sourcerect="146,477,16,16" depth ="0.99" canflipx="true"/>
<sprite texture="Content/Map/structures2.png" sourcerect="146,477,16,16" depth ="0.99"/>
</arrowRight>
<leftwall description="A vertical wall with collision detection"
@@ -170,19 +170,19 @@
</PipesBackground>
<SlopeForward width="16" height="16" resizehorizontal="true" resizevertical="true">
<sprite texture="Content/Map/structures2.png" sourcerect="0,0,224,64" depth = "0.95" canflipx="true"/>
<sprite texture="Content/Map/structures2.png" sourcerect="0,0,224,64" depth = "0.95" />
</SlopeForward>
<SlopeBack width="16" height="16" resizehorizontal="true" resizevertical="true">
<sprite texture="Content/Map/structures2.png" sourcerect="0,64,224,64" depth = "0.95" canflipx="true"/>
<sprite texture="Content/Map/structures2.png" sourcerect="0,64,224,64" depth = "0.95" />
</SlopeBack>
<stairsright width="256" height="320" stairdirection="Right">
<sprite texture="Content/Map/structures2.png" sourcerect="256,193,256,319" depth = "0.1" canflipx="true"/>
<sprite texture="Content/Map/structures2.png" sourcerect="256,193,256,319" depth = "0.1" />
</stairsright>
<stairsleft width="256" height="320" stairdirection="Left">
<sprite texture="Content/Map/structures2.png" sourcerect="256,193,256,319" fliphorizontal="true" depth = "0.1" canflipx="true"/>
<sprite texture="Content/Map/structures2.png" sourcerect="256,193,256,319" fliphorizontal="true" depth = "0.1" />
</stairsleft>
<bunk width="173" height="129">

View File

@@ -288,8 +288,7 @@ namespace Barotrauma
spriteFolder = Path.GetDirectoryName(filePath);
}
if (ToolBox.GetAttributeBool(subElement, "canflipx", false))
canSpriteFlipX = true;
canSpriteFlipX = ToolBox.GetAttributeBool(subElement, "canflipx", true);
sprite = new Sprite(subElement, spriteFolder);
size = sprite.size;

View File

@@ -113,8 +113,8 @@ namespace Barotrauma
sp.sprite.effects = SpriteEffects.FlipHorizontally;
if (ToolBox.GetAttributeBool(subElement, "flipvertical", false))
sp.sprite.effects = SpriteEffects.FlipVertically;
if (ToolBox.GetAttributeBool(subElement, "canflipx", false))
sp.canSpriteFlipX = true;
sp.canSpriteFlipX = ToolBox.GetAttributeBool(subElement, "canflipx", true);
break;
case "backgroundsprite":