diff --git a/Content.Client/Input/ContentContexts.cs b/Content.Client/Input/ContentContexts.cs index 16256dff4573..1a662afc0170 100644 --- a/Content.Client/Input/ContentContexts.cs +++ b/Content.Client/Input/ContentContexts.cs @@ -80,6 +80,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 336a0329f290..bc9cb1152888 100644 --- a/Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs +++ b/Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs @@ -201,6 +201,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 4f0ad899d088..4155bd25e2ba 100644 --- a/Content.Shared/SS220/Input/KeyFunctions220.cs +++ b/Content.Shared/SS220/Input/KeyFunctions220.cs @@ -24,6 +24,7 @@ public static class KeyFunctions220 public static readonly BoundKeyFunction CalculatorEnter = "CalculatorEnter"; public static readonly BoundKeyFunction CalculatorClear = "CalculatorClear"; public static readonly BoundKeyFunction ItemOffer = "ItemOffer"; + 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 4b76241cf450..ae1746196053 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,2 +1,3 @@ ui-options-function-smart-equip-neck = Умная экипировка на шею ui-options-function-item-offer = Передать предмет +ui-options-function-resist-fire = Потушить себя diff --git a/Resources/keybinds.yml b/Resources/keybinds.yml index 2faa8ddfc7c9..f0f7ce36119c 100644 --- a/Resources/keybinds.yml +++ b/Resources/keybinds.yml @@ -647,3 +647,8 @@ binds: key: R mod1: Shift # SS220 ItemOffer bind end +# SS220 resist fire bind begin +- function: ResistFire + type: State + key: B +# SS220 resist fire bind end