diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-10-17 22:05:53 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-10-19 15:12:17 +0300 |
commit | 94273f426318994df784cf85c0c18a817f913a8d (patch) | |
tree | d374772666277200afff6d28471cef3c0b7fe999 /src | |
parent | fe189677b7596b3d0dbd7a2943fda37a3e5cd6a8 (diff) | |
download | manaverse-94273f426318994df784cf85c0c18a817f913a8d.tar.gz manaverse-94273f426318994df784cf85c0c18a817f913a8d.tar.bz2 manaverse-94273f426318994df784cf85c0c18a817f913a8d.tar.xz manaverse-94273f426318994df784cf85c0c18a817f913a8d.zip |
use postInit in ChatWindow.
Diffstat (limited to 'src')
-rw-r--r-- | src/game.cpp | 2 | ||||
-rw-r--r-- | src/gui/popups/beingpopup.h | 2 | ||||
-rw-r--r-- | src/gui/windows/charselectdialog.h | 2 | ||||
-rw-r--r-- | src/gui/windows/chatwindow.cpp | 14 | ||||
-rw-r--r-- | src/gui/windows/chatwindow.h | 2 |
5 files changed, 14 insertions, 8 deletions
diff --git a/src/game.cpp b/src/game.cpp index 1e8d19398..415f71bec 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -207,7 +207,7 @@ static void createGuiWindows() // Create dialogs emoteWindow = new EmoteWindow; chatWindow = new ChatWindow; - chatWindow->updateVisibility(); + chatWindow->postInit(); tradeWindow = new TradeWindow; equipmentWindow = new EquipmentWindow(PlayerInfo::getEquipment(), player_node); diff --git a/src/gui/popups/beingpopup.h b/src/gui/popups/beingpopup.h index d91464ebe..3b5a2d421 100644 --- a/src/gui/popups/beingpopup.h +++ b/src/gui/popups/beingpopup.h @@ -50,7 +50,7 @@ class BeingPopup final : public Popup */ void show(const int x, const int y, Being *const b); - void postInit(); + void postInit() override; #ifdef USE_PROFILER void logic(); diff --git a/src/gui/windows/charselectdialog.h b/src/gui/windows/charselectdialog.h index 1a4eeb4ac..485f7fbeb 100644 --- a/src/gui/windows/charselectdialog.h +++ b/src/gui/windows/charselectdialog.h @@ -90,7 +90,7 @@ class CharSelectDialog final : public Window, void updateState(); - void postInit(); + void postInit() override; private: void attemptCharacterDelete(const int index); diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 9a7a348c8..ca74e1765 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -271,10 +271,6 @@ ChatWindow::ChatWindow(): mColorPicker->addActionListener(this); mColorPicker->setSelected(mChatColor); - add(mChatTabs); - add(mChatInput); - add(mColorPicker); - loadWindowState(); mColorPicker->setPosition(this->getWidth() - mColorPicker->getWidth() @@ -314,6 +310,14 @@ ChatWindow::~ChatWindow() mColorListModel = nullptr; } +void ChatWindow::postInit() +{ + add(mChatTabs); + add(mChatInput); + add(mColorPicker); + updateVisibility(); +} + void ChatWindow::loadCommandsFile(const std::string &name) { StringVect list; @@ -1120,7 +1124,7 @@ WhisperTab *ChatWindow::addWhisperTab(const std::string &nick, toLower(tempNick); const TabMap::const_iterator i = mWhispers.find(tempNick); - WhisperTab *ret; + WhisperTab *ret = nullptr; if (tempNick.compare(playerName) == 0) return nullptr; diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h index 19a5022ab..64d3d66e0 100644 --- a/src/gui/windows/chatwindow.h +++ b/src/gui/windows/chatwindow.h @@ -288,6 +288,8 @@ class ChatWindow final : public Window, void addGlobalMessage(const std::string &line); + void postInit() override; + #ifdef USE_PROFILER void logicChildren(); #endif |