From a19d7eea95720973f010a0843320c0b6d7c648d3 Mon Sep 17 00:00:00 2001 From: somewhatlurker <52014015+somewhatlurker@users.noreply.github.com> Date: Wed, 28 Aug 2019 01:02:57 +1000 Subject: [PATCH] add act_toggle config to playerdata --- source-code/data/plugins/playerdata.ini | 3 +++ source-code/source/plugins/Launcher/framework.h | 1 + .../source/plugins/TLAC/Components/CustomPlayerData.h | 1 + .../source/plugins/TLAC/Components/PlayerDataManager.cpp | 8 ++++---- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/source-code/data/plugins/playerdata.ini b/source-code/data/plugins/playerdata.ini index 41bb174..53a22b1 100644 --- a/source-code/data/plugins/playerdata.ini +++ b/source-code/data/plugins/playerdata.ini @@ -20,6 +20,9 @@ slide_se_equip = -1 # IDs defined in rom/gm_chainslide_se_tbl.farc/gm_chainslide_se_id.bin chainslide_se_equip = -1 +# Enable button/slider sounds +act_toggle = true + # Show clear borders on Progress Bar for: # Great border_great = true diff --git a/source-code/source/plugins/Launcher/framework.h b/source-code/source/plugins/Launcher/framework.h index d5dfad4..d166c1f 100644 --- a/source-code/source/plugins/Launcher/framework.h +++ b/source-code/source/plugins/Launcher/framework.h @@ -184,6 +184,7 @@ ConfigOptionBase* playerdataArray[] = { new NumericOption(L"btn_se_equip", PLAYERDATA_SECTION, PLAYERDATA_FILE, L"Button Sound:", L"Sets the sound effect for buttons.\n-1 = song default", -1, -1, INT_MAX), new NumericOption(L"slide_se_equip", PLAYERDATA_SECTION, PLAYERDATA_FILE, L"Slide Sound:", L"Sets the sound effect for slides.\n-1 = song default", -1, -1, INT_MAX), new NumericOption(L"chainslide_se_equip", PLAYERDATA_SECTION, PLAYERDATA_FILE, L"Chainslide Sound:", L"Sets the sound effect for chain slides.\n-1 = song default", -1, -1, INT_MAX), + new BooleanOption(L"act_toggle", PLAYERDATA_SECTION, PLAYERDATA_FILE, L"Button SE", L"Enables button/slider sounds.", true, true), new BooleanOption(L"border_great", PLAYERDATA_SECTION, PLAYERDATA_FILE, L"Clear Border (Great)", L"Shows the clear border for a great rating on the progress bar.", true, true), new BooleanOption(L"border_excellent", PLAYERDATA_SECTION, PLAYERDATA_FILE, L"Clear Border (Excellent)", L"Shows the clear border for an excellent rating on the progress bar.", true, true), diff --git a/source-code/source/plugins/TLAC/Components/CustomPlayerData.h b/source-code/source/plugins/TLAC/Components/CustomPlayerData.h index c8a156e..cd5efbf 100644 --- a/source-code/source/plugins/TLAC/Components/CustomPlayerData.h +++ b/source-code/source/plugins/TLAC/Components/CustomPlayerData.h @@ -16,5 +16,6 @@ namespace TLAC::Components bool ShowExcellentClearBorder; bool UseCard; bool GameModifierOptions; + bool ActionSE; }; } diff --git a/source-code/source/plugins/TLAC/Components/PlayerDataManager.cpp b/source-code/source/plugins/TLAC/Components/PlayerDataManager.cpp index 5154382..0ed96e8 100644 --- a/source-code/source/plugins/TLAC/Components/PlayerDataManager.cpp +++ b/source-code/source/plugins/TLAC/Components/PlayerDataManager.cpp @@ -237,6 +237,7 @@ namespace TLAC::Components customPlayerData->ShowGreatClearBorder = config.GetBooleanValue("border_great"); customPlayerData->UseCard = config.GetBooleanValue("use_card"); customPlayerData->GameModifierOptions = config.GetBooleanValue("gamemode_options"); + customPlayerData->ActionSE = config.GetBooleanValue("act_toggle"); moduleCardWorkaround = config.GetBooleanValue("module_card_workaround"); if (moduleCardWorkaround) { @@ -313,15 +314,14 @@ namespace TLAC::Components setIfNotEqual(&playerData->btn_se_equip, customPlayerData->BtnSeEquip, -1); setIfNotEqual(&playerData->slide_se_equip, customPlayerData->SlideSeEquip, -1); setIfNotEqual(&playerData->chainslide_se_equip, customPlayerData->ChainslideSeEquip, -1); + setIfNotEqual(&playerData->act_toggle, customPlayerData->ActionSE, 1); // Display clear borders on the progress bar *(byte*)(PLAYER_DATA_ADDRESS + 0xD94) = (customPlayerData->ShowExcellentClearBorder << 1) | (customPlayerData->ShowGreatClearBorder); - if (customPlayerData->UseCard) - playerData->use_card = 1; // required to allow for module selection + playerData->use_card = customPlayerData->UseCard; // required to allow for module selection - if (customPlayerData->GameModifierOptions) - playerData->game_opts = 1; // hi-speed, etc.. + playerData->game_opts = customPlayerData->GameModifierOptions; // hi-speed, etc.. memset((void*)MODULE_TABLE_START, 0xFF, 128); memset((void*)ITEM_TABLE_START, 0xFF, 128);