]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Change thief backpack ui name and description with Component fields (#41583)
authorimatsoup <93290208+imatsoup@users.noreply.github.com>
Thu, 27 Nov 2025 16:28:18 +0000 (16:28 +0000)
committerGitHub <noreply@github.com>
Thu, 27 Nov 2025 16:28:18 +0000 (16:28 +0000)
* Add new name and description fields to the thiefbackpack component and ui

* Change fields to locids, remove Title from menu.xaml, add comments to  thiefbackpackui.cs

Content.Client/Thief/ThiefBackpackMenu.xaml
Content.Client/Thief/ThiefBackpackMenu.xaml.cs
Content.Server/Thief/Components/ThiefUndeterminedBackpackComponent.cs
Content.Server/Thief/Systems/ThiefUndeterminedBackpackSystem.cs
Content.Shared/Thief/Components/ThiefBackpackUI.cs

index e46f18d4ed550411a744faa09d49665010fc67f3..125ddacd34f610fda22ae31e8d28d79af6bc986c 100644 (file)
@@ -1,7 +1,6 @@
 <controls:FancyWindow xmlns="https://spacestation14.io"
                                                xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
                                                xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
-                                               Title="{Loc 'thief-backpack-window-title'}"
                                                MinSize="700 700">
        <BoxContainer Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True">
                <!-- First Informational panel -->
@@ -25,7 +24,6 @@
                                </BoxContainer>
                        </ScrollContainer>
                </PanelContainer>
-               
                <!-- Third approve button panel -->
                <PanelContainer Margin="10">
                        <Button Name="ApproveButton"
index 328ca45b4b73de3265ccebb11a0fe31ce0876d67..e725574fd9949ba62dc4ba10b548605f1bde3c03 100644 (file)
@@ -46,7 +46,8 @@ public sealed partial class ThiefBackpackMenu : FancyWindow
                 selectedNumber++;
         }
 
-        Description.Text = Loc.GetString("thief-backpack-window-description", ("maxCount", state.MaxSelectedSets));
+        Title = Loc.GetString(state.ToolName);
+        Description.Text = Loc.GetString(state.ToolDesc, ("maxCount", state.MaxSelectedSets));
         SelectedSets.Text = Loc.GetString("thief-backpack-window-selected", ("selectedCount", selectedNumber), ("maxCount", state.MaxSelectedSets));
         ApproveButton.Disabled = selectedNumber != state.MaxSelectedSets;
     }
index 9080caa2456c8aced5b5a43522acd5d301ddb84a..e4fc1310d3891461c5cc05f1eb8415b8bd77dddc 100644 (file)
@@ -30,6 +30,18 @@ public sealed partial class ThiefUndeterminedBackpackComponent : Component
     [DataField]
     public int MaxSelectedSets = 2;
 
+    /// <summary>
+    /// Title field for undetermined equipment ui.
+    /// </summary>
+    [DataField]
+    public LocId ToolName = "thief-backpack-window-title";
+
+    /// <summary>
+    /// Description field for undetermined equipment ui.
+    /// </summary>
+    [DataField]
+    public LocId ToolDesc = "thief-backpack-window-description";
+
     /// <summary>
     /// What entity all the spawned items will appear inside of
     /// If null, will instead drop on the ground.
index 23f845a2e73a09848a7067baa8853b753a1bf9b5..65d8c5d0505b6bee3d834bfe5a754f595ac6d612 100644 (file)
@@ -96,6 +96,6 @@ public sealed class ThiefUndeterminedBackpackSystem : EntitySystem
             data.Add(i, info);
         }
 
-        _ui.SetUiState(uid, ThiefBackpackUIKey.Key, new ThiefBackpackBoundUserInterfaceState(data, component.MaxSelectedSets));
+        _ui.SetUiState(uid, ThiefBackpackUIKey.Key, new ThiefBackpackBoundUserInterfaceState(data, component.MaxSelectedSets, component.ToolName, component.ToolDesc));
     }
 }
index c68bd4cb2fbc4399a5c62a104fe50df40e4f0ee0..c0d655d232303e6ec701fb3557d4c5082e9a3b3c 100644 (file)
@@ -8,11 +8,17 @@ public sealed class ThiefBackpackBoundUserInterfaceState : BoundUserInterfaceSta
 {
     public readonly Dictionary<int, ThiefBackpackSetInfo> Sets;
     public int MaxSelectedSets;
+    // Name UI field set by ThiefUndeterminedBackpackComponent
+    public LocId ToolName;
+    // Description UI field set by ThiefUndeterminedBackpackComponent
+    public LocId ToolDesc;
 
-    public ThiefBackpackBoundUserInterfaceState(Dictionary<int, ThiefBackpackSetInfo> sets, int max)
+    public ThiefBackpackBoundUserInterfaceState(Dictionary<int, ThiefBackpackSetInfo> sets, int max, LocId toolName, LocId toolDesc)
     {
         Sets = sets;
         MaxSelectedSets = max;
+        ToolName = toolName;
+        ToolDesc = toolDesc;
     }
 }