Skip to content

Commit

Permalink
custom keybind option for extract (#280)
Browse files Browse the repository at this point in the history
language files will need a little rework because of this, to reflect the
actual keybind that is used
  • Loading branch information
devbence authored Apr 24, 2024
2 parents d5ba95e + 2b8639a commit 3d496b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions Source/Configuration/PluginConfigSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using StayInTarkov.Networking;
using System;
using System.Net;
using UnityEngine;

#nullable enable

Expand Down Expand Up @@ -96,6 +97,8 @@ public bool SETTING_DEBUGShowPlayerList
public bool SETTING_HeadshotsAlwaysKill { get; set; } = false;
public bool SETTING_ShowFeed { get; set; } = true;
public bool SETTING_ShowSITStatistics { get; set; } = true;
public ConfigEntry<KeyboardShortcut> SETTING_PressToExtractKey { get; private set; }
public ConfigEntry<KeyboardShortcut> SETTING_PressToForceExtractKey { get; private set; }
public bool ShowPing { get; set; } = true;
public int SITWebSocketPort { get; set; } = 6970;
public int SITNatHelperPort { get; set; } = 6971;
Expand Down Expand Up @@ -140,6 +143,11 @@ public void GetSettings()
SETTING_ShowFeed = StayInTarkovPlugin.Instance.Config.Bind
("Coop", "ShowFeed", true, new ConfigDescription("Enable the feed on the bottom right of the screen which shows player/bot spawns, kills, etc.")).Value;

SETTING_PressToExtractKey = StayInTarkovPlugin.Instance.Config.Bind
("Coop", "PressToExtractKey", new KeyboardShortcut(KeyCode.F8), new ConfigDescription("The key you need to press to leave the raid."));

SETTING_PressToForceExtractKey = StayInTarkovPlugin.Instance.Config.Bind
("Coop", "PressToForceExtractKey", new KeyboardShortcut(KeyCode.F7), new ConfigDescription("The key you need to press to FORCE leave the raid."));

AllPlayersSpawnTogether = StayInTarkovPlugin.Instance.Config.Bind
("Coop", "AllPlayersSpawnTogether", true, new ConfigDescription("Whether to spawn all players in the same place")).Value;
Expand Down
4 changes: 2 additions & 2 deletions Source/Coop/Components/CoopGameComponents/SITGameComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ void ProcessQuitting()
var quitState = GetQuitState();

if (
Input.GetKeyDown(KeyCode.F8)
PluginConfigSettings.Instance.CoopSettings.SETTING_PressToExtractKey.Value.IsDown()
&&
quitState != EQuitState.NONE
&& !RequestQuitGame
Expand Down Expand Up @@ -710,7 +710,7 @@ void ProcessQuitting()
return;
}
else if (
Input.GetKeyDown(KeyCode.F7)
PluginConfigSettings.Instance.CoopSettings.SETTING_PressToForceExtractKey.Value.IsDown()
&&
quitState != EQuitState.NONE
&& !RequestQuitGame
Expand Down

0 comments on commit 3d496b1

Please sign in to comment.