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

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

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

Loading…
Cancel
Save