diff --git a/Content.Client/Input/ContentContexts.cs b/Content.Client/Input/ContentContexts.cs index 100eb65d4b57..8f649075f45c 100644 --- a/Content.Client/Input/ContentContexts.cs +++ b/Content.Client/Input/ContentContexts.cs @@ -1,4 +1,5 @@ using Content.Shared.Input; +using Content.Shared.SS220.Input; using Robust.Shared.Input; namespace Content.Client.Input @@ -78,6 +79,7 @@ public static void SetupContexts(IInputContextContainer contexts) human.AddFunction(ContentKeyFunctions.RotateObjectClockwise); human.AddFunction(ContentKeyFunctions.RotateObjectCounterclockwise); human.AddFunction(ContentKeyFunctions.FlipObject); + human.AddFunction(KeyFunctions220.ResistFire); // SS220 resist fire bind human.AddFunction(ContentKeyFunctions.ArcadeUp); human.AddFunction(ContentKeyFunctions.ArcadeDown); human.AddFunction(ContentKeyFunctions.ArcadeLeft); diff --git a/Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs b/Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs index 71f0ad391e4c..7c91c086d6e0 100644 --- a/Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs +++ b/Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs @@ -2,6 +2,7 @@ using Content.Client.Stylesheets; using Content.Shared.CCVar; using Content.Shared.Input; +using Content.Shared.SS220.Input; using Robust.Client.AutoGenerated; using Robust.Client.Input; using Robust.Client.UserInterface; @@ -199,6 +200,7 @@ void AddCheckBox(string checkBoxName, bool currentState, Action(OnExtinguishActivateInWorld); SubscribeLocalEvent(OnDamageChanged); + + // SS220 resist fire bind + CommandBinds.Builder + .Bind(KeyFunctions220.ResistFire, InputCmdHandler.FromDelegate(HandleResistFireKey, handle: false)) + .Register(); } private void OnMeleeHit(EntityUid uid, IgniteOnMeleeHitComponent component, MeleeHitEvent args) @@ -251,6 +259,17 @@ private void OnRejuvenate(EntityUid uid, FlammableComponent component, Rejuvenat Extinguish(uid, component); } + // SS220 resist fire bind begin + private void HandleResistFireKey(ICommonSession? session) + { + if (session?.AttachedEntity is not { } uid || + !TryComp(uid, out var comp)) + return; + + Resist(uid, comp); + } + // SS220 resist fire bind end + private void OnResistFireAlert(Entity ent, ref ResistFireAlertEvent args) { if (args.Handled) diff --git a/Content.Shared/SS220/Input/KeyFunctions220.cs b/Content.Shared/SS220/Input/KeyFunctions220.cs index c498f3c5a133..e0550b197c4e 100644 --- a/Content.Shared/SS220/Input/KeyFunctions220.cs +++ b/Content.Shared/SS220/Input/KeyFunctions220.cs @@ -23,6 +23,7 @@ public static class KeyFunctions220 public static readonly BoundKeyFunction CalculatorTypeDivide = "CalculatorTypeDivide"; public static readonly BoundKeyFunction CalculatorEnter = "CalculatorEnter"; public static readonly BoundKeyFunction CalculatorClear = "CalculatorClear"; + public static readonly BoundKeyFunction ResistFire = "ResistFire"; public static void AddCalculatorKeys(IInputCmdContext context) { diff --git a/Resources/Locale/ru-RU/ss220/escape-menu/ui/options-menu.ftl b/Resources/Locale/ru-RU/ss220/escape-menu/ui/options-menu.ftl index a9c576cb1ef5..6b7959d7fe0f 100644 --- a/Resources/Locale/ru-RU/ss220/escape-menu/ui/options-menu.ftl +++ b/Resources/Locale/ru-RU/ss220/escape-menu/ui/options-menu.ftl @@ -1 +1,2 @@ ui-options-function-smart-equip-neck = Умная экипировка на шею +ui-options-function-resist-fire = Потушить себя diff --git a/Resources/keybinds.yml b/Resources/keybinds.yml index 03e6b13dfec2..f3e9df2354e9 100644 --- a/Resources/keybinds.yml +++ b/Resources/keybinds.yml @@ -640,4 +640,9 @@ binds: - function: CalculatorClear type: State key: Delete -# SS220 Calculator end \ No newline at end of file +# SS220 Calculator end +# SS220 resist fire bind begin +- function: ResistFire + type: State + key: B +# SS220 resist fire bind end