Skip to content

Commit

Permalink
Sardines player list update
Browse files Browse the repository at this point in the history
  • Loading branch information
Amethyst-szs committed Nov 3, 2022
1 parent f8eef7f commit 2a0d0e7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
Binary file modified romfs/LayoutData/HideAndSeekIcon.szs
Binary file not shown.
Binary file modified romfs/LayoutData/SardineIcon.szs
Binary file not shown.
Binary file modified romfs/LocalizedData/USen/LayoutData/FontData.szs
Binary file not shown.
26 changes: 17 additions & 9 deletions source/layouts/SardineIcon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,28 @@ void SardineIcon::exeWait()

if (playerCount > 0) {

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

sead::BufferedSafeStringBase<char> playerList = sead::BufferedSafeStringBase<char>(playerNameBuf, 0x200);
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->mIsIt ? "@" : "©", Client::instance()->getClientName());

if (mInfo->mIsIt)
playerList.appendWithFormat("%s\n", Client::instance()->getClientName());

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

// Add not it players to list
for(int i = 0; i < playerCount; i++){
PuppetInfo* curPuppet = Client::getPuppetInfo(i);
if (curPuppet && curPuppet->isConnected && !curPuppet->isIt)
playerList.appendWithFormat("%s %s\n", curPuppet->isIt ? "@" : "©", curPuppet->puppetName);
}

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

0 comments on commit 2a0d0e7

Please sign in to comment.