Browse Source

Factions top game bar button (#141)

* Update ContentContexts.cs

* Update KeyRebindTab.xaml.cs

* Update GameTopMenuBar.xaml

* Update ContentKeyFunctions.cs

* Update keybinds.yml

* Update game-hud.ftl
Papiditel 7 tháng trước cách đây
mục cha
commit
c1020902bd

+ 1 - 0
Content.Client/Input/ContentContexts.cs

@@ -135,6 +135,7 @@ public static void SetupContexts(IInputContextContainer contexts)
             common.AddFunction(ContentKeyFunctions.OpenDecalSpawnWindow);
             common.AddFunction(ContentKeyFunctions.OpenAdminMenu);
             common.AddFunction(ContentKeyFunctions.OpenGuidebook);
+            common.AddFunction(ContentKeyFunctions.OpenFactionsMenu);
         }
     }
 }

+ 1 - 0
Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs

@@ -216,6 +216,7 @@ void AddCheckBox(string checkBoxName, bool currentState, Action<BaseButton.Butto
             AddButton(ContentKeyFunctions.OpenCharacterMenu);
             AddButton(ContentKeyFunctions.OpenCraftingMenu);
             AddButton(ContentKeyFunctions.OpenGuidebook);
+            AddButton(ContentKeyFunctions.OpenFactionsMenu);
             AddButton(ContentKeyFunctions.OpenInventoryMenu);
             AddButton(ContentKeyFunctions.OpenAHelp);
             AddButton(ContentKeyFunctions.OpenActionsMenu);

+ 10 - 0
Content.Client/UserInterface/Systems/MenuBar/Widgets/GameTopMenuBar.xaml

@@ -73,6 +73,16 @@
         HorizontalExpand="True"
         AppendStyleClass="{x:Static style:StyleBase.ButtonSquare}"
         />
+    <ui:MenuButton
+        Name="FactionButton"
+        Access="Internal"
+        Icon="{xe:Tex '/Textures/Interface/fist.svg.192dpi.png'}"
+        BoundKey = "{x:Static is:ContentKeyFunctions.OpenFactionsMenu}"
+        ToolTip="{Loc 'game-hud-open-factions-menu-button-tooltip'}"
+        MinSize="42 64"
+        HorizontalExpand="True"
+        AppendStyleClass="{x:Static style:StyleBase.ButtonSquare}"
+        />
     <ui:MenuButton
         Name="AdminButton"
         Access="Internal"

+ 1 - 0
Content.Shared/Input/ContentKeyFunctions.cs

@@ -27,6 +27,7 @@ public static class ContentKeyFunctions
         public static readonly BoundKeyFunction OpenCharacterMenu = "OpenCharacterMenu";
         public static readonly BoundKeyFunction OpenEmotesMenu = "OpenEmotesMenu";
         public static readonly BoundKeyFunction OpenCraftingMenu = "OpenCraftingMenu";
+        public static readonly BoundKeyFunction OpenFactionsMenu = "OpenFactionsMenu";
         public static readonly BoundKeyFunction OpenGuidebook = "OpenGuidebook";
         public static readonly BoundKeyFunction OpenInventoryMenu = "OpenInventoryMenu";
         public static readonly BoundKeyFunction SmartEquipBackpack = "SmartEquipBackpack";

+ 1 - 0
Resources/Locale/en-US/HUD/game-hud.ftl

@@ -5,5 +5,6 @@ game-hud-open-emotes-menu-button-tooltip= Open emotes menu.
 game-hud-open-inventory-menu-button-tooltip = Open inventory menu.
 game-hud-open-crafting-menu-button-tooltip = Open crafting menu.
 game-hud-open-actions-menu-button-tooltip = Open actions menu.
+game-hud-open-factions-menu-button-tooltip = Open factions menu.
 game-hud-open-admin-menu-button-tooltip = Open admin menu.
 game-hud-open-sandbox-menu-button-tooltip = Open sandbox menu.

+ 3 - 0
Resources/keybinds.yml

@@ -234,6 +234,9 @@ binds:
   - function: OpenCraftingMenu
     type: State
     key: G
+  - function: OpenFactionsMenu
+    type: State
+    key: NumpadNum1
   - function: OpenGuidebook
     type: State
     key: NumpadNum0