summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJake Edvenson <77412657+Dumbledork01@users.noreply.github.com>2026-07-10 10:37:24 -0700
committerGitHub <noreply@github.com>2026-07-10 17:37:24 +0000
commit49edb25c4501e25f4bdb6836a020952919c950d0 (patch)
treeca6be17c819fd61f1244bf05a4711dd95c6d7528
parent417256b42c722a2a8dcb9627c3762f0072c78310 (diff)
Optional 3rd-Person Mouse Camera Controls (#6891)
Included quick spins in disabled checks
-rw-r--r--soh/soh/Enhancements/controls/Mouse.cpp6
-rw-r--r--soh/soh/Enhancements/controls/SohInputEditorWindow.cpp18
2 files changed, 21 insertions, 3 deletions
diff --git a/soh/soh/Enhancements/controls/Mouse.cpp b/soh/soh/Enhancements/controls/Mouse.cpp
index 9cadf0a8c..043b7f899 100644
--- a/soh/soh/Enhancements/controls/Mouse.cpp
+++ b/soh/soh/Enhancements/controls/Mouse.cpp
@@ -34,7 +34,7 @@ void Mouse_UpdateAll() {
}
void Mouse_HandleThirdPerson(f32* newCamX, f32* newCamY) {
- if (MOUSE_ENABLED) {
+ if (MOUSE_ENABLED && !CVarGetInteger(CVAR_SETTING("DisableThirdPersonMouse"), 0)) {
*newCamX -= mouseCoordRel.x * 40.0f;
*newCamY -= mouseCoordRel.y * 40.0f;
}
@@ -84,7 +84,7 @@ static s32 mouseQuickspinY[5] = {};
static u8 quickspinCount = 0;
void Mouse_UpdateQuickspinCount() {
- if (MOUSE_ENABLED) {
+ if (MOUSE_ENABLED && !CVarGetInteger(CVAR_SETTING("DisableThirdPersonMouse"), 0)) {
quickspinCount = (quickspinCount + 1) % 5;
mouseQuickspinX[quickspinCount] = mouseCoord.x;
mouseQuickspinY[quickspinCount] = mouseCoord.y;
@@ -97,7 +97,7 @@ bool Mouse_HandleQuickspin(bool* should, s8* iter2, s8* sp3C) {
s8 temp1;
s8 temp2;
s32 i;
- if (!MOUSE_ENABLED) {
+ if (!MOUSE_ENABLED || CVarGetInteger(CVAR_SETTING("DisableThirdPersonMouse"), 0)) {
return *should = false;
}
diff --git a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp
index c02f310e4..f9a2c25c2 100644
--- a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp
+++ b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp
@@ -19,6 +19,7 @@ using namespace UIWidgets;
static WidgetInfo freeLook;
static WidgetInfo mouseControl;
static WidgetInfo mouseAutoCapture;
+static WidgetInfo mouseDisableThirdPerson;
static WidgetInfo rightStickOcarina;
static WidgetInfo dpadOcarina;
static WidgetInfo dpadPause;
@@ -1377,6 +1378,10 @@ void SohInputEditorWindow::DrawCameraControlPanel() {
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
SohGui::mSohMenu->MenuDrawItem(mouseAutoCapture, static_cast<uint32_t>(ImGui::GetContentRegionAvail().x),
THEME_COLOR);
+ cursor = ImGui::GetCursorPos();
+ ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
+ SohGui::mSohMenu->MenuDrawItem(mouseDisableThirdPerson, static_cast<uint32_t>(ImGui::GetContentRegionAvail().x),
+ THEME_COLOR);
Ship::GuiWindow::BeginGroupPanel("Aiming/First-Person Camera", ImGui::GetContentRegionAvail());
CVarCheckbox("Right Stick Aiming", CVAR_SETTING("Controls.RightStickAim"),
@@ -1909,6 +1914,19 @@ void RegisterInputEditorWidgets() {
"and capture mouse input when closing the menu."));
SohGui::mSohMenu->AddSearchWidget({ mouseAutoCapture, "Settings", "Controls", "Camera Controls" });
+ mouseDisableThirdPerson = { .name = "Disable Third-Person Mouse Controls",
+ .type = WidgetType::WIDGET_CVAR_CHECKBOX };
+ mouseDisableThirdPerson.CVar(CVAR_SETTING("DisableThirdPersonMouse"))
+ .PreFunc([](WidgetInfo& info) {
+ info.options->disabled = !CVarGetInteger(CVAR_SETTING("EnableMouse"), 0);
+ info.options->disabledTooltip = "Forced off because Mouse Controls are disabled.";
+ })
+ .Options(CheckboxOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("Stops the mouse from moving the third-person camera and from triggering quickspins, "
+ "while still allowing mouse control for first-person aiming and the shield."));
+ SohGui::mSohMenu->AddSearchWidget({ mouseDisableThirdPerson, "Settings", "Controls", "Camera Controls" });
+
rightStickOcarina = { .name = "Right Stick Ocarina Playback", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
rightStickOcarina.CVar(CVAR_SETTING("CustomOcarina.RightStick")).Options(CheckboxOptions().Color(THEME_COLOR));
SohGui::mSohMenu->AddSearchWidget({ rightStickOcarina, "Settings", "Controls", "Ocarina Controls" });