Skip to content

Commit

Permalink
StreamerMode
Browse files Browse the repository at this point in the history
  • Loading branch information
kphoenix137 committed Oct 7, 2023
1 parent 1616318 commit 4b92546
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/automap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ void DrawAutomapText(const Surface &out)
Point linePosition { 8, 8 };

if (gbIsMultiplayer) {
if (GameName != "0.0.0.0" && !IsLoopback) {
if (GameName != "0.0.0.0" && !IsLoopback && !StreamerMode) {
std::string description = std::string(_("Game: "));
description.append(GameName);
DrawString(out, description, linePosition);
Expand All @@ -741,7 +741,7 @@ void DrawAutomapText(const Surface &out)
std::string description;
if (IsLoopback) {
description = std::string(_("Offline Game"));
} else if (!PublicGame) {
} else if (!PublicGame && !StreamerMode) {
description = std::string(_("Password: "));
description.append(GamePassword);
} else {
Expand Down
10 changes: 10 additions & 0 deletions Source/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,12 +520,22 @@ std::string TextCmdLevelSeed(const string_view parameter)
"Storybook: ", glSeedTbl[16]);
}

std::string TextCmdStreamerMode(const std::string_view parameter)
{
std::string ret;

StreamerMode = !StreamerMode;
StrAppend(ret, _("Toggling Streamer Mode."));
return ret;
}

std::vector<TextCmdItem> TextCmdList = {
{ N_("/help"), N_("Prints help overview or help for a specific command."), N_("[command]"), &TextCmdHelp },
{ N_("/arena"), N_("Enter a PvP Arena."), N_("<arena-number>"), &TextCmdArena },
{ N_("/arenapot"), N_("Gives Arena Potions."), N_("<number>"), &TextCmdArenaPot },
{ N_("/inspect"), N_("Inspects stats and equipment of another player."), N_("<player name>"), &TextCmdInspect },
{ N_("/seedinfo"), N_("Show seed infos for current level."), "", &TextCmdLevelSeed },
{ N_("/streamermode"), N_("Hides game name and password for streamers."), "", &TextCmdStreamerMode },
};

bool CheckTextCommand(const string_view text)
Expand Down
2 changes: 2 additions & 0 deletions Source/multi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ bool sgbTimeout;
std::string GameName;
std::string GamePassword;
bool PublicGame;
bool StreamerMode;
uint8_t gbDeltaSender;
bool sgbNetInited;
uint32_t player_state[MAX_PLRS];
Expand Down Expand Up @@ -790,6 +791,7 @@ bool NetInit(bool bSinglePlayer)
glSeedTbl[i] = AdvanceRndSeed();
}
PublicGame = DvlNet_IsPublicGame();
StreamerMode = false;

Player &myPlayer = *MyPlayer;
// separator for marking messages from a different game
Expand Down

0 comments on commit 4b92546

Please sign in to comment.