From ac26310986c2cddcf1aa74389b23c9db636dca56 Mon Sep 17 00:00:00 2001 From: PringlesGang Date: Sat, 25 Jan 2025 19:47:17 +0100 Subject: [PATCH] Added default config settings profile support --- CMakeLists.txt | 4 +- profiles/cclcc/configsystem.lua | 24 +++++++++ profiles/cclcc/game.lua | 1 + src/audio/audiosystem.cpp | 10 ++-- src/configsystem.cpp | 14 ------ src/game.cpp | 6 +-- src/games/cclcc/optionsmenu.cpp | 31 ++++++------ src/games/cclcc/savesystem.cpp | 4 +- src/hud/delusiontrigger.cpp | 5 +- src/hud/tipsnotification.cpp | 4 +- src/profile/configsystem.cpp | 83 ++++++++++++++++++++++++++++++++ src/{ => profile}/configsystem.h | 53 ++++++++++++++------ src/text.cpp | 9 ++-- src/ui/backlogmenu.cpp | 9 ++-- src/ui/optionsmenu.h | 3 +- src/vm/inst_dialogue.cpp | 11 +++-- src/vm/inst_misc.cpp | 4 +- src/vm/interface/input.cpp | 6 +-- 18 files changed, 202 insertions(+), 79 deletions(-) create mode 100644 profiles/cclcc/configsystem.lua delete mode 100644 src/configsystem.cpp create mode 100644 src/profile/configsystem.cpp rename src/{ => profile}/configsystem.h (55%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c07ba234..de8b323fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,6 @@ set(Impacto_Src src/minilua_impl.c src/voicetable.cpp src/animation.cpp - src/configsystem.cpp src/renderer/renderer.cpp @@ -49,6 +48,7 @@ set(Impacto_Src src/profile/vm.cpp src/profile/scriptvars.cpp src/profile/scriptinput.cpp + src/profile/configsystem.cpp src/profile/data/savesystem.cpp src/profile/data/tipssystem.cpp @@ -353,7 +353,6 @@ set(Impacto_Header src/rng.h src/animation.h src/minilua_impl.h - src/configsystem.h src/renderer/renderer.h src/renderer/window.h @@ -377,6 +376,7 @@ set(Impacto_Header src/profile/vm.h src/profile/scriptvars.h src/profile/scriptinput.h + src/profile/configsystem.h src/profile/data/savesystem.h src/profile/data/tipssystem.h diff --git a/profiles/cclcc/configsystem.lua b/profiles/cclcc/configsystem.lua new file mode 100644 index 000000000..02eabd002 --- /dev/null +++ b/profiles/cclcc/configsystem.lua @@ -0,0 +1,24 @@ +root.ConfigSystem = { + ShowTipsNotification = true; + AdvanceTextOnDirectionalInput = false; + DirectionalInputForTrigger = false; + TriggerStopSkip = true; + + TextSpeed = 768 / 60; + TextSpeedBounds = { X = 256 / 60, Y = 4096 / 60 }; + AutoSpeed = 768 / 60; + AutoSpeedBounds = { X = 2048 / 60, Y = 256 / 60 }; + + SkipRead = true; + SyncVoice = true; + SkipVoice = false; + + VoiceCount = 13; + VoiceMuted = {}; + VoiceVolume = {}; +}; + +for i = 1, root.ConfigSystem.VoiceCount do + root.ConfigSystem.VoiceMuted[i] = false; + root.ConfigSystem.VoiceVolume[i] = 1; +end \ No newline at end of file diff --git a/profiles/cclcc/game.lua b/profiles/cclcc/game.lua index d932c6981..0df8ec219 100644 --- a/profiles/cclcc/game.lua +++ b/profiles/cclcc/game.lua @@ -41,6 +41,7 @@ include('cclcc/charset.lua'); --include('cclcc/font-lb.lua'); include('cclcc/font-lb-italic.lua'); include('cclcc/dialogue.lua'); +include('cclcc/configsystem.lua'); include('cclcc/hud/saveicon.lua'); include('cclcc/hud/loadingdisplay.lua'); include('cclcc/hud/datedisplay.lua'); diff --git a/src/audio/audiosystem.cpp b/src/audio/audiosystem.cpp index a46ad4aae..f5aebc02d 100644 --- a/src/audio/audiosystem.cpp +++ b/src/audio/audiosystem.cpp @@ -2,7 +2,7 @@ #include "../log.h" #include "../profile/game.h" #include "../profile/scriptvars.h" -#include "../configsystem.h" +#include "../profile/configsystem.h" #ifndef IMPACTO_DISABLE_OPENAL #include "openal/audiobackend.h" @@ -53,10 +53,6 @@ void AudioInit() { if (!Backend->Init()) return; - for (int i = 0; i < ACG_Count; i++) { - GroupVolumes[i] = 0.5f; - } - for (int i = AC_SE0; i <= AC_SE2; i++) Channels[i]->Init((AudioChannelId)i, ACG_SE); for (int i = AC_VOICE0; i <= AC_REV; i++) @@ -74,9 +70,9 @@ void AudioUpdate(float dt) { const int charId = ScrWork[SW_ANIME0CHANO + (i - AC_VOICE0)]; const int mappedCharId = ScrWork[SW_CHARACTERIDMAPPING + charId]; const float voiceVolumeModifier = - ConfigSystem::VoiceMuted[mappedCharId] + Profile::ConfigSystem::VoiceMuted[mappedCharId] ? 0.0f - : ConfigSystem::VoiceVolume[mappedCharId]; + : Profile::ConfigSystem::VoiceVolume[mappedCharId]; Channels[i]->Volume = voiceVolumeModifier; } diff --git a/src/configsystem.cpp b/src/configsystem.cpp deleted file mode 100644 index 104f40fae..000000000 --- a/src/configsystem.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "configsystem.h" - -#include - -namespace Impacto { -namespace ConfigSystem { - -void Init() { - std::fill_n(VoiceMuted, VoiceCount, false); - std::fill_n(VoiceVolume, VoiceCount, 1.0f); -} - -} // namespace ConfigSystem -} // namespace Impacto \ No newline at end of file diff --git a/src/game.cpp b/src/game.cpp index bd87d62bf..722afaf2f 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -7,7 +7,6 @@ #include "log.h" #include "inputsystem.h" #include "debugmenu.h" -#include "configsystem.h" #include "ui/ui.h" @@ -40,6 +39,7 @@ #include "profile/scene3d.h" #include "profile/vm.h" #include "profile/scriptvars.h" +#include "profile/configsystem.h" #include "profile/ui/selectionmenu.h" #include "profile/ui/sysmesbox.h" #include "profile/ui/systemmenu.h" @@ -82,6 +82,8 @@ static void Init() { memset(DrawComponents, DrawComponentType::None, sizeof(DrawComponents)); + Profile::ConfigSystem::Configure(); + if (Profile::GameFeatures & GameFeature::Audio) { Audio::AudioInit(); } @@ -93,8 +95,6 @@ static void Init() { memset(ScrWork, 0, sizeof(ScrWork)); memset(FlagWork, 0, sizeof(FlagWork)); - ConfigSystem::Init(); - if (Profile::GameFeatures & GameFeature::Renderer2D) { Profile::LoadSpritesheets(); Profile::Charset::Load(); diff --git a/src/games/cclcc/optionsmenu.cpp b/src/games/cclcc/optionsmenu.cpp index 11472be4c..b6ab73a83 100644 --- a/src/games/cclcc/optionsmenu.cpp +++ b/src/games/cclcc/optionsmenu.cpp @@ -1,6 +1,6 @@ #include "optionsmenu.h" -#include "../../configsystem.h" +#include "../../profile/configsystem.h" #include "../../profile/game.h" #include "../../profile/ui/optionsmenu.h" #include "../../profile/games/cclcc/optionsmenu.h" @@ -18,10 +18,10 @@ namespace CCLCC { using namespace Impacto::Profile::OptionsMenu; using namespace Impacto::Profile::CCLCC::OptionsMenu; using namespace Impacto::Profile::ScriptVars; +using namespace Impacto::Profile::ConfigSystem; using namespace Impacto::UI::Widgets; using namespace Impacto::UI::Widgets::CCLCC; using namespace Impacto::Vm::Interface; -using namespace Impacto::ConfigSystem; std::unique_ptr OptionsMenu::CreateBasicPage( const std::function& select, @@ -383,27 +383,30 @@ void OptionsMenu::Highlight(Widget* toHighlight) { void OptionsMenu::ResetToDefault() { switch (CurrentPage) { case PageType::Basic: { - ShowTipsNotification = true; - AdvanceTextOnDirectionalInput = false; - DirectionalInputForTrigger = false; - TriggerStopSkip = true; + ShowTipsNotification = Default::ShowTipsNotification; + AdvanceTextOnDirectionalInput = Default::AdvanceTextOnDirectionalInput; + DirectionalInputForTrigger = Default::DirectionalInputForTrigger; + TriggerStopSkip = Default::TriggerStopSkip; break; } case PageType::Text: { - TextSpeed = 768.0f / 60.0f; - AutoSpeed = 768.0f / 60.0f; - SkipRead = true; + TextSpeed = Default::TextSpeed; + AutoSpeed = Default::AutoSpeed; + SkipRead = Default::SkipRead; break; } case PageType::Sound: { - std::fill_n(Audio::GroupVolumes, Audio::ACG_Count, 0.5f); - SyncVoice = true; - SkipVoice = false; + std::copy(std::begin(Default::GroupVolumes), + std::end(Default::GroupVolumes), Audio::GroupVolumes); + SyncVoice = Default::SyncVoice; + SkipVoice = Default::SkipVoice; break; } case PageType::Voice: { - std::fill_n(VoiceMuted, VoiceCount, false); - std::fill_n(VoiceVolume, VoiceCount, 1.0f); + std::copy(std::begin(Default::VoiceMuted), std::end(Default::VoiceMuted), + VoiceMuted); + std::copy(std::begin(Default::VoiceVolume), + std::end(Default::VoiceVolume), VoiceVolume); break; } default: diff --git a/src/games/cclcc/savesystem.cpp b/src/games/cclcc/savesystem.cpp index 2571bad9c..212848a58 100644 --- a/src/games/cclcc/savesystem.cpp +++ b/src/games/cclcc/savesystem.cpp @@ -9,7 +9,7 @@ #include "../../profile/vm.h" #include "../../ui/mapsystem.h" #include "../../renderer/renderer.h" -#include "../../configsystem.h" +#include "../../profile/configsystem.h" #include "yesnotrigger.h" @@ -24,7 +24,7 @@ using namespace Impacto::Vm; using namespace Impacto::Profile::SaveSystem; using namespace Impacto::Profile::ScriptVars; using namespace Impacto::Profile::Vm; -using namespace Impacto::ConfigSystem; +using namespace Impacto::Profile::ConfigSystem; SaveError SaveSystem::CheckSaveFile() { std::error_code ec; diff --git a/src/hud/delusiontrigger.cpp b/src/hud/delusiontrigger.cpp index dd1ad5b6f..795e21f66 100644 --- a/src/hud/delusiontrigger.cpp +++ b/src/hud/delusiontrigger.cpp @@ -1,6 +1,6 @@ #include "../profile/hud/delusiontrigger.h" +#include "../profile/configsystem.h" #include "../text.h" -#include "../configsystem.h" namespace Impacto { namespace DelusionTrigger { @@ -16,7 +16,8 @@ void Show() { bool Show(int bgMtrgSelBufferId, int bgMtrgNegaPosiBufferId, int param3) { if (Implementation) { - if (ConfigSystem::TriggerStopSkip) MesSkipMode &= SkipModeFlags::Auto; + if (Profile::ConfigSystem::TriggerStopSkip) + MesSkipMode &= SkipModeFlags::Auto; return Implementation->Show(bgMtrgSelBufferId, bgMtrgNegaPosiBufferId, param3); } diff --git a/src/hud/tipsnotification.cpp b/src/hud/tipsnotification.cpp index 91f12adb2..2b7e04731 100644 --- a/src/hud/tipsnotification.cpp +++ b/src/hud/tipsnotification.cpp @@ -1,6 +1,6 @@ #include "datedisplay.h" -#include "../configsystem.h" +#include "../profile/configsystem.h" #include "../profile/hud/tipsnotification.h" namespace Impacto { @@ -16,7 +16,7 @@ void Render() { } void AddTip(int tipId) { - if (Implementation && ConfigSystem::ShowTipsNotification) + if (Implementation && Profile::ConfigSystem::ShowTipsNotification) Implementation->AddTip(tipId); } diff --git a/src/profile/configsystem.cpp b/src/profile/configsystem.cpp new file mode 100644 index 000000000..adcfe2804 --- /dev/null +++ b/src/profile/configsystem.cpp @@ -0,0 +1,83 @@ +#include "configsystem.h" +#include "profile_internal.h" +#include "../audio/audiosystem.h" + +namespace Impacto { +namespace Profile { +namespace ConfigSystem { + +void Configure() { + std::fill_n(Default::VoiceMuted, VoiceCount, false); + std::fill_n(Default::VoiceVolume, VoiceCount, 1.0f); + std::fill_n(Default::GroupVolumes, Audio::ACG_Count, 0.5f); + + if (TryPushMember("ConfigSystem")) { + AssertIs(LUA_TTABLE); + + Default::ShowTipsNotification = + TryGetMemberBool("ShowTipsNotification") + .value_or(Default::ShowTipsNotification); + Default::AdvanceTextOnDirectionalInput = + TryGetMemberBool("AdvanceTextOnDirectionalInput") + .value_or(Default::AdvanceTextOnDirectionalInput); + Default::DirectionalInputForTrigger = + TryGetMemberBool("DirectionalInputForTrigger") + .value_or(Default::DirectionalInputForTrigger); + Default::TriggerStopSkip = + TryGetMemberBool("TriggerStopSkip").value_or(Default::TriggerStopSkip); + + Default::TextSpeed = + TryGetMemberFloat("TextSpeed").value_or(Default::TextSpeed); + TextSpeedBounds = + TryGetMemberVec2("TextSpeedBounds").value_or(TextSpeedBounds); + Default::AutoSpeed = + TryGetMemberFloat("AutoSpeed").value_or(Default::AutoSpeed); + AutoSpeedBounds = + TryGetMemberVec2("AutoSpeedBounds").value_or(AutoSpeedBounds); + + Default::SkipRead = + TryGetMemberBool("SkipRead").value_or(Default::SkipRead); + Default::SyncVoice = + TryGetMemberBool("SyncVoice").value_or(Default::SyncVoice); + Default::SkipVoice = + TryGetMemberBool("SkipVoice").value_or(Default::SkipVoice); + + std::optional optionalVoiceCount = TryGetMemberUint("VoiceCount"); + if (optionalVoiceCount) { + Uint32 voiceCount = optionalVoiceCount.value(); + assert(voiceCount <= VoiceCount); + + GetMemberBoolArray(Default::VoiceMuted, voiceCount, "VoiceMuted"); + GetMemberFloatArray(Default::VoiceVolume, voiceCount, "VoiceVolume"); + } + + Pop(); + } + + ResetToDefault(); +} + +void ResetToDefault() { + ShowTipsNotification = Default::ShowTipsNotification; + AdvanceTextOnDirectionalInput = Default::AdvanceTextOnDirectionalInput; + DirectionalInputForTrigger = Default::DirectionalInputForTrigger; + TriggerStopSkip = Default::TriggerStopSkip; + + TextSpeed = Default::TextSpeed; + AutoSpeed = Default::AutoSpeed; + + SkipRead = Default::SkipRead; + SyncVoice = Default::SyncVoice; + SkipVoice = Default::SkipVoice; + + std::copy(std::begin(Default::VoiceMuted), std::end(Default::VoiceMuted), + VoiceMuted); + std::copy(std::begin(Default::VoiceVolume), std::end(Default::VoiceVolume), + VoiceVolume); + std::copy(std::begin(Default::GroupVolumes), std::end(Default::GroupVolumes), + Audio::GroupVolumes); +} + +} // namespace ConfigSystem +} // namespace Profile +} // namespace Impacto \ No newline at end of file diff --git a/src/configsystem.h b/src/profile/configsystem.h similarity index 55% rename from src/configsystem.h rename to src/profile/configsystem.h index 17b188191..119f2ddb7 100644 --- a/src/configsystem.h +++ b/src/profile/configsystem.h @@ -1,47 +1,72 @@ -#include +#pragma once + +#include "../audio/audiocommon.h" #include namespace Impacto { +namespace Profile { namespace ConfigSystem { -void Init(); +constexpr int VoiceCount = 33; -// Add new tips to the tips notification rendering queue +namespace Default { inline bool ShowTipsNotification = true; +inline bool AdvanceTextOnDirectionalInput = false; +inline bool DirectionalInputForTrigger = false; +inline bool TriggerStopSkip = true; + +inline float TextSpeed = 768.0f / 60.0f; +inline float AutoSpeed = 768.0f / 60.0f; + +inline bool SkipRead = true; +inline bool SyncVoice = true; +inline bool SkipVoice = false; + +inline bool VoiceMuted[VoiceCount]; +inline float VoiceVolume[VoiceCount]; +inline float GroupVolumes[Audio::ACG_Count]; +} // namespace Default + +// Add new tips to the tips notification rendering queue +inline bool ShowTipsNotification = Default::ShowTipsNotification; // Advance text on L/R stick, arrow keys, etc. -inline bool AdvanceTextOnDirectionalInput = false; +inline bool AdvanceTextOnDirectionalInput = + Default::AdvanceTextOnDirectionalInput; // Interact with trigger using left and right input in addition // to their regular counterparts -inline bool DirectionalInputForTrigger = false; +inline bool DirectionalInputForTrigger = Default::DirectionalInputForTrigger; // Stop skip mode when reaching a trigger // (e.g. delusion trigger, phone trigger, etc.) -inline bool TriggerStopSkip = true; +inline bool TriggerStopSkip = Default::TriggerStopSkip; // Typewriter animation speed -inline float TextSpeed = 768.0f / 60.0f; -constexpr inline glm::vec2 TextSpeedBounds = glm::vec2(256.0f, 4096.0f) / 60.0f; +inline float TextSpeed = Default::TextSpeed; +inline glm::vec2 TextSpeedBounds = glm::vec2(256.0f, 4096.0f) / 60.0f; // Speed to skip in auto mode (MessWaitSpeed) -inline float AutoSpeed = 768.0f / 60.0f; +inline float AutoSpeed = Default::AutoSpeed; // Menu is essentially auto *time* as opposed to auto *speed* -constexpr inline glm::vec2 AutoSpeedBounds = glm::vec2(2048.0f, 256.0f) / 60.0f; +inline glm::vec2 AutoSpeedBounds = glm::vec2(2048.0f, 256.0f) / 60.0f; // Only skip read text -inline bool SkipRead = true; +inline bool SkipRead = Default::SkipRead; // Sync text speed with voice line duration -inline bool SyncVoice = true; +inline bool SyncVoice = Default::SyncVoice; // Stop voice line after dialogue progression -inline bool SkipVoice = false; +inline bool SkipVoice = Default::SkipVoice; // Individual character mute/volume settings -constexpr int VoiceCount = 33; inline bool VoiceMuted[VoiceCount]; inline float VoiceVolume[VoiceCount]; +void Configure(); +void ResetToDefault(); + } // namespace ConfigSystem +} // namespace Profile } // namespace Impacto \ No newline at end of file diff --git a/src/text.cpp b/src/text.cpp index d41ced90b..30f53122b 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -4,7 +4,7 @@ #include "animation.h" #include "mem.h" #include "profile/scriptvars.h" -#include "configsystem.h" +#include "profile/configsystem.h" #include "profile/charset.h" #include "profile/dialogue.h" @@ -661,9 +661,9 @@ void DialoguePage::AddString(Vm::Sc3VmThread* ctx, Audio::AudioStream* voice, int typewriterCt = Glyphs.size() - typewriterStart; float typewriterDur = - (ConfigSystem::SyncVoice && voice != nullptr) + (Profile::ConfigSystem::SyncVoice && voice != nullptr) ? Audio::Channels[Audio::AC_VOICE0]->DurationInSeconds() - : (float)typewriterCt / ConfigSystem::TextSpeed; + : (float)typewriterCt / Profile::ConfigSystem::TextSpeed; Typewriter.Start(typewriterStart, typewriterCt, typewriterDur); } @@ -679,7 +679,8 @@ void DialoguePage::Update(float dt) { } if (TextIsFullyOpaque() && MesSkipMode & SkipModeFlags::Auto) - AutoWaitTime = std::max(0.0f, AutoWaitTime - ConfigSystem::AutoSpeed * dt); + AutoWaitTime = + std::max(0.0f, AutoWaitTime - Profile::ConfigSystem::AutoSpeed * dt); TextBox->Update(dt); FadeAnimation.Update(dt); diff --git a/src/ui/backlogmenu.cpp b/src/ui/backlogmenu.cpp index 2e82f4ecf..0396e9bca 100644 --- a/src/ui/backlogmenu.cpp +++ b/src/ui/backlogmenu.cpp @@ -9,6 +9,7 @@ #include "../profile/scriptvars.h" #include "../profile/scriptinput.h" #include "../profile/dialogue.h" +#include "../profile/configsystem.h" #include "../profile/ui/backlogmenu.h" #include "../profile/ui/systemmenu.h" #include "../profile/games/mo6tw/backlogmenu.h" @@ -16,7 +17,6 @@ #include "../profile/games/cclcc/systemmenu.h" #include "../inputsystem.h" #include "../io/vfs.h" -#include "../configsystem.h" namespace Impacto { namespace UI { @@ -30,9 +30,10 @@ using namespace Impacto::UI::Widgets; void BacklogMenu::MenuButtonOnClick(Widgets::BacklogEntry* target) { if (target->AudioId != -1) { - const float volume = ConfigSystem::VoiceMuted[target->CharacterId] - ? 0.0f - : ConfigSystem::VoiceVolume[target->CharacterId]; + const float volume = + Profile::ConfigSystem::VoiceMuted[target->CharacterId] + ? 0.0f + : Profile::ConfigSystem::VoiceVolume[target->CharacterId]; Audio::Channels[Audio::AC_REV]->Volume = volume; Audio::Channels[Audio::AC_REV]->Play("voice", target->AudioId, false, 0.0f); } diff --git a/src/ui/optionsmenu.h b/src/ui/optionsmenu.h index cbdaa43fb..7b8fdd319 100644 --- a/src/ui/optionsmenu.h +++ b/src/ui/optionsmenu.h @@ -2,6 +2,7 @@ #include "menu.h" #include "widgets/group.h" +#include "../profile/configsystem.h" namespace Impacto { namespace UI { @@ -12,7 +13,7 @@ class OptionsMenu : public Menu { virtual void Hide() override; virtual void Update(float dt) override; virtual void UpdateInput(float dt); - virtual void ResetToDefault() {}; + virtual void ResetToDefault() { Profile::ConfigSystem::ResetToDefault(); }; protected: OptionsMenu(); diff --git a/src/vm/inst_dialogue.cpp b/src/vm/inst_dialogue.cpp index 38ca1635b..5c40a713d 100644 --- a/src/vm/inst_dialogue.cpp +++ b/src/vm/inst_dialogue.cpp @@ -4,6 +4,7 @@ #include "expression.h" #include "../profile/scriptvars.h" +#include "../profile/configsystem.h" #include "../mem.h" #include "../log.h" #include "../audio/audiostream.h" @@ -16,7 +17,6 @@ #include "interface/input.h" #include "../text.h" #include "vm.h" -#include "../configsystem.h" namespace Impacto { @@ -187,7 +187,7 @@ VmInstruction(InstMesMain) { bool advanceButtonWentDown = Interface::PADinputButtonWentDown & Interface::PAD1A || Interface::PADinputMouseWentDown & Interface::PAD1A || - (ConfigSystem::AdvanceTextOnDirectionalInput && + (Profile::ConfigSystem::AdvanceTextOnDirectionalInput && Interface::PADinputButtonWentDown & (Interface::PAD1UP | Interface::PAD1DOWN | Interface::PAD1LEFT | Interface::PAD1RIGHT)); @@ -212,7 +212,7 @@ VmInstruction(InstMesMain) { ScrWork[2 * currentPage->Id + SW_LINEID]); SetFlag(SF_SHOWWAITICON + thread->DialoguePageId, false); - if (ConfigSystem::SkipVoice) + if (Profile::ConfigSystem::SkipVoice) Audio::Channels[Audio::AC_VOICE0]->Stop(0.0f); BlockThread; @@ -641,8 +641,9 @@ void ChkMesSkip() { // Turn off all skip modes (leaving auto) MesSkipMode &= SkipModeFlags::Auto; else - MesSkipMode |= (ConfigSystem::SkipRead ? SkipModeFlags::SkipRead - : SkipModeFlags::SkipAll); + MesSkipMode |= + (Profile::ConfigSystem::SkipRead ? SkipModeFlags::SkipRead + : SkipModeFlags::SkipAll); // Auto if (Interface::PADinputButtonWentDown & Interface::PADcustom[9]) diff --git a/src/vm/inst_misc.cpp b/src/vm/inst_misc.cpp index 0779e036e..d08bc99d8 100644 --- a/src/vm/inst_misc.cpp +++ b/src/vm/inst_misc.cpp @@ -5,13 +5,13 @@ #include "expression.h" #include "interface/input.h" #include "../profile/scriptvars.h" +#include "../profile/configsystem.h" #include "../game.h" #include "../mem.h" #include "../log.h" #include "../hud/saveicondisplay.h" #include "../ui/ui.h" #include "../data/savesystem.h" -#include "../configsystem.h" #include "../profile/vm.h" #include "../games/cclcc/systemmenu.h" @@ -575,7 +575,7 @@ VmInstruction(InstTitleMenuOld) { VmInstruction(InstSetPlayMode) { StartInstruction; PopExpression(arg1); - MesSkipMode = (arg1 == 4) ? (!ConfigSystem::SkipRead) + 1 : arg1; + MesSkipMode = (arg1 == 4) ? (!Profile::ConfigSystem::SkipRead) + 1 : arg1; } VmInstruction(InstSetEVflag) { StartInstruction; diff --git a/src/vm/interface/input.cpp b/src/vm/interface/input.cpp index 5fa02f19a..54d04f7aa 100644 --- a/src/vm/interface/input.cpp +++ b/src/vm/interface/input.cpp @@ -3,7 +3,7 @@ #include "../../impacto.h" #include "../../mem.h" #include "../../inputsystem.h" -#include "../../configsystem.h" +#include "../../profile/configsystem.h" #include "../../animation.h" #include "../../profile/vm.h" #include "../../profile/scriptinput.h" @@ -101,13 +101,13 @@ bool GetControlState(int controlId) { case CT_DelusionTriggerL: { return (PADinputButtonWentDown & PADcustom[36]) || (PADinputMouseWentDown & PADcustom[36]) || - (ConfigSystem::DirectionalInputForTrigger && + (Profile::ConfigSystem::DirectionalInputForTrigger && (PADinputButtonWentDown & PAD1LEFT)); } case CT_DelusionTriggerR: { return (PADinputButtonWentDown & PADcustom[37]) || (PADinputMouseWentDown & PADcustom[37]) || - (ConfigSystem::DirectionalInputForTrigger && + (Profile::ConfigSystem::DirectionalInputForTrigger && (PADinputButtonWentDown & PAD1RIGHT)); } default: