Skip to content

Commit

Permalink
Don't clear chat on setting structure limits.
Browse files Browse the repository at this point in the history
Fixes ticket:4276.
  • Loading branch information
Cyp committed Jun 25, 2016
1 parent 6744ea2 commit a10dc95
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
9 changes: 1 addition & 8 deletions src/frontend.cpp
Expand Up @@ -1799,14 +1799,7 @@ void changeTitleMode(tMode mode)
startConnectionScreen();
break;
case MULTIOPTION:
if (oldMode == MULTILIMIT)
{
startMultiOptions(true);
}
else
{
startMultiOptions(false);
}
startMultiOptions(oldMode == MULTILIMIT);
break;
case GAMEFIND:
startGameFind();
Expand Down
23 changes: 13 additions & 10 deletions src/multiint.cpp
Expand Up @@ -186,7 +186,7 @@ static void showPasswordForm(void);

// Game option functions
static void addGameOptions();
static void addChatBox(void);
static void addChatBox(bool preserveOldChat = false);
static void addConsoleBox(void);
static void disableMultiButs(void);
static void processMultiopWidgets(UDWORD);
Expand Down Expand Up @@ -2596,7 +2596,7 @@ void kickPlayer(uint32_t player_id, const char *reason, LOBBY_ERROR_TYPES type)
NETplayerKicked(player_id);
}

static void addChatBox(void)
static void addChatBox(bool preserveOldChat)
{
if (widgGetFromID(psWScreen, FRONTEND_TOPFORM))
{
Expand All @@ -2616,13 +2616,16 @@ static void addChatBox(void)

addSideText(FRONTEND_SIDETEXT4, MULTIOP_CHATBOXX - 3, MULTIOP_CHATBOXY, _("CHAT"));

flushConsoleMessages(); // add the chatbox.
initConsoleMessages();
if (!preserveOldChat)
{
flushConsoleMessages(); // add the chatbox.
initConsoleMessages();
setConsoleBackdropStatus(false);
setConsoleSizePos(MULTIOP_CHATBOXX + 4 + D_W, MULTIOP_CHATBOXY + 14 + D_H, MULTIOP_CHATBOXW - 4);
setConsolePermanence(true, true);
setConsoleLineInfo(5); // use x lines on chat window
}
enableConsoleDisplay(true);
setConsoleBackdropStatus(false);
setConsoleSizePos(MULTIOP_CHATBOXX + 4 + D_W, MULTIOP_CHATBOXY + 14 + D_H, MULTIOP_CHATBOXW - 4);
setConsolePermanence(true, true);
setConsoleLineInfo(5); // use x lines on chat window

W_EDBINIT sEdInit; // add the edit box
sEdInit.formID = MULTIOP_CHATBOX;
Expand Down Expand Up @@ -3867,7 +3870,7 @@ bool startMultiOptions(bool bReenter)
{
addPlayerBox(false); // Players
addGameOptions();
addChatBox();
addChatBox(bReenter);

if (ingame.bHostSetup)
{
Expand Down Expand Up @@ -3903,7 +3906,7 @@ bool startMultiOptions(bool bReenter)
{
ssprintf(buf, _("Hit the ready box to begin your challenge!"));
}
else
else if (!bHosted)
{
ssprintf(buf, _("Press the start hosting button to begin hosting a game."));
}
Expand Down

0 comments on commit a10dc95

Please sign in to comment.