mirror of
https://github.com/CraftyBoss/SuperMarioOdysseyOnline.git
synced 2025-01-05 07:01:15 +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
|
@ -9,11 +9,13 @@ public:
|
||||||
HideAndSeekConfigMenu();
|
HideAndSeekConfigMenu();
|
||||||
|
|
||||||
void initMenu(const al::LayoutInitInfo &initInfo) override;
|
void initMenu(const al::LayoutInitInfo &initInfo) override;
|
||||||
const sead::WFixedSafeString<0x200> *getStringData() override;
|
const sead::WFixedSafeString<0x200>* getStringData() override;
|
||||||
bool updateMenu(int selectIndex) override;
|
bool updateMenu(int selectIndex) override;
|
||||||
|
|
||||||
const int getMenuSize() override { return mItemCount; }
|
const int getMenuSize() override { return mItemCount; }
|
||||||
|
|
||||||
private:
|
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/hns/HideAndSeekMode.hpp"
|
||||||
#include "server/Client.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) {
|
void HideAndSeekConfigMenu::initMenu(const al::LayoutInitInfo &initInfo) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const sead::WFixedSafeString<0x200> *HideAndSeekConfigMenu::getStringData() {
|
const sead::WFixedSafeString<0x200>* HideAndSeekConfigMenu::getStringData() {
|
||||||
sead::SafeArray<sead::WFixedSafeString<0x200>, mItemCount>* gamemodeConfigOptions =
|
HideAndSeekInfo *curMode = GameModeManager::instance()->getInfo<HideAndSeekInfo>();
|
||||||
new sead::SafeArray<sead::WFixedSafeString<0x200>, mItemCount>();
|
return (
|
||||||
|
GameModeManager::instance()->isMode(GameMode::HIDEANDSEEK)
|
||||||
gamemodeConfigOptions->mBuffer[0].copy(u"Toggle H&S Gravity On");
|
&& curMode != nullptr
|
||||||
gamemodeConfigOptions->mBuffer[1].copy(u"Toggle H&S Gravity Off");
|
&& curMode->mIsUseGravity
|
||||||
|
? gravityOn->mBuffer
|
||||||
return gamemodeConfigOptions->mBuffer;
|
: gravityOff->mBuffer
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HideAndSeekConfigMenu::updateMenu(int selectIndex) {
|
bool HideAndSeekConfigMenu::updateMenu(int selectIndex) {
|
||||||
|
@ -35,13 +42,7 @@ bool HideAndSeekConfigMenu::updateMenu(int selectIndex) {
|
||||||
switch (selectIndex) {
|
switch (selectIndex) {
|
||||||
case 0: {
|
case 0: {
|
||||||
if (GameModeManager::instance()->isMode(GameMode::HIDEANDSEEK)) {
|
if (GameModeManager::instance()->isMode(GameMode::HIDEANDSEEK)) {
|
||||||
curMode->mIsUseGravity = true;
|
curMode->mIsUseGravity = !curMode->mIsUseGravity;
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
case 1: {
|
|
||||||
if (GameModeManager::instance()->isMode(GameMode::HIDEANDSEEK)) {
|
|
||||||
curMode->mIsUseGravity = false;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,11 +100,6 @@ StageSceneStateServerConfig::StageSceneStateServerConfig(const char *name, al::S
|
||||||
entry.mList = new CommonVerticalList(entry.mLayout, initInfo, true);
|
entry.mList = new CommonVerticalList(entry.mLayout, initInfo, true);
|
||||||
|
|
||||||
al::setPaneString(entry.mLayout, "TxtOption", u"Gamemode Configuration", 0);
|
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() {
|
void StageSceneStateServerConfig::exeGamemodeConfig() {
|
||||||
if (al::isFirstStep(this)) {
|
if (al::isFirstStep(this)) {
|
||||||
mGamemodeConfigMenu = &mGamemodeConfigMenus[GameModeManager::instance()->getGameMode()];
|
mGamemodeConfigMenu = &mGamemodeConfigMenus[GameModeManager::instance()->getGameMode()];
|
||||||
|
|
||||||
|
mGamemodeConfigMenu->mList->initDataNoResetSelected(mGamemodeConfigMenu->mMenu->getMenuSize());
|
||||||
|
mGamemodeConfigMenu->mList->addStringData(mGamemodeConfigMenu->mMenu->getStringData(), "TxtContent");
|
||||||
|
|
||||||
mCurrentList = mGamemodeConfigMenu->mList;
|
mCurrentList = mGamemodeConfigMenu->mList;
|
||||||
mCurrentMenu = mGamemodeConfigMenu->mLayout;
|
mCurrentMenu = mGamemodeConfigMenu->mLayout;
|
||||||
|
|
||||||
subMenuStart();
|
subMenuStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue