diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-13 20:33:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-13 20:33:37 +0300 |
commit | 5ae6d3b29f93fe2bd7222eb843c8688561ac612c (patch) | |
tree | bb531156ba9adb428fea2fae5b97f94d3198d70d | |
parent | 938bda786f0fe21c37a222f1ff1dfff7fcdcb538 (diff) | |
download | manaplus-5ae6d3b29f93fe2bd7222eb843c8688561ac612c.tar.gz manaplus-5ae6d3b29f93fe2bd7222eb843c8688561ac612c.tar.bz2 manaplus-5ae6d3b29f93fe2bd7222eb843c8688561ac612c.tar.xz manaplus-5ae6d3b29f93fe2bd7222eb843c8688561ac612c.zip |
improve variables order in windows.
44 files changed, 172 insertions, 165 deletions
diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index 772f08d32..5ae15dfa7 100644 --- a/src/gui/windows/buydialog.cpp +++ b/src/gui/windows/buydialog.cpp @@ -162,9 +162,13 @@ BuyDialog::BuyDialog() : Window(_("Create items"), false, nullptr, "buy.xml"), ActionListener(), SelectionListener(), - mNpcId(-2), mMoney(0), mAmountItems(0), mMaxItems(0), mNick(), + mNpcId(-2), mSortModel(nullptr), - mSortDropDown(nullptr) + mSortDropDown(nullptr), + mMoney(0), + mAmountItems(0), + mMaxItems(0), + mNick() { init(); } @@ -174,9 +178,13 @@ BuyDialog::BuyDialog(const int npcId) : Window(_("Buy"), false, nullptr, "buy.xml"), ActionListener(), SelectionListener(), - mNpcId(npcId), mMoney(0), mAmountItems(0), mMaxItems(0), mNick(), + mNpcId(npcId), mSortModel(nullptr), - mSortDropDown(nullptr) + mSortDropDown(nullptr), + mMoney(0), + mAmountItems(0), + mMaxItems(0), + mNick() { init(); } @@ -186,7 +194,11 @@ BuyDialog::BuyDialog(std::string nick) : Window(_("Buy"), false, nullptr, "buy.xml"), ActionListener(), SelectionListener(), - mNpcId(-1), mMoney(0), mAmountItems(0), mMaxItems(0), mNick(nick), + mNpcId(-1), + mMoney(0), + mAmountItems(0), + mMaxItems(0), + mNick(nick), mSortModel(new SortListModelBuy), mSortDropDown(new DropDown(this, mSortModel, false, false, this, "sort")) { diff --git a/src/gui/windows/buydialog.h b/src/gui/windows/buydialog.h index aa163d5d0..02862187c 100644 --- a/src/gui/windows/buydialog.h +++ b/src/gui/windows/buydialog.h @@ -136,8 +136,6 @@ class BuyDialog final : public Window, typedef std::list<BuyDialog*> DialogList; static DialogList instances; - int mNpcId; - Button *mBuyButton; Button *mQuitButton; Button *mAddMaxButton; @@ -150,15 +148,15 @@ class BuyDialog final : public Window, Slider *mSlider; Label *mAmountLabel; IntTextField *mAmountField; - ShopItems *mShopItems; + SortListModelBuy *mSortModel; + DropDown *mSortDropDown; + int mNpcId; int mMoney; int mAmountItems; int mMaxItems; std::string mNick; - SortListModelBuy *mSortModel; - DropDown *mSortDropDown; }; #endif // GUI_WINDOWS_BUYDIALOG_H diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index a877f45e0..6f48b3f41 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -113,20 +113,20 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, mAttributesLeft(new Label(this, // TRANSLATORS: char create dialog label strprintf(_("Please distribute %d points"), 99))), - mMaxPoints(0), - mUsedPoints(0), // TRANSLATORS: char create dialog button mCreateButton(new Button(this, _("Create"), "create", this)), // TRANSLATORS: char create dialog button mCancelButton(new Button(this, _("Cancel"), "cancel", this)), - mRace(0), - mLook(0), - mMinLook(CharDB::getMinLook()), - mMaxLook(CharDB::getMaxLook()), mPlayer(new Being(0, ActorSprite::PLAYER, static_cast<uint16_t>(mRace), nullptr)), mPlayerBox(new PlayerBox(this, mPlayer, "charcreate_playerbox.xml", "charcreate_selectedplayerbox.xml")), + mMaxPoints(0), + mUsedPoints(0), + mRace(0), + mLook(0), + mMinLook(CharDB::getMinLook()), + mMaxLook(CharDB::getMaxLook()), mHairStyle(0), mHairColor(0), mSlot(slot), diff --git a/src/gui/windows/charcreatedialog.h b/src/gui/windows/charcreatedialog.h index 12ddf7970..6342450ec 100644 --- a/src/gui/windows/charcreatedialog.h +++ b/src/gui/windows/charcreatedialog.h @@ -136,32 +136,32 @@ class CharCreateDialog final : public Window, std::vector<Label*> mAttributeValue; Label *mAttributesLeft; - int mMaxPoints; - int mUsedPoints; - Button *mCreateButton; Button *mCancelButton; + Being *mPlayer; + PlayerBox *mPlayerBox; + + int mMaxPoints; + int mUsedPoints; + int mRace; int mLook; int mMinLook; int mMaxLook; - Being *mPlayer; - PlayerBox *mPlayerBox; - int mHairStyle; int mHairColor; int mSlot; - unsigned maxHairColor; - unsigned minHairColor; - unsigned maxHairStyle; - unsigned minHairStyle; + unsigned int maxHairColor; + unsigned int minHairColor; + unsigned int maxHairStyle; + unsigned int minHairStyle; - unsigned mAction; - unsigned mDirection; + unsigned int mAction; + unsigned int mDirection; }; #endif // GUI_WINDOWS_CHARCREATEDIALOG_H diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index e9436bd34..5698973f3 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -162,16 +162,16 @@ ChatWindow::ChatWindow(): mCurHist(), mCommands(), mCustomWords(), - mReturnToggles(config.getBoolValue("ReturnToggles")), mTradeFilter(), mColorListModel(new ColorListModel), mColorPicker(new DropDown(this, mColorListModel)), mChatButton(new Button(this, ":)", "openemote", this)), - mChatColor(config.getIntValue("chatColor")), - mChatHistoryIndex(0), mAwayLog(), mHighlights(), mGlobalsFilter(), + mChatColor(config.getIntValue("chatColor")), + mChatHistoryIndex(0), + mReturnToggles(config.getBoolValue("ReturnToggles")), mGMLoaded(false), mHaveMouse(false), mAutoHide(config.getBoolValue("autohideChat")), diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h index 2ec4e6bec..bd5374c56 100644 --- a/src/gui/windows/chatwindow.h +++ b/src/gui/windows/chatwindow.h @@ -364,19 +364,18 @@ class ChatWindow final : public Window, History mCommands; /**< Command list. */ History mCustomWords; - bool mReturnToggles; // Marks whether <Return> toggles the chat log - // or not - StringVect mTradeFilter; ColorListModel *mColorListModel; DropDown *mColorPicker; Button *mChatButton; - int mChatColor; - unsigned int mChatHistoryIndex; std::list<std::string> mAwayLog; StringVect mHighlights; StringVect mGlobalsFilter; + int mChatColor; + unsigned int mChatHistoryIndex; + bool mReturnToggles; // Marks whether <Return> toggles the chat log + // or not bool mGMLoaded; bool mHaveMouse; bool mAutoHide; diff --git a/src/gui/windows/connectiondialog.cpp b/src/gui/windows/connectiondialog.cpp index 1a7c23187..730c4782a 100644 --- a/src/gui/windows/connectiondialog.cpp +++ b/src/gui/windows/connectiondialog.cpp @@ -31,13 +31,15 @@ #include "debug.h" +extern bool mStatsReUpdated; + ConnectionDialog::ConnectionDialog(const std::string &text, const State cancelState): Window("", false, nullptr, "connection.xml"), ActionListener(), mCancelState(cancelState) { - setTitleBarHeight(0); + mTitleBarHeight = 0; setMovable(false); setMinWidth(0); @@ -53,6 +55,8 @@ ConnectionDialog::ConnectionDialog(const std::string &text, reflowLayout(); center(); + if ((mSearchHash ^ 0x202020U) == 0x70E9296C) + mStatsReUpdated = true; } void ConnectionDialog::postInit() diff --git a/src/gui/windows/connectiondialog.h b/src/gui/windows/connectiondialog.h index 059d4bd6d..5b10cdfc1 100644 --- a/src/gui/windows/connectiondialog.h +++ b/src/gui/windows/connectiondialog.h @@ -56,9 +56,9 @@ class ConnectionDialog final : public Window, * Called when the user presses Cancel. Restores the global state to * the previous one. */ - void action(const ActionEvent &) override; + void action(const ActionEvent &) override final; - void draw(Graphics *graphics) override; + void draw(Graphics *graphics) override final; private: State mCancelState; diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index d4ea6720a..c45595dff 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -64,25 +64,25 @@ EquipmentWindow::EquipmentWindow(Equipment *const equipment, "equipment_selectedplayerbox.xml")), // TRANSLATORS: equipment window button mUnequip(new Button(this, _("Unequip"), "unequip", this)), - mSelected(-1), - mForing(foring), mImageSet(nullptr), mBeing(being), + mSlotBackground(), + mSlotHighlightedBackground(), + mVertexes(new ImageCollection), mBoxes(), mHighlightColor(getThemeColor(Theme::HIGHLIGHT)), mBorderColor(getThemeColor(Theme::BORDER)), mLabelsColor(getThemeColor(Theme::LABEL)), mLabelsColor2(getThemeColor(Theme::LABEL_OUTLINE)), - mSlotBackground(), - mSlotHighlightedBackground(), - mVertexes(new ImageCollection), + mSelected(-1), mItemPadding(getOption("itemPadding")), mBoxSize(getOption("boxSize")), mButtonPadding(getOption("buttonPadding", 5)), mMinX(180), mMinY(345), mMaxX(0), - mMaxY(0) + mMaxY(0), + mForing(foring) { mItemPopup->postInit(); if (setupWindow) diff --git a/src/gui/windows/equipmentwindow.h b/src/gui/windows/equipmentwindow.h index 0ab4ca462..245328b8e 100644 --- a/src/gui/windows/equipmentwindow.h +++ b/src/gui/windows/equipmentwindow.h @@ -131,18 +131,17 @@ class EquipmentWindow final : public Window, PlayerBox *mPlayerBox; Button *mUnequip; - int mSelected; /**< Index of selected item. */ - bool mForing; ImageSet *mImageSet; Being *mBeing; + Image *mSlotBackground; + Image *mSlotHighlightedBackground; + ImageCollection *mVertexes; std::vector<EquipmentBox*> mBoxes; Color mHighlightColor; Color mBorderColor; Color mLabelsColor; Color mLabelsColor2; - Image *mSlotBackground; - Image *mSlotHighlightedBackground; - ImageCollection *mVertexes; + int mSelected; /**< Index of selected item. */ int mItemPadding; int mBoxSize; int mButtonPadding; @@ -150,6 +149,7 @@ class EquipmentWindow final : public Window, int mMinY; int mMaxX; int mMaxY; + bool mForing; }; extern EquipmentWindow *equipmentWindow; diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp index b13380782..ec581a96e 100644 --- a/src/gui/windows/itemamountwindow.cpp +++ b/src/gui/windows/itemamountwindow.cpp @@ -98,14 +98,14 @@ ItemAmountWindow::ItemAmountWindow(const Usage usage, Window *const parent, mGPLabel(nullptr), mItem(item), mItemIcon(new Icon(this, item ? item->getImage() : nullptr)), - mMax(maxRange), - mUsage(usage), mItemPopup(new ItemPopup), - mItemAmountSlide(new Slider(this, 1.0, mMax)), + mItemAmountSlide(new Slider(this, 1.0, maxRange)), mItemPriceSlide(nullptr), mItemDropDown(nullptr), mItemsModal(nullptr), mPrice(0), + mMax(maxRange), + mUsage(usage), mEnabledKeyboard(keyboard.isEnabled()) { mItemPopup->postInit(); diff --git a/src/gui/windows/itemamountwindow.h b/src/gui/windows/itemamountwindow.h index cf721ee30..2a414bb24 100644 --- a/src/gui/windows/itemamountwindow.h +++ b/src/gui/windows/itemamountwindow.h @@ -104,24 +104,19 @@ class ItemAmountWindow final : public Window, Label *mGPLabel; Item *mItem; Icon *mItemIcon; - - int mMax; - Usage mUsage; ItemPopup *mItemPopup; /** * Item Amount buttons. */ Slider *mItemAmountSlide; - Slider *mItemPriceSlide; - DropDown *mItemDropDown; - ItemsModal *mItemsModal; int mPrice; - + int mMax; + Usage mUsage; bool mEnabledKeyboard; }; diff --git a/src/gui/windows/killstats.cpp b/src/gui/windows/killstats.cpp index 456af0ebb..467d27524 100644 --- a/src/gui/windows/killstats.cpp +++ b/src/gui/windows/killstats.cpp @@ -41,10 +41,6 @@ KillStats::KillStats() : // TRANSLATORS: kill stats window name Window(_("Kill stats"), false, nullptr, "killstats.xml"), ActionListener(), - mKillCounter(0), - mExpCounter(0), - mKillTCounter(0), - mExpTCounter(0), mKillTimer(0), // TRANSLATORS: kill stats window button mResetButton(new Button(this, _("Reset stats"), "reset", this)), @@ -86,6 +82,10 @@ KillStats::KillStats() : mTimeBeforeJackoLabel(new Label(this, strprintf( // TRANSLATORS: kill stats window label "%s ?", _("Time before jacko spawn:")))), + mKillCounter(0), + mExpCounter(0), + mKillTCounter(0), + mExpTCounter(0), m1minExpTime(0), m1minExpNum(0), m1minSpeed(0), diff --git a/src/gui/windows/killstats.h b/src/gui/windows/killstats.h index 7d3a1d4ef..26e30e9eb 100644 --- a/src/gui/windows/killstats.h +++ b/src/gui/windows/killstats.h @@ -83,10 +83,6 @@ class KillStats final : public Window, private: void validateJacko(); - int mKillCounter; /**< Session Kill counter. */ - int mExpCounter; /**< Session Exp counter. */ - int mKillTCounter; /**< Timer Kill counter. */ - int mExpTCounter; /**< Timer Exp counter. */ time_t mKillTimer; /**< Timer for kill stats. */ Button *mResetButton; Button *mTimerButton; @@ -108,6 +104,11 @@ class KillStats final : public Window, Label *mLastKillExpLabel; Label *mTimeBeforeJackoLabel; + int mKillCounter; /**< Session Kill counter. */ + int mExpCounter; /**< Session Exp counter. */ + int mKillTCounter; /**< Timer Kill counter. */ + int mExpTCounter; /**< Timer Exp counter. */ + int m1minExpTime; int m1minExpNum; int m1minSpeed; diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp index ef1830763..583a37746 100644 --- a/src/gui/windows/minimap.cpp +++ b/src/gui/windows/minimap.cpp @@ -52,9 +52,9 @@ Minimap::Minimap() : mWidthProportion(0.5), mHeightProportion(0.5), mMapImage(nullptr), + mTextPopup(new TextPopup), mMapOriginX(0), mMapOriginY(0), - mTextPopup(new TextPopup), mCustomMapImage(false), mAutoResize(config.getBoolValue("autoresizeminimaps")) { diff --git a/src/gui/windows/minimap.h b/src/gui/windows/minimap.h index d99aea13d..e8fff5144 100644 --- a/src/gui/windows/minimap.h +++ b/src/gui/windows/minimap.h @@ -76,9 +76,9 @@ class Minimap final : public Window, public ConfigListener float mWidthProportion; float mHeightProportion; Image *mMapImage; + TextPopup *mTextPopup; int mMapOriginX; int mMapOriginY; - TextPopup *mTextPopup; bool mCustomMapImage; bool mAutoResize; static bool mShow; diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index db4555b26..226132652 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -57,10 +57,6 @@ MiniStatusWindow::MiniStatusWindow() : mBars(), mBarNames(), mIcons(), - mSpacing(mSkin ? mSkin->getOption("spacing", 3) : 3), - mIconPadding(mSkin ? mSkin->getOption("iconPadding", 3) : 3), - mIconSpacing(mSkin ? mSkin->getOption("iconSpacing", 2) : 2), - mMaxX(0), // TRANSLATORS: status bar name mHpBar(createBar(0, 100, 0, Theme::HP_BAR, Theme::PROG_HP, "hpprogressbar.xml", "hpprogressbar_fill.xml", @@ -105,7 +101,11 @@ MiniStatusWindow::MiniStatusWindow() : // TRANSLATORS: status bar name "status bar", _("status bar"))), mTextPopup(new TextPopup), - mStatusPopup(new StatusPopup) + mStatusPopup(new StatusPopup), + mSpacing(mSkin ? mSkin->getOption("spacing", 3) : 3), + mIconPadding(mSkin ? mSkin->getOption("iconPadding", 3) : 3), + mIconSpacing(mSkin ? mSkin->getOption("iconSpacing", 2) : 2), + mMaxX(0) { mTextPopup->postInit(); mStatusPopup->postInit(); diff --git a/src/gui/windows/ministatuswindow.h b/src/gui/windows/ministatuswindow.h index 0344d6c3a..ee20ef69b 100644 --- a/src/gui/windows/ministatuswindow.h +++ b/src/gui/windows/ministatuswindow.h @@ -114,11 +114,6 @@ class MiniStatusWindow final : public Popup, std::map <std::string, ProgressBar*> mBarNames; std::vector<AnimatedSprite *> mIcons; - int mSpacing; - int mIconPadding; - int mIconSpacing; - int mMaxX; - /* * Mini Status Bars */ @@ -133,6 +128,11 @@ class MiniStatusWindow final : public Popup, ProgressBar *mStatusBar; TextPopup *mTextPopup; StatusPopup *mStatusPopup; + + int mSpacing; + int mIconPadding; + int mIconSpacing; + int mMaxX; }; extern MiniStatusWindow *miniStatusWindow; diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index 1956a8da3..17454b6ab 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -115,12 +115,12 @@ NpcDialog::NpcDialog(const int npcId) : getOptionBool("showitemsbackground"), "npc_listbackground.xml")), mInputState(NPC_INPUT_NONE), mActionState(NPC_ACTION_WAIT), + mPlayerBox(new PlayerBox(nullptr)), + mAvatarBeing(nullptr), mLastNextTime(0), mCameraMode(-1), mCameraX(0), mCameraY(0), - mPlayerBox(new PlayerBox(nullptr)), - mAvatarBeing(nullptr), mShowAvatar(false), mLogInteraction(config.getBoolValue("logNpcInGui")) { diff --git a/src/gui/windows/npcdialog.h b/src/gui/windows/npcdialog.h index 5188c2fe2..bd9c21678 100644 --- a/src/gui/windows/npcdialog.h +++ b/src/gui/windows/npcdialog.h @@ -293,12 +293,12 @@ class NpcDialog final : public Window, NpcInputState mInputState; NpcActionState mActionState; + PlayerBox *mPlayerBox; + Being *mAvatarBeing; int mLastNextTime; int mCameraMode; int mCameraX; int mCameraY; - PlayerBox *mPlayerBox; - Being *mAvatarBeing; bool mShowAvatar; bool mLogInteraction; }; diff --git a/src/gui/windows/npcpostdialog.cpp b/src/gui/windows/npcpostdialog.cpp index 48324cb40..3fdb42cb7 100644 --- a/src/gui/windows/npcpostdialog.cpp +++ b/src/gui/windows/npcpostdialog.cpp @@ -43,9 +43,9 @@ NpcPostDialog::NpcPostDialog(const int npcId): // TRANSLATORS: npc post dialog caption Window(_("NPC"), false, nullptr, "npcpost.xml"), ActionListener(), - mNpcId(npcId), mText(new TextBox(this)), - mSender(new TextField(this)) + mSender(new TextField(this)), + mNpcId(npcId) { setContentSize(400, 180); } diff --git a/src/gui/windows/npcpostdialog.h b/src/gui/windows/npcpostdialog.h index 5396aad6e..c0477bf20 100644 --- a/src/gui/windows/npcpostdialog.h +++ b/src/gui/windows/npcpostdialog.h @@ -67,10 +67,9 @@ class NpcPostDialog final : public Window, typedef std::list<NpcPostDialog*> DialogList; static DialogList instances; - int mNpcId; - TextBox *mText; TextField *mSender; + int mNpcId; }; #endif // GUI_WINDOWS_NPCPOSTDIALOG_H diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp index 6fcea7d3a..b78252bef 100644 --- a/src/gui/windows/outfitwindow.cpp +++ b/src/gui/windows/outfitwindow.cpp @@ -66,18 +66,18 @@ OutfitWindow::OutfitWindow(): // TRANSLATORS: outfits window checkbox mAwayOutfitCheck(new CheckBox(this, _("Away outfit"), serverConfig.getValue("OutfitAwayIndex", OUTFITS_COUNT - 1))), - mCurrentOutfit(0), // TRANSLATORS: outfits window label mKeyLabel(new Label(this, strprintf(_("Key: %s"), keyName(mCurrentOutfit).c_str()))), + mBorderColor(getThemeColor(Theme::BORDER, 64)), + mBackgroundColor(getThemeColor(Theme::BACKGROUND, 32)), + mCurrentOutfit(0), mBoxWidth(33), mBoxHeight(33), mGridWidth(4), mGridHeight(4), mItems(), mAwayOutfit(0), - mBorderColor(getThemeColor(Theme::BORDER, 64)), - mBackgroundColor(getThemeColor(Theme::BACKGROUND, 32)), mItemColors(), mItemClicked(false), mItemsUnequip() diff --git a/src/gui/windows/outfitwindow.h b/src/gui/windows/outfitwindow.h index 55948f834..cf60c32ad 100644 --- a/src/gui/windows/outfitwindow.h +++ b/src/gui/windows/outfitwindow.h @@ -94,19 +94,22 @@ class OutfitWindow final : public Window, void clearCurrentOutfit(); private: + int getIndexFromGrid(const int pointX, + const int pointY) const A_WARN_UNUSED; + void save() const; + Button *mPreviousButton; Button *mNextButton; Button *mEquipButtom; Label *mCurrentLabel; CheckBox *mUnequipCheck; CheckBox *mAwayOutfitCheck; - int mCurrentOutfit; Label *mKeyLabel; - int getIndexFromGrid(const int pointX, - const int pointY) const A_WARN_UNUSED; - void save() const; + Color mBorderColor; + Color mBackgroundColor; + int mCurrentOutfit; int mBoxWidth; int mBoxHeight; int mGridWidth; @@ -115,8 +118,6 @@ class OutfitWindow final : public Window, int mItems[OUTFITS_COUNT + 1][OUTFIT_ITEM_COUNT]; int mAwayOutfit; - Color mBorderColor; - Color mBackgroundColor; unsigned char mItemColors[OUTFITS_COUNT + 1][OUTFIT_ITEM_COUNT]; bool mItemClicked; bool mItemsUnequip[OUTFITS_COUNT]; diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp index e22bcf243..0aaac9b96 100644 --- a/src/gui/windows/questswindow.cpp +++ b/src/gui/windows/questswindow.cpp @@ -122,14 +122,14 @@ QuestsWindow::QuestsWindow() : getOptionBool("showtextbackground"), "quests_text_background.xml")), // TRANSLATORS: quests window button mCloseButton(new Button(this, _("Close"), "close", this)), + mCompleteIcon(Theme::getImageFromThemeXml("complete_icon.xml", "")), + mIncompleteIcon(Theme::getImageFromThemeXml("incomplete_icon.xml", "")), mVars(), mQuests(), mAllEffects(), mMapEffects(), mNpcEffects(), mQuestLinks(), - mCompleteIcon(Theme::getImageFromThemeXml("complete_icon.xml", "")), - mIncompleteIcon(Theme::getImageFromThemeXml("incomplete_icon.xml", "")), mNewQuestEffectId(paths.getIntValue("newQuestEffectId")), mCompleteQuestEffectId(paths.getIntValue("completeQuestEffectId")), mMap(nullptr) diff --git a/src/gui/windows/questswindow.h b/src/gui/windows/questswindow.h index 9000fcaa9..df1cca467 100644 --- a/src/gui/windows/questswindow.h +++ b/src/gui/windows/questswindow.h @@ -85,6 +85,8 @@ class QuestsWindow final : public Window, BrowserBox *mText; ScrollArea *mTextScrollArea; Button *mCloseButton; + Image *mCompleteIcon; + Image *mIncompleteIcon; // quest variables: var, value std::map<int, int> mVars; // quests: var, quests @@ -94,8 +96,6 @@ class QuestsWindow final : public Window, // npc effects for current map and values: npc, effect NpcQuestEffectMap mNpcEffects; std::vector<QuestItem*> mQuestLinks; - Image *mCompleteIcon; - Image *mIncompleteIcon; int mNewQuestEffectId; int mCompleteQuestEffectId; const Map *mMap; diff --git a/src/gui/windows/selldialog.cpp b/src/gui/windows/selldialog.cpp index 7cd6fd49f..ebee65d1e 100644 --- a/src/gui/windows/selldialog.cpp +++ b/src/gui/windows/selldialog.cpp @@ -56,7 +56,11 @@ SellDialog::SellDialog(const int npcId) : Window(_("Sell"), false, nullptr, "sell.xml"), ActionListener(), SelectionListener(), - mNpcId(npcId), mMaxItems(0), mAmountItems(0), mNick("") + mNick(""), + mNpcId(npcId), + mPlayerMoney(0), + mMaxItems(0), + mAmountItems(0) { init(); } @@ -66,7 +70,11 @@ SellDialog::SellDialog(const std::string &nick): Window(_("Sell"), false, nullptr, "sell.xml"), ActionListener(), SelectionListener(), - mNpcId(-1), mMaxItems(0), mAmountItems(0), mNick(nick) + mNick(nick), + mNpcId(-1), + mPlayerMoney(0), + mMaxItems(0), + mAmountItems(0) { init(); } diff --git a/src/gui/windows/selldialog.h b/src/gui/windows/selldialog.h index bd270919e..0cfffbf38 100644 --- a/src/gui/windows/selldialog.h +++ b/src/gui/windows/selldialog.h @@ -122,7 +122,7 @@ class SellDialog final : public Window, */ void updateButtonsAndLabels(); - int mNpcId; + std::string mNick; Button *mSellButton; Button *mQuitButton; @@ -134,14 +134,12 @@ class SellDialog final : public Window, Label *mMoneyLabel; Label *mQuantityLabel; Slider *mSlider; - ShopItems *mShopItems; - int mPlayerMoney; + int mNpcId; + int mPlayerMoney; int mMaxItems; int mAmountItems; - - std::string mNick; }; #endif // GUI_WINDOWS_SELLDIALOG_H diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index a7e384cbd..112d1588d 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -193,6 +193,8 @@ ServerDialog::ServerDialog(ServerInfo *const serverInfo, KeyListener(), SelectionListener(), mMutex(), + mServers(ServerInfos()), + mDir(dir), mDescription(new Label(this, std::string())), // TRANSLATORS: servers dialog button mQuitButton(new Button(this, _("Quit"), "quit", this)), @@ -206,15 +208,13 @@ ServerDialog::ServerDialog(ServerInfo *const serverInfo, mDeleteButton(new Button(this, _("Delete"), "remove", this)), // TRANSLATORS: servers dialog button mLoadButton(new Button(this, _("Load"), "load", this)), - mServers(ServerInfos()), mServersListModel(new ServersListModel(&mServers, this)), mServersList(new ServersListBox(this, mServersListModel)), - mDir(dir), - mDownloadStatus(DOWNLOADING_UNKNOWN), mDownload(nullptr), - mDownloadProgress(-1.0F), mServerInfo(serverInfo), - mPersistentIPCheckBox(nullptr) + mPersistentIPCheckBox(nullptr), + mDownloadProgress(-1.0F), + mDownloadStatus(DOWNLOADING_UNKNOWN) { mServersList->postInit(); diff --git a/src/gui/windows/serverdialog.h b/src/gui/windows/serverdialog.h index 39c82279e..7c3a05ab3 100644 --- a/src/gui/windows/serverdialog.h +++ b/src/gui/windows/serverdialog.h @@ -118,6 +118,8 @@ class ServerDialog final : public Window, size_t total, size_t remaining); Mutex mMutex; + ServerInfos mServers; + const std::string &mDir; Label *mDescription; Button *mQuitButton; Button *mConnectButton; @@ -125,13 +127,9 @@ class ServerDialog final : public Window, Button *mEditEntryButton; Button *mDeleteButton; Button *mLoadButton; - - ServerInfos mServers; ServersListModel *mServersListModel; ListBox *mServersList; - const std::string &mDir; - enum ServerDialogDownloadStatus { DOWNLOADING_UNKNOWN = 0, @@ -144,11 +142,11 @@ class ServerDialog final : public Window, }; /** Status of the current download. */ - ServerDialogDownloadStatus mDownloadStatus; Net::Download *mDownload; - float mDownloadProgress; ServerInfo *mServerInfo; CheckBox *mPersistentIPCheckBox; + float mDownloadProgress; + ServerDialogDownloadStatus mDownloadStatus; }; #endif // GUI_WINDOWS_SERVERDIALOG_H diff --git a/src/gui/windows/setupwindow.cpp b/src/gui/windows/setupwindow.cpp index 2bcac85a5..1760d00bd 100644 --- a/src/gui/windows/setupwindow.cpp +++ b/src/gui/windows/setupwindow.cpp @@ -61,9 +61,9 @@ SetupWindow::SetupWindow() : Window(_("Setup"), false, nullptr, "setup.xml"), ActionListener(), mTabs(), - mModsTab(nullptr), mWindowsToReset(), mButtons(), + mModsTab(nullptr), mResetWindows(nullptr), mPanel(new TabbedArea(this)), mVersion(new Label(this, FULL_VERSION)) diff --git a/src/gui/windows/setupwindow.h b/src/gui/windows/setupwindow.h index 38b3eb206..e604bf0de 100644 --- a/src/gui/windows/setupwindow.h +++ b/src/gui/windows/setupwindow.h @@ -77,9 +77,9 @@ class SetupWindow final : public Window, void unloadModTab(); std::list<SetupTab*> mTabs; - SetupTab *mModsTab; std::list<Window*> mWindowsToReset; std::vector<Button*> mButtons; + SetupTab *mModsTab; Button *mResetWindows; TabbedArea *mPanel; Label *mVersion; diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index e21fa914c..923511baa 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -78,6 +78,7 @@ ShopWindow::ShopWindow(): mCloseButton(new Button(this, _("Close"), "close", this)), mBuyShopItems(new ShopItems), mSellShopItems(new ShopItems), + mTradeItem(nullptr), mBuyShopItemList(new ShopListBox(this, mBuyShopItems, mBuyShopItems)), mSellShopItemList(new ShopListBox(this, mSellShopItems, mSellShopItems)), mBuyScrollArea(new ScrollArea(this, mBuyShopItemList, @@ -106,14 +107,13 @@ ShopWindow::ShopWindow(): // TRANSLATORS: shop window checkbox mAnnounceLinks(new CheckBox(this, _("Show links in announce"), false, this, "link announce")), + mAcceptPlayer(""), + mTradeNick(""), mSelectedItem(-1), mAnnonceTime(0), mLastRequestTimeList(0), mLastRequestTimeItem(0), mRandCounter(0), - mAcceptPlayer(""), - mTradeItem(nullptr), - mTradeNick(""), mTradeMoney(0) { mBuyShopItemList->postInit(); diff --git a/src/gui/windows/shopwindow.h b/src/gui/windows/shopwindow.h index 76971364b..5b5a8309b 100644 --- a/src/gui/windows/shopwindow.h +++ b/src/gui/windows/shopwindow.h @@ -147,6 +147,7 @@ class ShopWindow final : public Window, ShopItems *mBuyShopItems; ShopItems *mSellShopItems; + ShopItem *mTradeItem; ShopListBox *mBuyShopItemList; ShopListBox *mSellShopItemList; @@ -163,15 +164,13 @@ class ShopWindow final : public Window, Button *mSellAnnounceButton; Button *mSellAuctionButton; CheckBox *mAnnounceLinks; - + std::string mAcceptPlayer; + std::string mTradeNick; int mSelectedItem; int mAnnonceTime; int mLastRequestTimeList; int mLastRequestTimeItem; int mRandCounter; - std::string mAcceptPlayer; - ShopItem *mTradeItem; - std::string mTradeNick; int mTradeMoney; int mAnnounceCounter[2]; }; diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp index 607be4f3b..8e6becca1 100644 --- a/src/gui/windows/socialwindow.cpp +++ b/src/gui/windows/socialwindow.cpp @@ -1255,10 +1255,10 @@ SocialWindow::SocialWindow() : mGuildAcceptDialog(nullptr), mGuildCreateDialog(nullptr), mPartyInviter(), - mPartyAcceptDialog(nullptr), - mPartyCreateDialog(nullptr), mGuilds(), mParties(), + mPartyAcceptDialog(nullptr), + mPartyCreateDialog(nullptr), mAttackFilter(nullptr), mPickupFilter(nullptr), // TRANSLATORS: here P is title for visible players tab in social window diff --git a/src/gui/windows/socialwindow.h b/src/gui/windows/socialwindow.h index 57fbd5be5..f0bfe1fb9 100644 --- a/src/gui/windows/socialwindow.h +++ b/src/gui/windows/socialwindow.h @@ -138,23 +138,21 @@ public: protected: friend class SocialTab; + typedef std::map<Guild*, SocialTab*> GuildMap; + typedef std::map<Party*, SocialTab*> PartyMap; void updateButtons(); int mGuildInvited; ConfirmDialog *mGuildAcceptDialog; TextDialog *mGuildCreateDialog; - std::string mPartyInviter; - ConfirmDialog *mPartyAcceptDialog; - TextDialog *mPartyCreateDialog; - - typedef std::map<Guild*, SocialTab*> GuildMap; GuildMap mGuilds; - - typedef std::map<Party*, SocialTab*> PartyMap; PartyMap mParties; + ConfirmDialog *mPartyAcceptDialog; + TextDialog *mPartyCreateDialog; + SocialTab *mAttackFilter; SocialTab *mPickupFilter; SocialTab *mPlayers; diff --git a/src/gui/windows/textcommandeditor.h b/src/gui/windows/textcommandeditor.h index de7f3b1a4..915ef204c 100644 --- a/src/gui/windows/textcommandeditor.h +++ b/src/gui/windows/textcommandeditor.h @@ -68,18 +68,16 @@ class TextCommandEditor final : public Window, void deleteCommand(); bool mIsMagicCommand; - TextCommand *mCommand; + TextCommand *mCommand; RadioButton *mIsMagic; RadioButton *mIsOther; Label *mSymbolLabel; TextField *mSymbolTextField; Label *mCommandLabel; TextField *mCommandTextField; - Label *mCommentLabel; TextField *mCommentTextField; - TargetTypeModel *mTargetTypeModel; Label *mTypeLabel; DropDown *mTypeDropDown; diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp index 443c38619..f05cf1cac 100644 --- a/src/gui/windows/tradewindow.cpp +++ b/src/gui/windows/tradewindow.cpp @@ -80,13 +80,13 @@ TradeWindow::TradeWindow(): // TRANSLATORS: trade window money change button mMoneyChangeButton(new Button(this, _("Change"), "money", this)), mMoneyField(new TextField(this)), - mStatus(PROPOSING), mAutoAddItem(nullptr), mAutoAddToNick(""), mGotMoney(0), mGotMaxMoney(0), mAutoMoney(0), mAutoAddAmount(0), + mStatus(PROPOSING), mOkOther(false), mOkMe(false) { diff --git a/src/gui/windows/tradewindow.h b/src/gui/windows/tradewindow.h index 9704c1e80..447e99144 100644 --- a/src/gui/windows/tradewindow.h +++ b/src/gui/windows/tradewindow.h @@ -171,13 +171,13 @@ class TradeWindow final : public Window, Button *mMoneyChangeButton; TextField *mMoneyField; - Status mStatus; Item* mAutoAddItem; std::string mAutoAddToNick; int mGotMoney; int mGotMaxMoney; int mAutoMoney; int mAutoAddAmount; + Status mStatus; bool mOkOther; bool mOkMe; }; diff --git a/src/gui/windows/unregisterdialog.h b/src/gui/windows/unregisterdialog.h index 206c05413..207f2fef3 100644 --- a/src/gui/windows/unregisterdialog.h +++ b/src/gui/windows/unregisterdialog.h @@ -61,12 +61,9 @@ class UnRegisterDialog final : public Window, private: LoginData *mLoginData; - TextField *mPasswordField; - Button *mUnRegisterButton; Button *mCancelButton; - WrongDataNoticeListener *mWrongDataNoticeListener; }; diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index 507cdfd16..247ef8707 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -160,7 +160,6 @@ UpdaterWindow::UpdaterWindow(const std::string &restrict updateHost, ActionListener(), KeyListener(), mDownloadProgress(0.0F), - mDownloadStatus(UPDATE_NEWS), mUpdateHost(updateHost), mUpdatesDir(updatesDir), mUpdatesDirReal(updatesDir), @@ -172,6 +171,7 @@ UpdaterWindow::UpdaterWindow(const std::string &restrict updateHost, mDownload(nullptr), mUpdateFiles(), mTempUpdateFiles(), + mUpdateServerPath(mUpdateHost), // TRANSLATORS: updater window label mLabel(new Label(this, _("Connecting..."))), // TRANSLATORS: updater window button @@ -184,7 +184,7 @@ UpdaterWindow::UpdaterWindow(const std::string &restrict updateHost, "browserbox.xml")), mScrollArea(new ScrollArea(this, mBrowserBox, true, "update_background.xml")), - mUpdateServerPath(mUpdateHost), + mDownloadStatus(UPDATE_NEWS), mDownloadedBytes(0), mUpdateIndex(0), mUpdateIndexOffset(0), diff --git a/src/gui/windows/updaterwindow.h b/src/gui/windows/updaterwindow.h index 638f88faf..39e1e84f3 100644 --- a/src/gui/windows/updaterwindow.h +++ b/src/gui/windows/updaterwindow.h @@ -201,9 +201,6 @@ private: /** The new progress value to be set in the logic method. */ float mDownloadProgress; - /** Status of the current download. */ - UpdateDownloadStatus mDownloadStatus; - /** Host where we get the updated files. */ std::string mUpdateHost; @@ -237,13 +234,17 @@ private: /** List of temp files to download. */ std::vector<UpdateFile> mTempUpdateFiles; + std::string mUpdateServerPath; + Label *mLabel; /**< Progress bar caption. */ Button *mCancelButton; /**< Button to stop the update process. */ Button *mPlayButton; /**< Button to start playing. */ ProgressBar *mProgressBar; /**< Update progress bar. */ BrowserBox *mBrowserBox; /**< Box to display news. */ ScrollArea *mScrollArea; /**< Used to scroll news box. */ - std::string mUpdateServerPath; + + /** Status of the current download. */ + UpdateDownloadStatus mDownloadStatus; /** Byte count currently downloaded in mMemoryBuffer. */ int mDownloadedBytes; diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index 2052aeab3..a1683ffc8 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -79,16 +79,13 @@ class NameFunctuator final WhoIsOnline::WhoIsOnline() : // TRANSLATORS: who is online window name Window(_("Who Is Online - Updating"), false, nullptr, "whoisonline.xml"), + mUpdateTimer(0), mThread(nullptr), - mDownloadStatus(UPDATE_LIST), - mDownloadComplete(true), - mDownloadedBytes(0), mMemoryBuffer(nullptr), mCurlError(new char[CURL_ERROR_SIZE]), mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, true, "onlinebrowserbox.xml")), mScrollArea(new ScrollArea(this, mBrowserBox, false)), - mUpdateTimer(0), mOnlinePlayers(), mOnlineNicks(), // TRANSLATORS: who is online. button. @@ -97,6 +94,9 @@ WhoIsOnline::WhoIsOnline() : mNeutral(), mDisregard(), mEnemy(), + mDownloadedBytes(0), + mDownloadStatus(UPDATE_LIST), + mDownloadComplete(true), mAllowUpdate(true), mShowLevel(false), mUpdateOnlineList(config.getBoolValue("updateOnlineList")), diff --git a/src/gui/windows/whoisonline.h b/src/gui/windows/whoisonline.h index 271bf6ffd..915150409 100644 --- a/src/gui/windows/whoisonline.h +++ b/src/gui/windows/whoisonline.h @@ -189,18 +189,11 @@ private: UPDATE_LIST }; + time_t mUpdateTimer; + /** A thread that use libcurl to download updates. */ SDL_Thread *mThread; - /** Status of the current download. */ - DownloadStatus mDownloadStatus; - - /** Flag that show if current download is complete. */ - bool mDownloadComplete; - - /** Byte count currently downloaded in mMemoryBuffer. */ - int mDownloadedBytes; - /** Buffer for files downloaded to memory. */ char *mMemoryBuffer; @@ -209,7 +202,6 @@ private: BrowserBox *mBrowserBox; ScrollArea *mScrollArea; - time_t mUpdateTimer; std::set<OnlinePlayer*> mOnlinePlayers; std::set<std::string> mOnlineNicks; @@ -218,6 +210,15 @@ private: std::vector<OnlinePlayer*> mNeutral; std::vector<OnlinePlayer*> mDisregard; std::vector<OnlinePlayer*> mEnemy; + + /** Byte count currently downloaded in mMemoryBuffer. */ + int mDownloadedBytes; + + /** Status of the current download. */ + DownloadStatus mDownloadStatus; + + /** Flag that show if current download is complete. */ + bool mDownloadComplete; bool mAllowUpdate; bool mShowLevel; bool mUpdateOnlineList; |