]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Reset ghost role menu scroll upon search (#30159)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Sun, 21 Jul 2024 06:38:45 +0000 (16:38 +1000)
committerGitHub <noreply@github.com>
Sun, 21 Jul 2024 06:38:45 +0000 (02:38 -0400)
Quality of life so it doesn't sit on your old spot anymore.

Content.Client/UserInterface/Systems/Ghost/Controls/GhostTargetWindow.xaml
Content.Client/UserInterface/Systems/Ghost/Controls/GhostTargetWindow.xaml.cs

index 32cab732d142eb9cbb604cb6c67e1ca9feff9799..1d3002ed96690bad3cd5105973ebd0da0744841c 100644 (file)
@@ -2,7 +2,7 @@
     <BoxContainer Orientation="Vertical" HorizontalExpand="True" SizeFlagsStretchRatio="0.4">
         <Button Name="GhostnadoButton" Text="{Loc 'ghost-target-window-warp-to-most-followed'}" HorizontalAlignment="Center" Margin="0 4" />
         <LineEdit Name="SearchBar" PlaceHolder="Search" HorizontalExpand="True" Margin="0 4" />
-        <ScrollContainer VerticalExpand="True" HorizontalExpand="True" HScrollEnabled="False">
+        <ScrollContainer Name="GhostScroll" VerticalExpand="True" HorizontalExpand="True" HScrollEnabled="False">
             <BoxContainer Name="ButtonContainer" Orientation="Vertical" VerticalExpand="True" SeparationOverride="5">
                 <!-- Target buttons get added here by code -->
             </BoxContainer>
index 9a20226fdf429258867c259d65346fc445cbbd87..3ef69578a06166e56794516c32168e11947cbb24 100644 (file)
@@ -90,6 +90,8 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls
             _searchText = args.Text;
 
             UpdateVisibleButtons();
+            // Reset scroll bar so they can see the relevant results.
+            GhostScroll.SetScrollValue(Vector2.Zero);
         }
     }
 }