[Client] Always set visibility of GUIChat, not its main widget

Don't change the windowState when GUIChat is closed.
0.8.0
David Cernat 3 years ago
parent ae2d247968
commit fb4fe75e62

@ -40,7 +40,7 @@ namespace mwmp
mHistory->setNeedKeyFocus(false); mHistory->setNeedKeyFocus(false);
windowState = CHAT_DISABLED; windowState = CHAT_DISABLED;
mCommandLine->setVisible(0); mCommandLine->setVisible(false);
delay = 3; // 3 sec. delay = 3; // 3 sec.
} }
@ -48,7 +48,7 @@ namespace mwmp
{ {
// Give keyboard focus to the combo box whenever the console is // Give keyboard focus to the combo box whenever the console is
// turned on // turned on
setEditState(0); setEditState(false);
if (windowState == CHAT_DISABLED) if (windowState == CHAT_DISABLED)
windowState = CHAT_ENABLED; windowState = CHAT_ENABLED;
@ -56,10 +56,7 @@ namespace mwmp
void GUIChat::onClose() void GUIChat::onClose()
{ {
// Apparently, hidden widgets can retain key focus setEditState(false);
// Remove for MyGUI 3.2.2
windowState = CHAT_DISABLED;
setEditState(0);
} }
bool GUIChat::exit() bool GUIChat::exit()
@ -82,7 +79,7 @@ namespace mwmp
if (cm.empty()) if (cm.empty())
{ {
mCommandLine->setCaption(""); mCommandLine->setCaption("");
setEditState(0); setEditState(false);
return; return;
} }
@ -99,7 +96,7 @@ namespace mwmp
// It prevents the re-triggering of the acceptCommand() event for the same command // It prevents the re-triggering of the acceptCommand() event for the same command
// during the actual command execution // during the actual command execution
mCommandLine->setCaption(""); mCommandLine->setCaption("");
setEditState(0); setEditState(false);
send (cm); send (cm);
} }
@ -175,14 +172,14 @@ namespace mwmp
switch (windowState) switch (windowState)
{ {
case CHAT_DISABLED: case CHAT_DISABLED:
this->mMainWidget->setVisible(false); setVisible(false);
setEditState(0); setEditState(false);
break; break;
case CHAT_ENABLED: case CHAT_ENABLED:
this->mMainWidget->setVisible(true); setVisible(true);
break; break;
default: //CHAT_HIDDENMODE default: //CHAT_HIDDENMODE
this->mMainWidget->setVisible(true); setVisible(true);
curTime = 0; curTime = 0;
} }
} }
@ -252,7 +249,7 @@ namespace mwmp
if (curTime >= delay) if (curTime >= delay)
{ {
setEditState(false); setEditState(false);
this->mMainWidget->setVisible(false); setVisible(false);
} }
} }
} }

Loading…
Cancel
Save