New belt controls (#1298)

* Work for a madman

* God, that's a lot of hardcoding

* Fixed belt2 smartequip and cleaned up

* Continued clean up

* No scope creep!

* Replaced belt1 for upstream default belt

* Moved CP14OpenSkillMenu to CP14ContentContexts

* Changed naming of belt1 textures to just belt

* Updated new belt1 refrences

* I forgot to edit the RSI meta

* fix all BELT1 Texture instance

---------

Co-authored-by: Red <96445749+TheShuEd@users.noreply.github.com>
This commit is contained in:
TheKittehJesus
2025-06-03 06:39:39 -05:00
committed by GitHub
parent 0558da566a
commit 4c7b035c9c
84 changed files with 145 additions and 93 deletions

View File

@@ -128,9 +128,5 @@ namespace Content.Shared.Input
public static readonly BoundKeyFunction MappingRemoveDecal = "MappingRemoveDecal";
public static readonly BoundKeyFunction MappingCancelEraseDecal = "MappingCancelEraseDecal";
public static readonly BoundKeyFunction MappingOpenContextMenu = "MappingOpenContextMenu";
//CP14 keys
public static readonly BoundKeyFunction CP14OpenSkillMenu = "CP14OpenSkillMenu";
//CP14 keys end
}
}

View File

@@ -3,6 +3,7 @@ using Content.Shared.Containers.ItemSlots;
using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Input;
using Content.Shared._CP14.Input;
using Content.Shared.Inventory;
using Content.Shared.Popups;
using Content.Shared.Stacks;
@@ -35,6 +36,9 @@ public sealed class SmartEquipSystem : EntitySystem
CommandBinds.Builder
.Bind(ContentKeyFunctions.SmartEquipBackpack, InputCmdHandler.FromDelegate(HandleSmartEquipBackpack, handle: false, outsidePrediction: false))
.Bind(ContentKeyFunctions.SmartEquipBelt, InputCmdHandler.FromDelegate(HandleSmartEquipBelt, handle: false, outsidePrediction: false))
//CP14
.Bind(CP14ContentKeyFunctions.SmartEquipBelt2, InputCmdHandler.FromDelegate(HandleSmartEquipBelt2, handle: false, outsidePrediction: false))
//CP14 end
.Register<SmartEquipSystem>();
}
@@ -55,6 +59,11 @@ public sealed class SmartEquipSystem : EntitySystem
HandleSmartEquip(session, "belt");
}
private void HandleSmartEquipBelt2(ICommonSession? session)
{
HandleSmartEquip(session, "belt2");
}
//CP14 end
private void HandleSmartEquip(ICommonSession? session, string equipmentSlot)
{
if (session is not { } playerSession)

View File

@@ -12,6 +12,7 @@ using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Implants.Components;
using Content.Shared.Input;
using Content.Shared._CP14.Input;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Components;
using Content.Shared.Inventory;
@@ -172,6 +173,9 @@ public abstract class SharedStorageSystem : EntitySystem
CommandBinds.Builder
.Bind(ContentKeyFunctions.OpenBackpack, InputCmdHandler.FromDelegate(HandleOpenBackpack, handle: false))
.Bind(ContentKeyFunctions.OpenBelt, InputCmdHandler.FromDelegate(HandleOpenBelt, handle: false))
//CP14
.Bind(CP14ContentKeyFunctions.OpenBelt2, InputCmdHandler.FromDelegate(HandleOpenBelt2, handle: false))
//CP14 end
.Register<SharedStorageSystem>();
Subs.CVar(_cfg, CCVars.NestedStorage, OnNestedStorageCvar, true);
@@ -1832,6 +1836,12 @@ public abstract class SharedStorageSystem : EntitySystem
{
HandleToggleSlotUI(session, "belt");
}
//CP14
private void HandleOpenBelt2(ICommonSession? session)
{
HandleToggleSlotUI(session, "belt2");
}
//CP14 end
private void HandleToggleSlotUI(ICommonSession? session, string slot)
{

View File

@@ -0,0 +1,13 @@
using Robust.Shared.Input;
namespace Content.Shared._CP14.Input
{
[KeyFunctions]
public static class CP14ContentKeyFunctions
{
public static readonly BoundKeyFunction OpenBelt2 = "OpenBelt2";
public static readonly BoundKeyFunction SmartEquipBelt2 = "SmartEquipBelt2";
public static readonly BoundKeyFunction CP14OpenSkillMenu = "CP14OpenSkillMenu";
}
}