From 0a1a82b18b86362263c8fa9ce8919c6d3b36d85c Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Thu, 26 Dec 2024 20:53:06 +1100 Subject: Head Rotation (way too hardcoded, not ideal but it will do in the meantime as many have been asking for it) --- source/frontend/StarOptionsMenu.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'source/frontend/StarOptionsMenu.cpp') diff --git a/source/frontend/StarOptionsMenu.cpp b/source/frontend/StarOptionsMenu.cpp index 8253f1f..28d44f6 100644 --- a/source/frontend/StarOptionsMenu.cpp +++ b/source/frontend/StarOptionsMenu.cpp @@ -10,6 +10,7 @@ #include "StarVoiceSettingsMenu.hpp" #include "StarBindingsMenu.hpp" #include "StarGraphicsMenu.hpp" +#include "StarHumanoid.hpp" namespace Star { @@ -47,6 +48,9 @@ OptionsMenu::OptionsMenu(PaneManager* manager, UniverseClientPtr client) reader.registerCallback("allowAssetsMismatchCheckbox", [=](Widget*) { updateAllowAssetsMismatch(); }); + reader.registerCallback("headRotationCheckbox", [=](Widget*) { + updateHeadRotation(); + }); reader.registerCallback("backButton", [=](Widget*) { dismiss(); }); @@ -77,6 +81,7 @@ OptionsMenu::OptionsMenu(PaneManager* manager, UniverseClientPtr client) m_clientIPJoinableButton = fetchChild("clientIPJoinableCheckbox"); m_clientP2PJoinableButton = fetchChild("clientP2PJoinableCheckbox"); m_allowAssetsMismatchButton = fetchChild("allowAssetsMismatchCheckbox"); + m_headRotationButton = fetchChild("headRotationCheckbox"); m_instrumentLabel = fetchChild("instrumentValueLabel"); m_sfxLabel = fetchChild("sfxValueLabel"); @@ -115,7 +120,8 @@ StringList const OptionsMenu::ConfigKeys = { "tutorialMessages", "clientIPJoinable", "clientP2PJoinable", - "allowAssetsMismatch" + "allowAssetsMismatch", + "humanoidHeadRotation" }; void OptionsMenu::initConfig() { @@ -166,6 +172,12 @@ void OptionsMenu::updateAllowAssetsMismatch() { Root::singleton().configuration()->set("allowAssetsMismatch", m_allowAssetsMismatchButton->isChecked()); } +void OptionsMenu::updateHeadRotation() { + m_localChanges.set("humanoidHeadRotation", m_headRotationButton->isChecked()); + Root::singleton().configuration()->set("humanoidHeadRotation", m_headRotationButton->isChecked()); + Humanoid::globalHeadRotation() = m_headRotationButton->isChecked(); +} + void OptionsMenu::syncGuiToConf() { m_instrumentSlider->setVal(m_localChanges.get("instrumentVol").toInt(), false); m_instrumentLabel->setText(toString(m_instrumentSlider->val())); @@ -180,6 +192,7 @@ void OptionsMenu::syncGuiToConf() { m_clientIPJoinableButton->setChecked(m_localChanges.get("clientIPJoinable").toBool()); m_clientP2PJoinableButton->setChecked(m_localChanges.get("clientP2PJoinable").toBool()); m_allowAssetsMismatchButton->setChecked(m_localChanges.get("allowAssetsMismatch").toBool()); + m_headRotationButton->setChecked(m_localChanges.get("humanoidHeadRotation").optBool().value(true)); auto appController = GuiContext::singleton().applicationController(); if (!appController->p2pNetworkingService()) { -- cgit v1.2.3