mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-01-30 15:00:13 -05:00
Stick sensitivity modifiers
This commit is contained in:
parent
21e55563b4
commit
6e43514b22
@ -1824,6 +1824,15 @@ void SohInputEditorWindow::DrawLinkTab() {
|
||||
CVAR_SETTING("WalkModifier.SwimMapping2"), 0.0f, 5.0f, "", 1.0f,
|
||||
true, true, false, true);
|
||||
Ship::GuiWindow::EndGroupPanel(0);
|
||||
Ship::GuiWindow::BeginGroupPanel("Sensitivity Modifier", ImGui::GetContentRegionAvail());
|
||||
UIWidgets::PaddedEnhancementSliderFloat("Sensitivity Modifier 1: %.0f %%", "##SensitivityMod1",
|
||||
CVAR_SETTING("WalkModifier.SensitivityMapping1"), 0.0f, 1.0f, "", 1.0f,
|
||||
true, true, false, true);
|
||||
UIWidgets::PaddedEnhancementSliderFloat("Sensitivity Modifier 2: %.0f %%", "##SensitivityMod2",
|
||||
CVAR_SETTING("WalkModifier.SensitivityMapping2"), 0.0f, 1.0f, "", 1.0f,
|
||||
true, true, false, true);
|
||||
|
||||
Ship::GuiWindow::EndGroupPanel(0);
|
||||
Ship::GuiWindow::EndGroupPanel(0);
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
|
@ -237,6 +237,28 @@ void PadMgr_ProcessInputs(PadMgr* padMgr) {
|
||||
GameInteractor_SetEmulatedButtons(0);
|
||||
}
|
||||
|
||||
// #region SOH [Enhancement]
|
||||
f32 sensitivityMod = 1.0f;
|
||||
|
||||
if (CVarGetInteger(CVAR_SETTING("WalkModifier.Enabled"), 0) == 1) {
|
||||
if (CVarGetInteger(CVAR_SETTING("WalkModifier.SpeedToggle"), 0) == 1) {
|
||||
if (gWalkSpeedToggle1) {
|
||||
sensitivityMod *= CVarGetFloat(CVAR_SETTING("WalkModifier.SensitivityMapping1"), 1.0f);
|
||||
} else if (gWalkSpeedToggle2) {
|
||||
sensitivityMod *= CVarGetFloat(CVAR_SETTING("WalkModifier.SensitivityMapping2"), 1.0f);
|
||||
}
|
||||
} else {
|
||||
if (CHECK_BTN_ALL(input->cur.button, BTN_CUSTOM_MODIFIER1)) {
|
||||
sensitivityMod *= CVarGetFloat(CVAR_SETTING("WalkModifier.SensitivityMapping1"), 1.0f);
|
||||
} else if (CHECK_BTN_ALL(input->cur.button, BTN_CUSTOM_MODIFIER2)) {
|
||||
sensitivityMod *= CVarGetFloat(CVAR_SETTING("WalkModifier.SensitivityMapping2"), 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
input->cur.stick_x *= sensitivityMod;
|
||||
input->cur.stick_y *= sensitivityMod;
|
||||
// #endregion
|
||||
|
||||
if (GameInteractor_ReverseControlsActive()) {
|
||||
if (input->cur.stick_x == -128) {
|
||||
input->cur.stick_x = 127;
|
||||
|
Loading…
Reference in New Issue
Block a user