Skip to content

Commit

Permalink
Merge branches 'pr-debug-menu', 'pr-main-mod-menu', 'pr-new-players-l…
Browse files Browse the repository at this point in the history
…ist', 'pr-costume-doors' and 'pr-ban-info' into wip
  • Loading branch information
Istador committed Oct 12, 2024
5 parents 8797d58 + e15e8f6 + d600412 + 6e2478c + 9130b2d commit 6cd553e
Show file tree
Hide file tree
Showing 32 changed files with 45 additions and 19 deletions.
11 changes: 9 additions & 2 deletions patches/codehook.slpatch
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,14 @@ B59E28 B seadPrintHook // sead::system::print

// Pause Menu Changes

4EAEC4 B overrideNerveHook // makes any button on pause menu run a specific nerve
// 4EAEC4 B overrideNerveHook // makes any button on pause menu run a specific nerve
4EA104 MOV W2, #5 // update state count to account for new custom state
4EA1F0 BL initNerveStateHook // inits options nerve state and server config state
4EA174 MOV X0, X20 // moves StageSceneStatePauseMenu to first arg
4EA17C NOP // prevents first new of StageSceneStateOption
4EA1A8 BL initStateHook // inits StageSceneStateOption and StageSceneStateServerConfig
4EA1C0 NOP // prevents mStateOption ptr from being overriden
4EAFA4 B overrideHelpFadeNerve

// Gravity hooks

Expand All @@ -124,4 +125,10 @@ B59E28 B seadPrintHook // sead::system::print
8912B8 B drawTableHook

// 891394 BL drawInitHook
// 91328 BL updateInitHook
// 91328 BL updateInitHook

// Unlocks costume doors
262850 MOV W0, #0 // Sand, DeepWoods, Snow, Seaside, Luncheon, Bowser, Mushroom
2609B4 MOV W0, #0 // Lake
25FF74 MOV X0, #1 // Metro (open w/ doors)
25FFAC MOV X0, #0 // Metro (open w/o doors) (not needed?)
Binary file modified romfs/LayoutData/HideAndSeekIcon.szs
Binary file not shown.
Binary file added romfs/LocalizedData/CNzh/LayoutData/FontData.szs
Binary file not shown.
Binary file not shown.
Binary file added romfs/LocalizedData/EUde/LayoutData/FontData.szs
Binary file not shown.
Binary file not shown.
Binary file added romfs/LocalizedData/EUen/LayoutData/FontData.szs
Binary file not shown.
Binary file not shown.
Binary file added romfs/LocalizedData/EUes/LayoutData/FontData.szs
Binary file not shown.
Binary file not shown.
Binary file added romfs/LocalizedData/EUfr/LayoutData/FontData.szs
Binary file not shown.
Binary file not shown.
Binary file added romfs/LocalizedData/EUit/LayoutData/FontData.szs
Binary file not shown.
Binary file not shown.
Binary file added romfs/LocalizedData/EUnl/LayoutData/FontData.szs
Binary file not shown.
Binary file not shown.
Binary file added romfs/LocalizedData/EUru/LayoutData/FontData.szs
Binary file not shown.
Binary file not shown.
Binary file added romfs/LocalizedData/JPja/LayoutData/FontData.szs
Binary file not shown.
Binary file not shown.
Binary file added romfs/LocalizedData/TWzh/LayoutData/FontData.szs
Binary file not shown.
Binary file not shown.
Binary file added romfs/LocalizedData/USen/LayoutData/FontData.szs
Binary file not shown.
Binary file not shown.
Binary file added romfs/LocalizedData/USes/LayoutData/FontData.szs
Binary file not shown.
Binary file not shown.
Binary file added romfs/LocalizedData/USfr/LayoutData/FontData.szs
Binary file not shown.
Binary file not shown.
11 changes: 4 additions & 7 deletions source/hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,10 @@ bool registerShineToList(Shine* shineActor) {
return al::isAlive(shineActor);
}

void overrideNerveHook(StageSceneStatePauseMenu* thisPtr, al::Nerve* nrvSet) {

if (al::isPadHoldZL(-1)) {
al::setNerve(thisPtr, &nrvStageSceneStatePauseMenuServerConfig);
} else {
al::setNerve(thisPtr, nrvSet);
}
void overrideHelpFadeNerve(StageSceneStatePauseMenu* thisPtr) {
// Set label in menu inside LocalizedData/${lang}/MessageData/LayoutMessage.szs/Menu.msbt/Menu_Help
thisPtr->exeServerConfig();
al::setNerve(thisPtr, &nrvStageSceneStatePauseMenuServerConfig);
}

StageSceneStateServerConfig *sceneStateServerConfig = nullptr;
Expand Down
25 changes: 18 additions & 7 deletions source/layouts/HideAndSeekIcon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,27 @@ void HideAndSeekIcon::exeWait() {

char playerNameBuf[0x100] = {0}; // max of 16 player names if player name size is 0x10

sead::BufferedSafeStringBase<char> playerList =
sead::BufferedSafeStringBase<char>(playerNameBuf, 0x200);

for (size_t i = 0; i < playerCount; i++) {
sead::BufferedSafeStringBase<char> playerList = sead::BufferedSafeStringBase<char>(playerNameBuf, 0x200);

// Add your own name to the list at the top
playerList.appendWithFormat("%s %s\n", mInfo->mIsPlayerIt ? "\uE002" : "\uE001", Client::instance()->getClientName());

// Add all seekers to the list
for (int i = 0; i < playerCount; i++) {
PuppetInfo* curPuppet = Client::getPuppetInfo(i);
if (curPuppet && curPuppet->isConnected && curPuppet->isIt) {
playerList.appendWithFormat("\uE002 %s\n", curPuppet->puppetName);
}
}

// Add all hiders to the list
for (int i = 0; i < playerCount; i++) {
PuppetInfo* curPuppet = Client::getPuppetInfo(i);
if (curPuppet && curPuppet->isConnected && (curPuppet->isIt == mInfo->mIsPlayerIt)) {
playerList.appendWithFormat("%s\n", curPuppet->puppetName);
if (curPuppet && curPuppet->isConnected && !curPuppet->isIt) {
playerList.appendWithFormat("\uE001 %s\n", curPuppet->puppetName);
}
}

al::setPaneStringFormat(this, "TxtPlayerList", playerList.cstr());
}

Expand Down
15 changes: 13 additions & 2 deletions source/server/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ void Client::init(al::LayoutInitInfo const& initInfo, GameDataHolderAccessor hol
al::setPaneString(mConnectStatus, "TxtSaveSh", u"Connecting to Server.", 0);

mUIMessage = new (mHeap) al::WindowConfirmWait("ServerWaitConnect", "WindowConfirmWait", initInfo);
mUIMessage->setTxtMessage(u"a");
mUIMessage->setTxtMessageConfirm(u"b");
mUIMessage->setTxtMessage(u"You've been kicked from the server.");
mUIMessage->setTxtMessageConfirm(u"You've been banned from the server!");

mHolder = holder;

Expand Down Expand Up @@ -924,6 +924,17 @@ void Client::updateTagInfo(TagInf* packet) {
*/
void Client::sendToStage(ChangeStagePacket* packet) {
if (mSceneInfo && mSceneInfo->mSceneObjHolder) {
if (!sInstance->mUIMessage->mIsAlive) {
if (strcmp(packet->changeStage, "$agogusStage") == 0) { // kicked
sInstance->mUIMessage->appear();
nn::os::SleepThread(nn::TimeSpan::FromNanoSeconds(1500000000)); // wait 1.5s
} else if (strcmp(packet->changeStage, "$ejected") == 0) { // banned
sInstance->mUIMessage->appear();
al::startAction(sInstance->mUIMessage, "Confirm", "State");
nn::os::SleepThread(nn::TimeSpan::FromNanoSeconds(1500000000)); // wait 1.5s
}
}

GameDataHolderAccessor accessor(mSceneInfo->mSceneObjHolder);

Logger::log("Sending Player to %s at Entrance %s in Scenario %d\n", packet->changeStage, packet->changeID, packet->scenarioNo);
Expand Down
2 changes: 1 addition & 1 deletion source/states/StageSceneStateServerConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ StageSceneStateServerConfig::StageSceneStateServerConfig(
mMainOptions = new SimpleLayoutMenu("ServerConfigMenu", "OptionSelect", initInfo, 0, false);
mMainOptionsList = new CommonVerticalList(mMainOptions, initInfo, true);

al::setPaneString(mMainOptions, "TxtOption", u"Server Configuration", 0);
al::setPaneString(mMainOptions, "TxtOption", u"SMOO Mod Menu", 0);

mMainOptionsList->unkInt1 = 1;

Expand Down

0 comments on commit 6cd553e

Please sign in to comment.