diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-21 22:00:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-21 22:00:30 +0300 |
commit | 76dc498cd50fb5bc83b3d0a165df17781af35979 (patch) | |
tree | 6513853d484fa36e282afc2865e8e98f69100aeb | |
parent | ba307a72cb8bcfe068e362fab4a5e572d9ac65e9 (diff) | |
download | manaplus-76dc498cd50fb5bc83b3d0a165df17781af35979.tar.gz manaplus-76dc498cd50fb5bc83b3d0a165df17781af35979.tar.bz2 manaplus-76dc498cd50fb5bc83b3d0a165df17781af35979.tar.xz manaplus-76dc498cd50fb5bc83b3d0a165df17781af35979.zip |
Call postInit after each window creation.
30 files changed, 91 insertions, 44 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 7121b138d..938b0c840 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -143,14 +143,14 @@ static int uploadUpdate(void *ptr, else { // TRANSLATORS: file uploaded message - new OkDialog(_("File uploaded"), str, + (new OkDialog(_("File uploaded"), str, // TRANSLATORS: ok dialog button _("OK"), DialogType::OK, Modal_true, ShowCenter_false, nullptr, - 260); + 260))->postInit();; } } } @@ -703,9 +703,14 @@ impHandler(talk) return false; if (being->canTalk()) + { being->talkTo(); + } else if (being->getType() == ActorType::Player) - new BuySellDialog(being->getName()); + { + BuySellDialog *const dialog = new BuySellDialog(being->getName()); + dialog->postInit(); + } return true; } @@ -1377,6 +1382,7 @@ impHandler0(testSdlFont) impHandler0(createItems) { BuyDialog *const dialog = new BuyDialog(); + dialog->postInit(); const ItemDB::ItemInfos &items = ItemDB::getItemInfos(); FOR_EACH (ItemDB::ItemInfos::const_iterator, it, items) { diff --git a/src/client.cpp b/src/client.cpp index 615fcd169..b23ddd11d 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1398,6 +1398,7 @@ int Client::gameExec() ShowCenter_true, nullptr, 260); + mCurrentDialog->postInit(); mCurrentDialog->addActionListener(&loginListener); mCurrentDialog = nullptr; // OkDialog deletes itself BLOCK_END("Client::gameExec STATE_LOGIN_ERROR") @@ -1416,6 +1417,7 @@ int Client::gameExec() ShowCenter_true, nullptr, 260); + mCurrentDialog->postInit(); mCurrentDialog->addActionListener(&accountListener); mCurrentDialog = nullptr; // OkDialog deletes itself BLOCK_END("Client::gameExec STATE_ACCOUNTCHANGE_ERROR") @@ -1449,6 +1451,7 @@ int Client::gameExec() BLOCK_START("Client::gameExec STATE_CHANGEPASSWORD") logger->log1("State: CHANGE PASSWORD"); mCurrentDialog = new ChangePasswordDialog(&loginData); + mCurrentDialog->postInit(); mCurrentDialog->setVisible(true); BLOCK_END("Client::gameExec STATE_CHANGEPASSWORD") break; @@ -1477,6 +1480,7 @@ int Client::gameExec() ShowCenter_true, nullptr, 260); + mCurrentDialog->postInit(); mCurrentDialog->addActionListener(&accountListener); mCurrentDialog = nullptr; // OkDialog deletes itself loginData.password = loginData.newPassword; @@ -1487,6 +1491,7 @@ int Client::gameExec() case STATE_CHANGEEMAIL: logger->log1("State: CHANGE EMAIL"); mCurrentDialog = new ChangeEmailDialog(&loginData); + mCurrentDialog->postInit(); mCurrentDialog->setVisible(true); break; @@ -1508,6 +1513,7 @@ int Client::gameExec() ShowCenter_true, nullptr, 260); + mCurrentDialog->postInit(); mCurrentDialog->addActionListener(&accountListener); mCurrentDialog = nullptr; // OkDialog deletes itself break; diff --git a/src/game.cpp b/src/game.cpp index eb65b352f..e88fb9c7a 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -184,6 +184,7 @@ static void createGuiWindows() chatWindow = new ChatWindow; chatWindow->postInit(); tradeWindow = new TradeWindow; + tradeWindow->postInit(); equipmentWindow = new EquipmentWindow(PlayerInfo::getEquipment(), localPlayer); equipmentWindow->postInit(); @@ -191,7 +192,9 @@ static void createGuiWindows() beingEquipmentWindow->postInit(); beingEquipmentWindow->setVisible(false); statusWindow = new StatusWindow; + statusWindow->postInit(); miniStatusWindow = new MiniStatusWindow; + miniStatusWindow->postInit(); inventoryWindow = new InventoryWindow(PlayerInfo::getInventory()); inventoryWindow->postInit(); #ifdef EATHENA_SUPPORT @@ -206,10 +209,12 @@ static void createGuiWindows() skillDialog = new SkillDialog; skillDialog->postInit(); minimap = new Minimap; + minimap->postInit(); debugWindow = new DebugWindow; debugWindow->postInit(); itemShortcutWindow = new ShortcutWindow( "ItemShortcut", "items.xml", 83, 460); + itemShortcutWindow->postInit(); for (unsigned f = 0; f < SHORTCUT_TABS; f ++) { @@ -227,6 +232,7 @@ static void createGuiWindows() "emotes.xml", 130, 480); outfitWindow = new OutfitWindow(); + outfitWindow->postInit(); dropShortcutWindow = new ShortcutWindow("DropShortcut", new VirtShortcutContainer(nullptr, dropShortcut), "drops.xml"); @@ -241,14 +247,18 @@ static void createGuiWindows() #ifdef EATHENA_SUPPORT bankWindow = new BankWindow; + bankWindow->postInit(); mailWindow = new MailWindow; + mailWindow->postInit(); #endif whoIsOnline = new WhoIsOnline; whoIsOnline->postInit(); killStats = new KillStats; + killStats->postInit(); socialWindow = new SocialWindow; socialWindow->postInit(); questsWindow = new QuestsWindow; + questsWindow->postInit(); // TRANSLATORS: chat tab header localChatTab = new ChatTab(chatWindow, _("General"), diff --git a/src/gamemodifiers.cpp b/src/gamemodifiers.cpp index 5cc79f7c6..158a6f2cd 100644 --- a/src/gamemodifiers.cpp +++ b/src/gamemodifiers.cpp @@ -442,6 +442,7 @@ void GameModifiers::changeAwayMode(const bool forward A_UNUSED) ShowCenter_false, nullptr, 260); + dialog->postInit(); localPlayer->setAwayDialog(dialog); dialog->addActionListener(localPlayer->getAwayListener()); soundManager.volumeOff(); diff --git a/src/gui/dialogsmanager.cpp b/src/gui/dialogsmanager.cpp index 9d2bcb057..eab8c7387 100644 --- a/src/gui/dialogsmanager.cpp +++ b/src/gui/dialogsmanager.cpp @@ -101,7 +101,7 @@ Window *DialogsManager::openErrorDialog(const std::string &header, { if (settings.supportUrl.empty() || config.getBoolValue("hidesupport")) { - return new OkDialog(header, message, + OkDialog *const dialog = new OkDialog(header, message, // TRANSLATORS: ok dialog button _("Close"), DialogType::ERROR, @@ -109,6 +109,8 @@ Window *DialogsManager::openErrorDialog(const std::string &header, ShowCenter_true, nullptr, 260); + dialog->postInit(); + return dialog; } else { @@ -136,6 +138,7 @@ void DialogsManager::playerDeath() ShowCenter_true, nullptr, 260); + deathNotice->postInit(); deathNotice->addActionListener(&postDeathListener); } } @@ -167,6 +170,7 @@ void DialogsManager::attributeChanged(const int id, ShowCenter_true, nullptr, 260); + weightNotice->postInit(); weightNotice->addActionListener( &weightListener); } @@ -186,6 +190,7 @@ void DialogsManager::attributeChanged(const int id, ShowCenter_true, nullptr, 260); + weightNotice->postInit(); weightNotice->addActionListener( &weightListener); } diff --git a/src/gui/widgets/tabs/setup_input.cpp b/src/gui/widgets/tabs/setup_input.cpp index 4eb81bc4a..f1752d781 100644 --- a/src/gui/widgets/tabs/setup_input.cpp +++ b/src/gui/widgets/tabs/setup_input.cpp @@ -155,7 +155,7 @@ void Setup_Input::apply() const std::string str2 = keyToString(key2); // TRANSLATORS: input settings error header - new OkDialog(_("Key Conflict(s) Detected."), + (new OkDialog(_("Key Conflict(s) Detected."), // TRANSLATORS: input settings error strprintf(_("Conflict \"%s\" and \"%s\" keys. " "Resolve them, or gameplay may result in strange behaviour."), @@ -166,7 +166,7 @@ void Setup_Input::apply() Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit(); } keyboard.setEnabled(true); inputManager.store(); diff --git a/src/gui/widgets/tabs/setup_theme.cpp b/src/gui/widgets/tabs/setup_theme.cpp index 9efba0897..54015d788 100644 --- a/src/gui/widgets/tabs/setup_theme.cpp +++ b/src/gui/widgets/tabs/setup_theme.cpp @@ -307,14 +307,14 @@ void Setup_Theme::action(const ActionEvent &event) else if (eventId == ACTION_INFO) { // TRANSLATORS: theme info dialog header - new OkDialog(_("Theme info"), mThemeInfo, + (new OkDialog(_("Theme info"), mThemeInfo, // TRANSLATORS: ok dialog button _("OK"), DialogType::OK, Modal_false, ShowCenter_true, nullptr, - 600); + 600))->postInit(); } } @@ -340,7 +340,7 @@ void Setup_Theme::apply() if (config.getStringValue("theme") != mTheme) { // TRANSLATORS: theme message dialog - new OkDialog(_("Theme Changed"), + (new OkDialog(_("Theme Changed"), // TRANSLATORS: ok dialog message _("Restart your client for the change to take effect."), // TRANSLATORS: ok dialog button @@ -349,7 +349,7 @@ void Setup_Theme::apply() Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit(); } config.setValue("selectedSkin", ""); diff --git a/src/gui/widgets/tabs/setup_video.cpp b/src/gui/widgets/tabs/setup_video.cpp index c2ee237e5..9acd36f86 100644 --- a/src/gui/widgets/tabs/setup_video.cpp +++ b/src/gui/widgets/tabs/setup_video.cpp @@ -243,7 +243,7 @@ void Setup_Video::apply() else { // TRANSLATORS: video settings warning - new OkDialog(_("Switching to Full Screen"), + (new OkDialog(_("Switching to Full Screen"), // TRANSLATORS: video settings warning _("Restart needed for changes to take effect."), // TRANSLATORS: ok dialog button @@ -252,7 +252,7 @@ void Setup_Video::apply() Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit(); } #endif config.setValue("screen", fullscreen); @@ -270,7 +270,7 @@ void Setup_Video::apply() // OpenGL can currently only be changed by restarting, notify user. // TRANSLATORS: video settings warning - new OkDialog(_("Changing to OpenGL"), + (new OkDialog(_("Changing to OpenGL"), // TRANSLATORS: video settings warning _("Applying change to OpenGL requires restart."), // TRANSLATORS: ok dialog button @@ -279,7 +279,7 @@ void Setup_Video::apply() Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit(); } mFps = mFpsCheckBox->isSelected() ? @@ -386,7 +386,7 @@ void Setup_Video::action(const ActionEvent &event) || height < mainGraphics->mActualHeight) { // TRANSLATORS: video settings warning - new OkDialog(_("Screen Resolution Changed"), + (new OkDialog(_("Screen Resolution Changed"), // TRANSLATORS: video settings warning _("Restart your client for the change to take effect.") + std::string("\n") + _("Some windows may be moved to " @@ -397,12 +397,12 @@ void Setup_Video::action(const ActionEvent &event) Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit(); } else { // TRANSLATORS: video settings warning - new OkDialog(_("Screen Resolution Changed"), + (new OkDialog(_("Screen Resolution Changed"), // TRANSLATORS: video settings warning _("Restart your client for the change" " to take effect."), @@ -412,7 +412,7 @@ void Setup_Video::action(const ActionEvent &event) Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit(); } } #else diff --git a/src/gui/windowmanager.cpp b/src/gui/windowmanager.cpp index 4a05d3491..902acb60d 100644 --- a/src/gui/windowmanager.cpp +++ b/src/gui/windowmanager.cpp @@ -97,6 +97,7 @@ void WindowManager::createWindows() setupWindow = new SetupWindow; setupWindow->postInit(); helpWindow = new HelpWindow; + helpWindow->postInit(); didYouKnowWindow = new DidYouKnowWindow; didYouKnowWindow->postInit(); popupMenu = new PopupMenu; diff --git a/src/gui/windows/changeemaildialog.cpp b/src/gui/windows/changeemaildialog.cpp index fcfd0bfd3..4ab2c690c 100644 --- a/src/gui/windows/changeemaildialog.cpp +++ b/src/gui/windows/changeemaildialog.cpp @@ -170,6 +170,7 @@ void ChangeEmailDialog::action(const ActionEvent &event) ShowCenter_true, nullptr, 260); + dlg->postInit(); dlg->addActionListener(mWrongDataNoticeListener); } else diff --git a/src/gui/windows/changepassworddialog.cpp b/src/gui/windows/changepassworddialog.cpp index 3fae963ed..ed6ac578b 100644 --- a/src/gui/windows/changepassworddialog.cpp +++ b/src/gui/windows/changepassworddialog.cpp @@ -160,6 +160,7 @@ void ChangePasswordDialog::action(const ActionEvent &event) ShowCenter_true, nullptr, 260); + dlg->postInit(); dlg->addActionListener(mWrongDataNoticeListener); } else diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index 4b10d5cf3..d6bc01e95 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -373,7 +373,7 @@ void CharCreateDialog::action(const ActionEvent &event) else { // TRANSLATORS: char creation error - new OkDialog(_("Error"), + (new OkDialog(_("Error"), // TRANSLATORS: char creation error _("Your name needs to be at least 4 characters."), // TRANSLATORS: ok dialog button @@ -382,7 +382,7 @@ void CharCreateDialog::action(const ActionEvent &event) Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit();; } } else if (id == "cancel") diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index 9b03528ec..c6e040065 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -276,14 +276,14 @@ void CharSelectDialog::action(const ActionEvent &event) character->data.mAttributes[Attributes::EXP]), Units::formatCurrency( character->data.mAttributes[Attributes::MONEY]).c_str()); - new OkDialog(data->getName(), msg, + (new OkDialog(data->getName(), msg, // TRANSLATORS: ok dialog button _("OK"), DialogType::SILENCE, Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit(); } } if (eventId == "switch") @@ -321,14 +321,14 @@ void CharSelectDialog::action(const ActionEvent &event) else { // TRANSLATORS: error message - new OkDialog(_("Error"), _("Incorrect password"), + (new OkDialog(_("Error"), _("Incorrect password"), // TRANSLATORS: ok dialog button _("OK"), DialogType::ERROR, Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit(); } } mDeleteIndex = -1; @@ -346,6 +346,7 @@ void CharSelectDialog::use(const int selected) { CharCreateDialog *const charCreateDialog = new CharCreateDialog(this, selected); + charCreateDialog->postInit(); mCharServerHandler->setCharCreateDialog(charCreateDialog); } } diff --git a/src/gui/windows/editserverdialog.cpp b/src/gui/windows/editserverdialog.cpp index 5444f2107..5f22a5389 100644 --- a/src/gui/windows/editserverdialog.cpp +++ b/src/gui/windows/editserverdialog.cpp @@ -221,6 +221,7 @@ void EditServerDialog::action(const ActionEvent &event) ShowCenter_true, nullptr, 260); + dlg->postInit(); dlg->addActionListener(this); } else diff --git a/src/gui/windows/mailviewwindow.cpp b/src/gui/windows/mailviewwindow.cpp index 1fc38c2a9..023ea925a 100644 --- a/src/gui/windows/mailviewwindow.cpp +++ b/src/gui/windows/mailviewwindow.cpp @@ -183,6 +183,7 @@ void MailViewWindow::action(const ActionEvent &event) if (mailEditWindow) mailEditWindow->scheduleDelete(); mailEditWindow = new MailEditWindow; + mailEditWindow->postInit(); mailEditWindow->setTo(mMessage->sender); mailEditWindow->setSubject("Re:" + mMessage->title); mailEditWindow->setMessage(">" + mMessage->text); diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp index 18d0626d1..e1edbb74b 100644 --- a/src/gui/windows/mailwindow.cpp +++ b/src/gui/windows/mailwindow.cpp @@ -120,7 +120,10 @@ void MailWindow::action(const ActionEvent &event) else if (eventId == "new") { if (!mailEditWindow) + { mailEditWindow = new MailEditWindow; + mailEditWindow->postInit(); + } } else if (eventId == "open") { @@ -213,6 +216,7 @@ void MailWindow::showMessage(MailMessage *const mail) } delete mailViewWindow; mailViewWindow = new MailViewWindow(mail); + mailViewWindow->postInit(); } void MailWindow::viewNext(const int id) diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp index e7d9425e1..021ebb938 100644 --- a/src/gui/windows/registerdialog.cpp +++ b/src/gui/windows/registerdialog.cpp @@ -247,6 +247,7 @@ void RegisterDialog::action(const ActionEvent &event) ShowCenter_true, nullptr, 260); + dlg->postInit(); dlg->addActionListener(mWrongDataNoticeListener); } else diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index d9e182757..b173da568 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -370,7 +370,7 @@ void ShopWindow::action(const ActionEvent &event) { EditDialog *const dialog = new EditDialog( _("Please enter new shop name"), mSellShopName, "OK"); - dialog->postInit(); + dialog->postInit(); shopRenameListener.setDialog(dialog); dialog->addActionListener(&shopRenameListener); } @@ -812,6 +812,7 @@ void ShopWindow::showList(const std::string &nick, std::string data) { data = data.substr(2); buyDialog = new BuyDialog(nick); + buyDialog->postInit(); } else if (data.find("S1") == 0) { diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp index 4a32e75a9..83935ed49 100644 --- a/src/gui/windows/socialwindow.cpp +++ b/src/gui/windows/socialwindow.cpp @@ -502,7 +502,7 @@ void SocialWindow::showPartyCreate() if (localPlayer->getParty()) { // TRANSLATORS: party creation message - new OkDialog(_("Create Party"), + (new OkDialog(_("Create Party"), _("Cannot create party. You are already in a party"), // TRANSLATORS: ok dialog button _("OK"), @@ -510,7 +510,7 @@ void SocialWindow::showPartyCreate() Modal_true, ShowCenter_true, this, - 260); + 260))->postInit(); return; } diff --git a/src/gui/windows/unregisterdialog.cpp b/src/gui/windows/unregisterdialog.cpp index 91975510b..c8ec421a5 100644 --- a/src/gui/windows/unregisterdialog.cpp +++ b/src/gui/windows/unregisterdialog.cpp @@ -150,6 +150,7 @@ void UnRegisterDialog::action(const ActionEvent &event) ShowCenter_true, nullptr, 260); + dlg->postInit(); dlg->addActionListener(mWrongDataNoticeListener); } else diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp index 8af3cb4f0..e0f686cad 100644 --- a/src/net/ea/buysellhandler.cpp +++ b/src/net/ea/buysellhandler.cpp @@ -56,7 +56,8 @@ void BuySellHandler::processNpcBuySellChoice(Net::MessageIn &msg) if (!BuySellDialog::isActive()) { mNpcId = msg.readInt32("npc id"); - new BuySellDialog(mNpcId); + BuySellDialog *const dialog = new BuySellDialog(mNpcId); + dialog->postInit(); } } diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index 6348b5dc5..42c704933 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -138,14 +138,14 @@ void CharServerHandler::processCharCreateFailed(Net::MessageIn &msg) break; } // TRANSLATORS: error message header - new OkDialog(_("Error"), errorMessage, + (new OkDialog(_("Error"), errorMessage, // TRANSLATORS: ok dialog button _("OK"), DialogType::ERROR, Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit(); if (mCharCreateDialog) mCharCreateDialog->unlock(); BLOCK_END("CharServerHandler::processCharCreateFailed") @@ -160,14 +160,14 @@ void CharServerHandler::processCharDelete(Net::MessageIn &msg A_UNUSED) updateCharSelectDialog(); unlockCharSelectDialog(); // TRANSLATORS: info message - new OkDialog(_("Info"), _("Character deleted."), + (new OkDialog(_("Info"), _("Character deleted."), // TRANSLATORS: ok dialog button _("OK"), DialogType::OK, Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit(); BLOCK_END("CharServerHandler::processCharDelete") } diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp index 9c100de00..31c487921 100644 --- a/src/net/ea/gamehandler.cpp +++ b/src/net/ea/gamehandler.cpp @@ -76,7 +76,7 @@ void GameHandler::processMapQuitResponse(Net::MessageIn &msg) { if (msg.readUInt8("response")) { - new OkDialog(_("Game"), + (new OkDialog(_("Game"), // TRANSLATORS: error message _("Request to quit denied!"), // TRANSLATORS: ok dialog button @@ -85,7 +85,7 @@ void GameHandler::processMapQuitResponse(Net::MessageIn &msg) Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit(); } } diff --git a/src/net/eathena/buysellhandler.cpp b/src/net/eathena/buysellhandler.cpp index a810feac7..26a5a538b 100644 --- a/src/net/eathena/buysellhandler.cpp +++ b/src/net/eathena/buysellhandler.cpp @@ -95,6 +95,7 @@ void BuySellHandler::processNpcBuy(Net::MessageIn &msg) const int sz = 11; const int n_items = (msg.getLength() - 4) / sz; mBuyDialog = new BuyDialog(mNpcId); + mBuyDialog->postInit(); mBuyDialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY)); for (int k = 0; k < n_items; k++) diff --git a/src/net/eathena/cashshophandler.cpp b/src/net/eathena/cashshophandler.cpp index 3ddbe9444..90eb1b2af 100644 --- a/src/net/eathena/cashshophandler.cpp +++ b/src/net/eathena/cashshophandler.cpp @@ -96,6 +96,7 @@ void CashShopHandler::processCashShopOpen(Net::MessageIn &msg) const int count = (msg.readInt16("len") - 12) / 11; mBuyDialog = new BuyDialog(BuyDialog::Cash); + mBuyDialog->postInit(); mBuyDialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY)); msg.readInt32("cash points"); diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp index f3ce778cf..0a634c80f 100644 --- a/src/net/eathena/charserverhandler.cpp +++ b/src/net/eathena/charserverhandler.cpp @@ -574,14 +574,14 @@ void CharServerHandler::processCharCheckRename(Net::MessageIn &msg) else { // TRANSLATORS: info message - new OkDialog(_("Error"), _("Character rename error."), + (new OkDialog(_("Error"), _("Character rename error."), // TRANSLATORS: ok dialog button _("Error"), DialogType::ERROR, Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit(); } } @@ -592,14 +592,14 @@ void CharServerHandler::processCharRename(Net::MessageIn &msg) { mCharSelectDialog->setName(mRenameId, mNewName); // TRANSLATORS: info message - new OkDialog(_("Info"), _("Character renamed."), + (new OkDialog(_("Info"), _("Character renamed."), // TRANSLATORS: ok dialog button _("OK"), DialogType::OK, Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit(); } else { @@ -625,14 +625,14 @@ void CharServerHandler::processCharRename(Net::MessageIn &msg) break; } // TRANSLATORS: info message - new OkDialog(_("Info"), message, + (new OkDialog(_("Info"), message, // TRANSLATORS: ok dialog button _("OK"), DialogType::OK, Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit(); } } @@ -658,14 +658,14 @@ void CharServerHandler::processCharDeleteFailed(Net::MessageIn &msg) unlockCharSelectDialog(); msg.readUInt8("error"); // TRANSLATORS: error message - new OkDialog(_("Error"), _("Failed to delete character."), + (new OkDialog(_("Error"), _("Failed to delete character."), // TRANSLATORS: ok dialog button _("OK"), DialogType::ERROR, Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit(); BLOCK_END("CharServerHandler::processCharDeleteFailed") } diff --git a/src/net/eathena/markethandler.cpp b/src/net/eathena/markethandler.cpp index f57b3ec2d..175429cda 100644 --- a/src/net/eathena/markethandler.cpp +++ b/src/net/eathena/markethandler.cpp @@ -78,6 +78,7 @@ void MarketHandler::processMarketOpen(Net::MessageIn &msg) const int len = (msg.readInt16("len") - 4) / 13; mBuyDialog = new BuyDialog(BuyDialog::Market); + mBuyDialog->postInit(); mBuyDialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY)); for (int f = 0; f < len; f ++) diff --git a/src/net/eathena/vendinghandler.cpp b/src/net/eathena/vendinghandler.cpp index 27a43200f..9ba6bfc7b 100644 --- a/src/net/eathena/vendinghandler.cpp +++ b/src/net/eathena/vendinghandler.cpp @@ -144,6 +144,7 @@ void VendingHandler::processItemsList(Net::MessageIn &msg) if (!being) return; mBuyDialog = new BuyDialog(being->getName()); + mBuyDialog->postInit(); mBuyDialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY)); msg.readInt32("vender id"); for (int f = 0; f < count; f ++) diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp index e63559d20..28261579e 100644 --- a/src/net/tmwa/buysellhandler.cpp +++ b/src/net/tmwa/buysellhandler.cpp @@ -107,6 +107,7 @@ void BuySellHandler::processNpcBuy(Net::MessageIn &msg) sz += 1; const unsigned int n_items = (msg.getLength() - 4U) / sz; mBuyDialog = new BuyDialog(mNpcId); + mBuyDialog->postInit(); mBuyDialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY)); for (unsigned int k = 0; k < n_items; k++) diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index b33e0e4e2..970d6a9c6 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -518,14 +518,14 @@ void CharServerHandler::processCharDeleteFailed(Net::MessageIn &msg) unlockCharSelectDialog(); msg.readUInt8("error"); // TRANSLATORS: error message - new OkDialog(_("Error"), _("Failed to delete character."), + (new OkDialog(_("Error"), _("Failed to delete character."), // TRANSLATORS: ok dialog button _("OK"), DialogType::ERROR, Modal_true, ShowCenter_true, nullptr, - 260); + 260))->postInit(); BLOCK_END("CharServerHandler::processCharDeleteFailed") } |