@@ -84,37 +84,63 @@ void HideAndSeekIcon::exeWait() {
8484
8585 int playerCount = Client::getMaxPlayerCount ();
8686
87- if (playerCount > 0 ) {
88- char playerNameBuf[0x200 ] = {0 };
89- sead::BufferedSafeStringBase<char > playerList =
90- sead::BufferedSafeStringBase<char >(playerNameBuf, sizeof (playerNameBuf));
91-
92- playerList.appendWithFormat (" %s %s\n " , mInfo ->mIsPlayerIt ? " &" : " %%" , Client::instance ()->getClientName ());
87+ if (playerCount > 0 ) {
88+ char playerNameBuf[0x200 ] = {0 };
89+ sead::BufferedSafeStringBase<char > playerList =
90+ sead::BufferedSafeStringBase<char >(playerNameBuf, sizeof (playerNameBuf));
91+
92+ // Add current player first
93+ playerList.appendWithFormat (" %s %s\n " , mInfo ->mIsPlayerIt ? " &" : " %%" , Client::instance ()->getClientName ());
94+
95+ // IT players (seekers) then hiders
96+ for (int i = 0 ; i <= 1 ; i++) {
97+ bool isIt = i == 0 ;
98+ // Add players to the list that are in the same game mode
99+ for (int j = 0 ; j < playerCount; j++) {
100+ PuppetInfo* curPuppet = Client::getPuppetInfo (j);
101+ if (!curPuppet || !curPuppet->isConnected )
102+ continue ;
103+
104+ if (curPuppet->gameMode != curGamemodeID)
105+ continue ;
106+
107+ if (curPuppet->isIt != isIt)
108+ continue ;
109+
110+ playerList.appendWithFormat (" %s %s\n " , curPuppet->isIt ? " &" : " %%" , curPuppet->puppetName );
111+ }
112+ }
93113
94- for (int i = 0 ; i < playerCount; i++) {
95- PuppetInfo* curPuppet = Client::getPuppetInfo (i);
96- if (!curPuppet || !curPuppet->isConnected )
97- continue ;
114+ // Add some spacing before non-mode players
115+ bool hasNonModePlayers = false ;
116+ for (int i = 0 ; i < playerCount; i++) {
117+ PuppetInfo* curPuppet = Client::getPuppetInfo (i);
118+ if (!curPuppet || !curPuppet->isConnected )
119+ continue ;
120+
121+ if (curPuppet->gameMode != curGamemodeID) {
122+ hasNonModePlayers = true ;
123+ break ;
124+ }
125+ }
98126
99- if (curPuppet-> gameMode == curGamemodeID ) {
100- playerList.appendWithFormat (" %s %s \n " , curPuppet-> isIt ? " & " : " %% " , curPuppet-> puppetName );
127+ if (hasNonModePlayers ) {
128+ playerList.appendWithFormat (" \n " ); // Add blank line for spacing
101129 }
102- }
103130
104- for (int i = 0 ; i < playerCount; i++) {
105- PuppetInfo* curPuppet = Client::getPuppetInfo (i);
106- if (!curPuppet || !curPuppet->isConnected )
107- continue ;
131+ // add players not in the mode
132+ for (int i = 0 ; i < playerCount; i++) {
133+ PuppetInfo* curPuppet = Client::getPuppetInfo (i);
134+ if (!curPuppet || !curPuppet->isConnected )
135+ continue ;
108136
109- if (curPuppet->gameMode != curGamemodeID) {
110- playerList.appendWithFormat (" %s\n " , curPuppet->puppetName ); // no icon, indented
137+ if (curPuppet->gameMode != curGamemodeID) {
138+ playerList.appendWithFormat (" %s\n " , curPuppet->puppetName ); // no icon, indented
139+ }
111140 }
112- }
113141
114- al::setPaneStringFormat (this , " TxtPlayerList" , playerList.cstr ());
115- }
116-
117-
142+ al::setPaneStringFormat (this , " TxtPlayerList" , playerList.cstr ());
143+ }
118144}
119145
120146void HideAndSeekIcon::exeEnd () {
0 commit comments