Skip to content

Commit

Permalink
Fix spectators showing when they shouldn't, tweak lang
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Jan 21, 2023
1 parent 77a488b commit 4502294
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.Text;
import xyz.nucleoid.plasmid.game.GameSpace;
import xyz.nucleoid.plasmid.game.portal.GamePortalBackend;
import xyz.nucleoid.plasmid.game.portal.game.ConcurrentGamePortalBackend;

public record GameMenuEntry(
Expand All @@ -25,6 +26,11 @@ public int getPlayerCount() {
return this.game.getPlayerCount();
}

@Override
public GamePortalBackend.ActionType getActionType() {
return this.game.getActionType();
}

@Override
public void provideGameSpaces(Consumer<GameSpace> consumer) {
game.provideGameSpaces(consumer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ default int getPlayerCount() {
return -1;
}

default int getSpectatorCount() {
return -1;
}

default GamePortalBackend.ActionType getActionType() {
return GamePortalBackend.ActionType.NONE;
}
Expand All @@ -50,7 +54,7 @@ default GuiElement createGuiElement() {
}

var playerCount = this.getPlayerCount();
var spectatorCount = this.getPlayerCount();
var spectatorCount = this.getSpectatorCount();
boolean allowSpace = true;

if (playerCount > -1) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/data/plasmid/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@
"text.plasmid.ui.game_join.title": "Join a Game",
"text.plasmid.ui.game_join.players": "Currently playing: %s",
"text.plasmid.ui.game_join.spectators": "Currently spectating: %s",
"text.plasmid.ui.game_join.action.play": "Click to play",
"text.plasmid.ui.game_join.action.spectate": "Click to spectate",
"text.plasmid.ui.game_join.action.play": "Click to play!",
"text.plasmid.ui.game_join.action.spectate": "Click to spectate!",
"statistic.plasmid.games_played": "Games played",
"statistic.plasmid.games_won": "Games won",
"statistic.plasmid.games_lost": "Games lost",
Expand Down

0 comments on commit 4502294

Please sign in to comment.