]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
ok final actions fixes fr this time (#21683)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Thu, 16 Nov 2023 05:12:47 +0000 (00:12 -0500)
committerGitHub <noreply@github.com>
Thu, 16 Nov 2023 05:12:47 +0000 (00:12 -0500)
Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml
Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml.cs
Content.Client/UserInterface/Systems/Actions/ActionUIController.cs
Content.Client/UserInterface/Systems/Actions/Controls/ActionButton.cs

index 33418520a2d1f16e143fc8cfe11bdfdb716c575b..d62ad33dfc1848ff4fcbe4b35405d1ed9626b2ff 100644 (file)
     <controls:RecordedSplitContainer Name="ScreenContainer" HorizontalExpand="True" VerticalExpand="True" SplitWidth="0" StretchDirection="TopLeft">
         <LayoutContainer Name="ViewportContainer" HorizontalExpand="True" VerticalExpand="True">
             <controls:MainViewport Name="MainViewport"/>
-            <BoxContainer Name="VoteMenu" Access="Public" Orientation="Vertical"/>
             <widgets:GhostGui Name="Ghost" Access="Protected" />
             <hotbar:HotbarGui Name="Hotbar" Access="Protected" />
-            <actions:ActionsBar Name="Actions" Access="Protected" />
+            <BoxContainer Name="TopLeftContainer" Orientation="Vertical">
+                <actions:ActionsBar Name="Actions" Access="Protected" />
+                <BoxContainer Name="VoteMenu" Access="Public" Orientation="Vertical"/>
+            </BoxContainer>
             <alerts:AlertsUI Name="Alerts" Access="Protected" />
         </LayoutContainer>
         <PanelContainer HorizontalExpand="True" MinWidth="300">
index e0c66b7a8bb43afa99137decb4ad4af7e21eca5f..7816cf1be194275e92964acb6e55486bf49120c9 100644 (file)
@@ -18,8 +18,7 @@ public sealed partial class SeparatedChatGameScreen : InGameScreen
         SetAnchorPreset(ScreenContainer, LayoutPreset.Wide);
         SetAnchorPreset(ViewportContainer, LayoutPreset.Wide);
         SetAnchorPreset(MainViewport, LayoutPreset.Wide);
-        SetAnchorAndMarginPreset(VoteMenu, LayoutPreset.TopLeft, margin: 10);
-        SetAnchorAndMarginPreset(Actions, LayoutPreset.TopLeft, margin: 10);
+        SetAnchorAndMarginPreset(TopLeftContainer, LayoutPreset.TopLeft, margin: 10);
         SetAnchorAndMarginPreset(Ghost, LayoutPreset.BottomWide, margin: 80);
         SetAnchorAndMarginPreset(Hotbar, LayoutPreset.BottomWide, margin: 5);
         SetAnchorAndMarginPreset(Alerts, LayoutPreset.CenterRight, margin: 10);
index 5a992786a29ba06a08065445c98d38df82e7a5c9..635647c89091d71ec2c5f35a884efce3ec6c4bf7 100644 (file)
@@ -752,6 +752,12 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
 
     public void RegisterActionContainer(ActionButtonContainer container)
     {
+        if (_container != null)
+        {
+            _container.ActionPressed -= OnActionPressed;
+            _container.ActionUnpressed -= OnActionUnpressed;
+        }
+
         _container = container;
         _container.ActionPressed += OnActionPressed;
         _container.ActionUnpressed += OnActionUnpressed;
index ded6f77f9549295f1b8ce211d5e784f456950d0c..aab160a162d0ac820ae245c345c85b6e2afdd0f9 100644 (file)
@@ -283,13 +283,15 @@ public sealed class ActionButton : Control, IEntityControl
 
     public void UpdateBackground()
     {
-        if (_action == null)
+        _controller ??= UserInterfaceManager.GetUIController<ActionUIController>();
+        if (_action != null ||
+            _controller.IsDragging && GetPositionInParent() == Parent?.ChildCount - 1)
         {
-            Button.Texture = null;
+            Button.Texture = _buttonBackgroundTexture;
         }
         else
         {
-            Button.Texture = _buttonBackgroundTexture;
+            Button.Texture = null;
         }
     }
 
@@ -326,6 +328,8 @@ public sealed class ActionButton : Control, IEntityControl
     {
         base.FrameUpdate(args);
 
+        UpdateBackground();
+
         Cooldown.Visible = _action != null && _action.Cooldown != null;
         if (_action == null)
             return;
@@ -397,7 +401,7 @@ public sealed class ActionButton : Control, IEntityControl
 
         // it's only depress-able if it's usable, so if we're depressed
         // show the depressed style
-        if (_depressed)
+        if (_depressed && !_beingHovered)
         {
             HighlightRect.Visible = false;
             SetOnlyStylePseudoClass(ContainerButton.StylePseudoClassPressed);