mirror of
https://github.com/CraftyBoss/SuperMarioOdysseyOnline.git
synced 2025-01-03 06:01:23 +00:00
Toggle H&S Gravity
with real toggle functionality
This commit is contained in:
parent
366ad5e888
commit
c736878df1
3 changed files with 28 additions and 25 deletions
|
@ -15,5 +15,7 @@ public:
|
|||
const int getMenuSize() override { return mItemCount; }
|
||||
|
||||
private:
|
||||
static constexpr int mItemCount = 2;
|
||||
static constexpr int mItemCount = 1;
|
||||
sead::SafeArray<sead::WFixedSafeString<0x200>, mItemCount>* gravityOn = nullptr;
|
||||
sead::SafeArray<sead::WFixedSafeString<0x200>, mItemCount>* gravityOff = nullptr;
|
||||
};
|
|
@ -5,20 +5,27 @@
|
|||
#include "server/hns/HideAndSeekMode.hpp"
|
||||
#include "server/Client.hpp"
|
||||
|
||||
HideAndSeekConfigMenu::HideAndSeekConfigMenu() : GameModeConfigMenu() {}
|
||||
HideAndSeekConfigMenu::HideAndSeekConfigMenu() : GameModeConfigMenu() {
|
||||
gravityOn = new sead::SafeArray<sead::WFixedSafeString<0x200>, mItemCount>();
|
||||
gravityOn->mBuffer[0].copy(u"Toggle H&S Gravity (ON)");
|
||||
|
||||
gravityOff = new sead::SafeArray<sead::WFixedSafeString<0x200>, mItemCount>();
|
||||
gravityOff->mBuffer[0].copy(u"Toggle H&S Gravity (OFF)");
|
||||
}
|
||||
|
||||
void HideAndSeekConfigMenu::initMenu(const al::LayoutInitInfo &initInfo) {
|
||||
|
||||
}
|
||||
|
||||
const sead::WFixedSafeString<0x200>* HideAndSeekConfigMenu::getStringData() {
|
||||
sead::SafeArray<sead::WFixedSafeString<0x200>, mItemCount>* gamemodeConfigOptions =
|
||||
new sead::SafeArray<sead::WFixedSafeString<0x200>, mItemCount>();
|
||||
|
||||
gamemodeConfigOptions->mBuffer[0].copy(u"Toggle H&S Gravity On");
|
||||
gamemodeConfigOptions->mBuffer[1].copy(u"Toggle H&S Gravity Off");
|
||||
|
||||
return gamemodeConfigOptions->mBuffer;
|
||||
HideAndSeekInfo *curMode = GameModeManager::instance()->getInfo<HideAndSeekInfo>();
|
||||
return (
|
||||
GameModeManager::instance()->isMode(GameMode::HIDEANDSEEK)
|
||||
&& curMode != nullptr
|
||||
&& curMode->mIsUseGravity
|
||||
? gravityOn->mBuffer
|
||||
: gravityOff->mBuffer
|
||||
);
|
||||
}
|
||||
|
||||
bool HideAndSeekConfigMenu::updateMenu(int selectIndex) {
|
||||
|
@ -35,13 +42,7 @@ bool HideAndSeekConfigMenu::updateMenu(int selectIndex) {
|
|||
switch (selectIndex) {
|
||||
case 0: {
|
||||
if (GameModeManager::instance()->isMode(GameMode::HIDEANDSEEK)) {
|
||||
curMode->mIsUseGravity = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case 1: {
|
||||
if (GameModeManager::instance()->isMode(GameMode::HIDEANDSEEK)) {
|
||||
curMode->mIsUseGravity = false;
|
||||
curMode->mIsUseGravity = !curMode->mIsUseGravity;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -100,11 +100,6 @@ StageSceneStateServerConfig::StageSceneStateServerConfig(const char *name, al::S
|
|||
entry.mList = new CommonVerticalList(entry.mLayout, initInfo, true);
|
||||
|
||||
al::setPaneString(entry.mLayout, "TxtOption", u"Gamemode Configuration", 0);
|
||||
|
||||
entry.mList->initDataNoResetSelected(entry.mMenu->getMenuSize());
|
||||
|
||||
|
||||
entry.mList->addStringData(entry.mMenu->getStringData(), "TxtContent");
|
||||
}
|
||||
|
||||
|
||||
|
@ -231,8 +226,13 @@ void StageSceneStateServerConfig::exeOpenKeyboardPort() {
|
|||
void StageSceneStateServerConfig::exeGamemodeConfig() {
|
||||
if (al::isFirstStep(this)) {
|
||||
mGamemodeConfigMenu = &mGamemodeConfigMenus[GameModeManager::instance()->getGameMode()];
|
||||
|
||||
mGamemodeConfigMenu->mList->initDataNoResetSelected(mGamemodeConfigMenu->mMenu->getMenuSize());
|
||||
mGamemodeConfigMenu->mList->addStringData(mGamemodeConfigMenu->mMenu->getStringData(), "TxtContent");
|
||||
|
||||
mCurrentList = mGamemodeConfigMenu->mList;
|
||||
mCurrentMenu = mGamemodeConfigMenu->mLayout;
|
||||
|
||||
subMenuStart();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue