]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add flip button to mapping state (#30636)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Thu, 19 Sep 2024 00:02:27 +0000 (10:02 +1000)
committerGitHub <noreply@github.com>
Thu, 19 Sep 2024 00:02:27 +0000 (10:02 +1000)
Content.Client/Mapping/MappingScreen.xaml
Content.Client/Mapping/MappingScreen.xaml.cs

index b64136084788ac674f3ca328e057817dcb365e7b..9cc3e734f0e9ee7916cacc206557900e5cce3d2e 100644 (file)
@@ -78,6 +78,7 @@
                                                   ToolTip="Pick (Hold 5)" />
                     <mapping:MappingActionsButton Name="Delete" Access="Public"
                                                   ToolTip="Delete (Hold 6)" />
+                    <mapping:MappingActionsButton Name="Flip" Access="Public" ToggleMode="False"/>
                 </BoxContainer>
             </PanelContainer>
         </LayoutContainer>
index b2ad2fd83fbb8d8bf1b8704b3c42f5b1cd3ba0ee..46c0e51fad69b4c17b057bb973e531ed2fce4b11 100644 (file)
@@ -96,6 +96,22 @@ public sealed partial class MappingScreen : InGameScreen
 
         Pick.Texture.TexturePath = "/Textures/Interface/eyedropper.svg.png";
         Delete.Texture.TexturePath = "/Textures/Interface/eraser.svg.png";
+        Flip.Texture.TexturePath = "/Textures/Interface/VerbIcons/rotate_cw.svg.192dpi.png";
+        Flip.OnPressed += args => FlipSides();
+    }
+
+    public void FlipSides()
+    {
+        ScreenContainer.Flip();
+
+        if (SpawnContainer.GetPositionInParent() == 0)
+        {
+            Flip.Texture.TexturePath = "/Textures/Interface/VerbIcons/rotate_cw.svg.192dpi.png";
+        }
+        else
+        {
+            Flip.Texture.TexturePath = "/Textures/Interface/VerbIcons/rotate_ccw.svg.192dpi.png";
+        }
     }
 
     private void OnDecalColorPicked(Color color)