diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-22 02:34:48 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-22 21:22:21 +0300 |
commit | 4a5cdfe19cbb50e3b58149c6e91312366ee4b771 (patch) | |
tree | 7a2bbae95b5f6642731f2a1257913baad71d028d | |
parent | 3dcf21babe03cee5080a25e787e1d7e72124288e (diff) | |
download | mv-4a5cdfe19cbb50e3b58149c6e91312366ee4b771.tar.gz mv-4a5cdfe19cbb50e3b58149c6e91312366ee4b771.tar.bz2 mv-4a5cdfe19cbb50e3b58149c6e91312366ee4b771.tar.xz mv-4a5cdfe19cbb50e3b58149c6e91312366ee4b771.zip |
Add override keyword to most overriden methods.
161 files changed, 610 insertions, 597 deletions
diff --git a/src/actor.h b/src/actor.h index ec9b44ce3..6a1a18e95 100644 --- a/src/actor.h +++ b/src/actor.h @@ -120,7 +120,7 @@ public: */ virtual void setAlpha(float alpha) = 0; - void setMap(Map *const map); + virtual void setMap(Map *const map); const Map* getMap() const { return mMap; } diff --git a/src/actorsprite.h b/src/actorsprite.h index 2424983b2..bb48db7df 100644 --- a/src/actorsprite.h +++ b/src/actorsprite.h @@ -82,7 +82,7 @@ public: virtual Type getType() const { return UNKNOWN; } - virtual bool draw(Graphics *graphics, int offsetX, int offsetY) const; + virtual bool draw(Graphics *graphics, int offsetX, int offsetY) const override; virtual bool drawSpriteAt(Graphics *const graphics, const int x, const int y) const; @@ -91,7 +91,7 @@ public: static void actorLogic(); - void setMap(Map *const map); + void setMap(Map *const map) override; /** * Gets the way the object blocks pathfinding for other objects @@ -157,16 +157,16 @@ public: */ void setStatusEffectBlock(const int offset, const uint16_t flags); - virtual void setAlpha(const float alpha) + virtual void setAlpha(const float alpha) override { CompoundSprite::setAlpha(alpha); } - virtual float getAlpha() const + virtual float getAlpha() const override { return CompoundSprite::getAlpha(); } - virtual int getWidth() const + virtual int getWidth() const override { return CompoundSprite::getWidth(); } - virtual int getHeight() const + virtual int getHeight() const override { return CompoundSprite::getHeight(); } static void load(); diff --git a/src/actorspritemanager.h b/src/actorspritemanager.h index 9a3c0db70..3c134406a 100644 --- a/src/actorspritemanager.h +++ b/src/actorspritemanager.h @@ -229,7 +229,7 @@ class ActorSpriteManager final: public ConfigListener bool pickUpNearest(const int x, const int y, int maxdist); - void optionChanged(const std::string &name); + void optionChanged(const std::string &name) override; void removeAttackMob(const std::string &name); diff --git a/src/animatedsprite.h b/src/animatedsprite.h index f5956cfd2..38fc73214 100644 --- a/src/animatedsprite.h +++ b/src/animatedsprite.h @@ -84,9 +84,9 @@ class AnimatedSprite final : public Sprite unsigned int getFrameCount() const; - virtual void setAlpha(float alpha); + virtual void setAlpha(float alpha) override; - virtual void *getHash(); + virtual void *getHash() override; bool updateNumber(const unsigned num); diff --git a/src/animationparticle.h b/src/animationparticle.h index d6cd42b74..8fd55f38b 100644 --- a/src/animationparticle.h +++ b/src/animationparticle.h @@ -41,7 +41,7 @@ class AnimationParticle final : public ImageParticle ~AnimationParticle(); - virtual bool update(); + virtual bool update() override; private: SimpleAnimation *mAnimation; /**< Used animation for this particle */ diff --git a/src/being.h b/src/being.h index 95e2ab196..c1a9d8dbd 100644 --- a/src/being.h +++ b/src/being.h @@ -400,7 +400,7 @@ class Being : public ActorSprite, public ConfigListener /** * Performs being logic. */ - virtual void logic(); + virtual void logic() override; /** * Draws the speech text above the being. @@ -544,13 +544,13 @@ class Being : public ActorSprite, public ConfigListener /** * Returns the horizontal size of the current base sprite of the being. */ - virtual int getWidth() const + virtual int getWidth() const override { return std::max(CompoundSprite::getWidth(), DEFAULT_BEING_WIDTH); } /** * Returns the vertical size of the current base sprite of the being. */ - virtual int getHeight() const + virtual int getHeight() const override { return std::max(CompoundSprite::getHeight(), DEFAULT_BEING_HEIGHT); } /** @@ -593,10 +593,10 @@ class Being : public ActorSprite, public ConfigListener int getEmotion() const { return mEmotion; } - virtual void drawSprites(Graphics* graphics, int posX, int posY) const; + virtual void drawSprites(Graphics* graphics, int posX, int posY) const override; virtual void drawSpritesSDL(Graphics* graphics, - int posX, int posY) const; + int posX, int posY) const override; void drawHpBar(Graphics *const graphics, const int x, const int y, const int maxHP, const int hp, const int damage, @@ -605,7 +605,7 @@ class Being : public ActorSprite, public ConfigListener static void load(); - virtual void optionChanged(const std::string &value); + virtual void optionChanged(const std::string &value) override; void flashName(const int time); diff --git a/src/client.h b/src/client.h index 3e1755859..76a98d554 100644 --- a/src/client.h +++ b/src/client.h @@ -64,7 +64,7 @@ extern int textures_count; class ErrorListener : public gcn::ActionListener { public: - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; }; extern std::string errorMessage; @@ -290,9 +290,9 @@ public: static void applyKeyRepeat(); - void optionChanged(const std::string &name); + void optionChanged(const std::string &name) override; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; void initTradeFilter() const; diff --git a/src/compoundsprite.h b/src/compoundsprite.h index 4db2adbfb..b18b9a3ae 100644 --- a/src/compoundsprite.h +++ b/src/compoundsprite.h @@ -54,33 +54,33 @@ public: ~CompoundSprite(); - virtual bool reset(); + virtual bool reset() override; - virtual bool play(std::string action); + virtual bool play(std::string action) override; - virtual bool update(int time); + virtual bool update(int time) override; - virtual bool draw(Graphics *graphics, int posX, int posY) const; + virtual bool draw(Graphics *graphics, int posX, int posY) const override; /** * Gets the width in pixels of the first sprite in the list. */ - virtual int getWidth() const; + virtual int getWidth() const override; /** * Gets the height in pixels of the first sprite in the list. */ - virtual int getHeight() const; + virtual int getHeight() const override; - virtual const Image *getImage() const; + virtual const Image *getImage() const override; - virtual bool setSpriteDirection(const SpriteDirection direction); + virtual bool setSpriteDirection(const SpriteDirection direction) override; int getNumberOfLayers() const; - unsigned int getCurrentFrame() const; + unsigned int getCurrentFrame() const override; - unsigned int getFrameCount() const; + unsigned int getFrameCount() const override; size_t size() const { return mSprites.size(); } @@ -117,9 +117,9 @@ public: */ virtual unsigned int getFrameCount(unsigned int layer); - virtual void setAlpha(float alpha); + virtual void setAlpha(float alpha) override; - bool updateNumber(const unsigned num); + bool updateNumber(const unsigned num) override; static void setEnableDelay(bool b) { mEnableDelay = b; } diff --git a/src/flooritem.h b/src/flooritem.h index a478c623b..59786a8e0 100644 --- a/src/flooritem.h +++ b/src/flooritem.h @@ -50,10 +50,10 @@ class FloorItem final : public ActorSprite Map *const map, const int amount, const unsigned char color, int subX, int subY); - Type getType() const + Type getType() const override { return FLOOR_ITEM; } - bool draw(Graphics *graphics, int offsetX, int offsetY) const; + bool draw(Graphics *graphics, int offsetX, int offsetY) const override; /** * Returns the item ID. @@ -69,10 +69,10 @@ class FloorItem final : public ActorSprite std::string getName() const; - virtual int getTileX() const + virtual int getTileX() const override { return mX; } - virtual int getTileY() const + virtual int getTileY() const override { return mY; } void incrementPickup() diff --git a/src/game.h b/src/game.h index e88fb60fa..5bada817a 100644 --- a/src/game.h +++ b/src/game.h @@ -37,7 +37,7 @@ extern volatile int cur_time; class Map; class WindowMenu; -struct LastKey +struct LastKey final { int key; int time; diff --git a/src/graphics.h b/src/graphics.h index d0d2dcba9..cdfc092fe 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -234,7 +234,7 @@ class Graphics : public gcn::SDLGraphics BlitMode getBlitMode() const { return mBlitMode; } - void fillRectangle(const gcn::Rectangle& rectangle); + void fillRectangle(const gcn::Rectangle& rectangle) override; /** * Updates the screen. This is done by either copying the buffer to the diff --git a/src/gui/botcheckerwindow.h b/src/gui/botcheckerwindow.h index 5e6641161..b4159f9fb 100644 --- a/src/gui/botcheckerwindow.h +++ b/src/gui/botcheckerwindow.h @@ -64,7 +64,7 @@ class BotCheckerWindow final : public Window, */ ~BotCheckerWindow(); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; void update(); @@ -74,7 +74,7 @@ class BotCheckerWindow final : public Window, void reset(); - void optionChanged(const std::string &name); + void optionChanged(const std::string &name) override; private: UsersTableModel *mTableModel; diff --git a/src/gui/buydialog.h b/src/gui/buydialog.h index 91badb30d..95e232acd 100644 --- a/src/gui/buydialog.h +++ b/src/gui/buydialog.h @@ -88,7 +88,7 @@ class BuyDialog final : public Window, public gcn::ActionListener, /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Returns the number of items in the shop inventory. @@ -98,12 +98,7 @@ class BuyDialog final : public Window, public gcn::ActionListener, /** * Updates the labels according to the selected item. */ - void valueChanged(const gcn::SelectionEvent &event); - - /** - * Returns the name of item number i in the shop inventory. - */ - std::string getElementAt(int i); + void valueChanged(const gcn::SelectionEvent &event) override; /** * Updates the state of buttons and labels. diff --git a/src/gui/buyselldialog.h b/src/gui/buyselldialog.h index d6fc3daa1..298c292c2 100644 --- a/src/gui/buyselldialog.h +++ b/src/gui/buyselldialog.h @@ -59,7 +59,7 @@ class BuySellDialog final : public Window, public gcn::ActionListener /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Returns true if any instances exist. diff --git a/src/gui/changeemaildialog.h b/src/gui/changeemaildialog.h index 0db1d52df..2110fbed7 100644 --- a/src/gui/changeemaildialog.h +++ b/src/gui/changeemaildialog.h @@ -60,7 +60,7 @@ class ChangeEmailDialog final : public Window, public gcn::ActionListener /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * This is used to pass the pointer to where the new email should be diff --git a/src/gui/changepassworddialog.h b/src/gui/changepassworddialog.h index 348311e48..aeece4d33 100644 --- a/src/gui/changepassworddialog.h +++ b/src/gui/changepassworddialog.h @@ -60,7 +60,7 @@ class ChangePasswordDialog final : public Window, public gcn::ActionListener /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; private: gcn::TextField *mOldPassField; diff --git a/src/gui/charcreatedialog.h b/src/gui/charcreatedialog.h index 6e087d9a7..beedd7a5e 100644 --- a/src/gui/charcreatedialog.h +++ b/src/gui/charcreatedialog.h @@ -61,7 +61,7 @@ class CharCreateDialog final : public Window, */ ~CharCreateDialog(); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Unlocks the dialog, enabling the create character button again. @@ -75,11 +75,11 @@ class CharCreateDialog final : public Window, void setFixedGender(const bool fixed, const Gender gender = GENDER_FEMALE); - void logic(); + void logic() override; void updatePlayer(); - void keyPressed(gcn::KeyEvent &keyEvent); + void keyPressed(gcn::KeyEvent &keyEvent) override; private: int getDistributedPoints() const; diff --git a/src/gui/charselectdialog.h b/src/gui/charselectdialog.h index a76507f98..7f0ebfb2f 100644 --- a/src/gui/charselectdialog.h +++ b/src/gui/charselectdialog.h @@ -70,9 +70,9 @@ class CharSelectDialog final : public Window, ~CharSelectDialog(); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void keyPressed(gcn::KeyEvent &keyEvent); + void keyPressed(gcn::KeyEvent &keyEvent) override; enum SelectAction { diff --git a/src/gui/chatwindow.h b/src/gui/chatwindow.h index db3d496c3..012666d97 100644 --- a/src/gui/chatwindow.h +++ b/src/gui/chatwindow.h @@ -144,7 +144,7 @@ class ChatWindow final : public Window, /** * Performs action. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Request focus for typing chat message. @@ -174,7 +174,7 @@ class ChatWindow final : public Window, void localChatInput(const std::string &msg); /** Called when key is pressed */ - void keyPressed(gcn::KeyEvent &event); + void keyPressed(gcn::KeyEvent &event) override; /** Set the chat input as the given text. */ void setInputText(const std::string &text); @@ -191,14 +191,15 @@ class ChatWindow final : public Window, /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event); + void mouseDragged(gcn::MouseEvent &event) override; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; - void processEvent(Channels channel, const DepricatedEvent &event); + void processEvent(Channels channel, + const DepricatedEvent &event) override; /** * Scrolls the chat window @@ -271,21 +272,21 @@ class ChatWindow final : public Window, void copyToClipboard(const int x, const int y) const; - void optionChanged(const std::string &name); + void optionChanged(const std::string &name) override; - void mouseEntered(gcn::MouseEvent& mouseEvent); + void mouseEntered(gcn::MouseEvent& mouseEvent) override; - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; - void mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED); + void mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED) override; - void draw(gcn::Graphics* graphics); + void draw(gcn::Graphics* graphics) override; void updateVisibility(); void unHideWindow(); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; protected: friend class ChatTab; diff --git a/src/gui/confirmdialog.h b/src/gui/confirmdialog.h index f87b61282..fc5e77889 100644 --- a/src/gui/confirmdialog.h +++ b/src/gui/confirmdialog.h @@ -51,7 +51,7 @@ class ConfirmDialog : public Window, public gcn::ActionListener /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; private: TextBox *mTextBox; diff --git a/src/gui/connectiondialog.h b/src/gui/connectiondialog.h index 56923bb7d..eb528868d 100644 --- a/src/gui/connectiondialog.h +++ b/src/gui/connectiondialog.h @@ -51,9 +51,9 @@ class ConnectionDialog final : public Window, private gcn::ActionListener * Called when the user presses Cancel. Restores the global state to * the previous one. */ - void action(const gcn::ActionEvent &); + void action(const gcn::ActionEvent &) override; - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; private: State mCancelState; diff --git a/src/gui/debugwindow.h b/src/gui/debugwindow.h index 4eca9ffae..95c2dd468 100644 --- a/src/gui/debugwindow.h +++ b/src/gui/debugwindow.h @@ -41,7 +41,7 @@ class DebugTab : public Container Container() { } - void logic() = 0; + void logic() override = 0; void resize(const int x, const int y) { setDimension(gcn::Rectangle(0, 0, x, y)); } @@ -56,7 +56,7 @@ class MapDebugTab final : public DebugTab public: MapDebugTab(); - void logic(); + void logic() override; private: Label *mMusicFileLabel; @@ -80,7 +80,7 @@ class TargetDebugTab final : public DebugTab public: TargetDebugTab(); - void logic(); + void logic() override; private: Label *mTargetLabel; @@ -102,7 +102,7 @@ class NetDebugTab final : public DebugTab public: NetDebugTab(); - void logic(); + void logic() override; private: Label *mPingLabel; @@ -130,11 +130,11 @@ class DebugWindow final : public Window */ void slowLogic(); - void draw(gcn::Graphics *g); + void draw(gcn::Graphics *g) override; void setPing(int pingTime); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; private: TabbedArea *mTabs; diff --git a/src/gui/didyouknowwindow.h b/src/gui/didyouknowwindow.h index 737203298..b0850bf64 100644 --- a/src/gui/didyouknowwindow.h +++ b/src/gui/didyouknowwindow.h @@ -54,12 +54,13 @@ class DidYouKnowWindow final : public Window, /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Handles link action. */ - void handleLink(const std::string &link, gcn::MouseEvent *event); + void handleLink(const std::string &link, + gcn::MouseEvent *event) override; void loadData(int num = 0); diff --git a/src/gui/editdialog.h b/src/gui/editdialog.h index 94e7aabbf..20c88db19 100644 --- a/src/gui/editdialog.h +++ b/src/gui/editdialog.h @@ -54,7 +54,7 @@ class EditDialog final : public Window, public gcn::ActionListener /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; std::string getMsg() const { return mTextField->getText(); } diff --git a/src/gui/editserverdialog.h b/src/gui/editserverdialog.h index 63631ffef..758a2fbf4 100644 --- a/src/gui/editserverdialog.h +++ b/src/gui/editserverdialog.h @@ -50,7 +50,7 @@ class TypeListModel : public gcn::ListModel /** * Used to get number of line in the list */ - int getNumberOfElements() + int getNumberOfElements() override #ifdef EATHENA_SUPPORT #ifdef MANASERV_SUPPORT { return 4; } @@ -68,7 +68,7 @@ class TypeListModel : public gcn::ListModel /** * Used to get an element from the list */ - std::string getElementAt(int elementIndex); + std::string getElementAt(int elementIndex) override; }; /** @@ -89,11 +89,11 @@ class EditServerDialog final : public Window, /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void keyPressed(gcn::KeyEvent &keyEvent); + void keyPressed(gcn::KeyEvent &keyEvent) override; - void logic(); + void logic() override; private: TextField *mServerAddressField; diff --git a/src/gui/equipmentwindow.h b/src/gui/equipmentwindow.h index ba94006c9..55e13a180 100644 --- a/src/gui/equipmentwindow.h +++ b/src/gui/equipmentwindow.h @@ -82,11 +82,11 @@ class EquipmentWindow final : public Window, public gcn::ActionListener /** * Draws the equipment window. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void mousePressed(gcn::MouseEvent& mouseEvent); + void mousePressed(gcn::MouseEvent& mouseEvent) override; Item* getEquipment(int i) const { return mEquipment ? mEquipment->getEquipment(i) : nullptr; } @@ -97,9 +97,9 @@ class EquipmentWindow final : public Window, public gcn::ActionListener void resetBeing(const Being *const being); - void mouseExited(gcn::MouseEvent &event); + void mouseExited(gcn::MouseEvent &event) override; - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; private: Item *getItem(const int x, const int y) const; diff --git a/src/gui/focushandler.h b/src/gui/focushandler.h index a2c565ff6..f5aa3e8fb 100644 --- a/src/gui/focushandler.h +++ b/src/gui/focushandler.h @@ -42,14 +42,14 @@ class FocusHandler final : public gcn::FocusHandler * then that widget loses modal focus and will regain it after this * widget releases his modal focus. */ - void requestModalFocus(gcn::Widget *widget); + void requestModalFocus(gcn::Widget *widget) override; /** * Releases modal focus of a widget. When this widget had modal focus * and there are other widgets that had also requested modal focus, * then modal focus will be transfered to the last of those. */ - void releaseModalFocus(gcn::Widget *widget); + void releaseModalFocus(gcn::Widget *widget) override; /** * Removes a widget from the focus handler. Also makes sure no dangling diff --git a/src/gui/helpwindow.h b/src/gui/helpwindow.h index 677079964..1a3d0a6d7 100644 --- a/src/gui/helpwindow.h +++ b/src/gui/helpwindow.h @@ -60,13 +60,13 @@ class HelpWindow final : public Window, public LinkHandler, /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Handles link action. */ void handleLink(const std::string &link, - gcn::MouseEvent *event A_UNUSED); + gcn::MouseEvent *event A_UNUSED) override; /** * Loads help in the dialog. diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h index f06ee487e..75a5df7ec 100644 --- a/src/gui/inventorywindow.h +++ b/src/gui/inventorywindow.h @@ -76,7 +76,7 @@ class InventoryWindow final : public Window, /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Returns the selected item. @@ -91,27 +91,27 @@ class InventoryWindow final : public Window, /** * Handles closing of the window */ - void widgetHidden(const gcn::Event &event); + void widgetHidden(const gcn::Event &event) override; /** * Handles the mouse clicks. */ - void mouseClicked(gcn::MouseEvent &event); + void mouseClicked(gcn::MouseEvent &event) override; /** * Handles the key presses. */ - void keyPressed(gcn::KeyEvent &event); + void keyPressed(gcn::KeyEvent &event) override; /** * Handles the key releases. */ - void keyReleased(gcn::KeyEvent &event); + void keyReleased(gcn::KeyEvent &event) override; /** * Updates labels to currently selected item. */ - void valueChanged(const gcn::SelectionEvent &event); + void valueChanged(const gcn::SelectionEvent &event) override; /** * Sets whether the split button should be shown. @@ -137,13 +137,14 @@ class InventoryWindow final : public Window, void updateDropButton(); - void processEvent(Channels channel, const DepricatedEvent &event); + void processEvent(Channels channel, + const DepricatedEvent &event) override; void updateButtons(const Item *item = nullptr); bool isInputFocused() const; - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; static bool isAnyInputFocused(); diff --git a/src/gui/itemamountwindow.h b/src/gui/itemamountwindow.h index fd3ef3ab0..bf8b734fe 100644 --- a/src/gui/itemamountwindow.h +++ b/src/gui/itemamountwindow.h @@ -65,7 +65,7 @@ class ItemAmountWindow final : public Window, /** * Called when receiving actions from widget. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Sets default amount value. @@ -73,15 +73,16 @@ class ItemAmountWindow final : public Window, void resetAmount(); // MouseListener - void mouseMoved(gcn::MouseEvent &event); - void mouseExited(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; + + void mouseExited(gcn::MouseEvent &event) override; /** * Schedules the Item Amount window for deletion. */ void close(); - void keyReleased(gcn::KeyEvent &keyEvent); + void keyReleased(gcn::KeyEvent &keyEvent) override; /** * Creates the dialog, or bypass it if there aren't enough items. diff --git a/src/gui/itempopup.h b/src/gui/itempopup.h index 0bdfcfeb5..47fd8a09f 100644 --- a/src/gui/itempopup.h +++ b/src/gui/itempopup.h @@ -65,7 +65,7 @@ class ItemPopup final : public Popup void setItem(const Item *const item, const bool showImage = false); - void mouseMoved(gcn::MouseEvent &mouseEvent); + void mouseMoved(gcn::MouseEvent &mouseEvent) override; private: gcn::Label *mItemName; diff --git a/src/gui/killstats.h b/src/gui/killstats.h index 1db3a4943..6ae4a6575 100644 --- a/src/gui/killstats.h +++ b/src/gui/killstats.h @@ -55,7 +55,7 @@ class KillStats final : public Window, /** * Stuff. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; void gainXp(int Xp); @@ -67,7 +67,7 @@ class KillStats final : public Window, /** * Draw this window */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Updates this dialog @@ -84,7 +84,7 @@ class KillStats final : public Window, void jackoAlive(const int id); void processEvent(Channels channel A_UNUSED, - const DepricatedEvent &event); + const DepricatedEvent &event) override; void resetTimes(); diff --git a/src/gui/logindialog.h b/src/gui/logindialog.h index 9b6ace887..b75c17836 100644 --- a/src/gui/logindialog.h +++ b/src/gui/logindialog.h @@ -67,12 +67,12 @@ class LoginDialog final : public Window, public gcn::ActionListener, /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Called when a key is pressed in one of the text fields. */ - void keyPressed(gcn::KeyEvent &keyEvent); + void keyPressed(gcn::KeyEvent &keyEvent) override; static std::string savedPasswordKey; static std::string savedPassword; diff --git a/src/gui/minimap.h b/src/gui/minimap.h index 95b29ad89..5dffbb788 100644 --- a/src/gui/minimap.h +++ b/src/gui/minimap.h @@ -57,13 +57,13 @@ class Minimap final : public Window /** * Draws the minimap. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; - void mouseReleased(gcn::MouseEvent &event); + void mouseReleased(gcn::MouseEvent &event) override; - void mouseExited(gcn::MouseEvent &event); + void mouseExited(gcn::MouseEvent &event) override; void screenToMap(int &x, int &y); diff --git a/src/gui/ministatuswindow.h b/src/gui/ministatuswindow.h index bfb14c2b8..58eabcf56 100644 --- a/src/gui/ministatuswindow.h +++ b/src/gui/ministatuswindow.h @@ -59,19 +59,20 @@ class MiniStatusWindow final : public Popup, void drawIcons(Graphics *const graphics); - void processEvent(Channels channel, const DepricatedEvent &event); + void processEvent(Channels channel, + const DepricatedEvent &event) override; void updateStatus(); - void logic(); // Updates icons + void logic() override; // Updates icons - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; - void mouseMoved(gcn::MouseEvent &mouseEvent); + void mouseMoved(gcn::MouseEvent &mouseEvent) override; - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; - void mouseExited(gcn::MouseEvent &event); + void mouseExited(gcn::MouseEvent &event) override; void showBar(const std::string &name, const bool visible); diff --git a/src/gui/npcdialog.h b/src/gui/npcdialog.h index 6437311b4..86b6bdabd 100644 --- a/src/gui/npcdialog.h +++ b/src/gui/npcdialog.h @@ -71,7 +71,7 @@ class NpcDialog final : public Window, public gcn::ActionListener, /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Sets the text shows in the dialog. @@ -112,17 +112,17 @@ class NpcDialog final : public Window, public gcn::ActionListener, /** * Returns the number of items in the choices list. */ - int getNumberOfElements(); + int getNumberOfElements() override; /** * Returns the name of item number i of the choices list. */ - std::string getElementAt(int i); + std::string getElementAt(int i) override; /** * Returns the image of item number i of the choices list. */ - const Image *getImageAt(int i); + const Image *getImageAt(int i) override; /** * Makes this dialog request a choice selection from the user. @@ -162,7 +162,7 @@ class NpcDialog final : public Window, public gcn::ActionListener, void setVisible(bool visible); - void optionChanged(const std::string &name); + void optionChanged(const std::string &name) override; /** * Returns true if any instances exist. @@ -198,7 +198,7 @@ class NpcDialog final : public Window, public gcn::ActionListener, void setAvatarAction(const int actionId); - void logic(); + void logic() override; void clearRows(); diff --git a/src/gui/npcpostdialog.h b/src/gui/npcpostdialog.h index 96b51fb47..a13a25d2f 100644 --- a/src/gui/npcpostdialog.h +++ b/src/gui/npcpostdialog.h @@ -43,7 +43,7 @@ public: /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; void setVisible(bool visible); diff --git a/src/gui/okdialog.h b/src/gui/okdialog.h index 2d2fefee4..4ef32e4e2 100644 --- a/src/gui/okdialog.h +++ b/src/gui/okdialog.h @@ -58,7 +58,7 @@ class OkDialog final : public Window, public gcn::ActionListener /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; private: TextBox *mTextBox; diff --git a/src/gui/outfitwindow.h b/src/gui/outfitwindow.h index a72bf332a..da0dedb59 100644 --- a/src/gui/outfitwindow.h +++ b/src/gui/outfitwindow.h @@ -55,15 +55,15 @@ class OutfitWindow final : public Window, private gcn::ActionListener */ ~OutfitWindow(); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; - void mouseDragged(gcn::MouseEvent &event); + void mouseDragged(gcn::MouseEvent &event) override; - void mouseReleased(gcn::MouseEvent &event); + void mouseReleased(gcn::MouseEvent &event) override; void load(const bool oldConfig = false); diff --git a/src/gui/popupmenu.h b/src/gui/popupmenu.h index 3ce363a34..b797138be 100644 --- a/src/gui/popupmenu.h +++ b/src/gui/popupmenu.h @@ -50,7 +50,7 @@ class RenameListener final : public gcn::ActionListener public: RenameListener(); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; void setMapItem(MapItem* mapItem) { mMapItem = mapItem; } @@ -68,7 +68,7 @@ class PlayerListener : public gcn::ActionListener public: PlayerListener(); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; void setNick(std::string name) { mNick = name; } @@ -163,7 +163,7 @@ class PopupMenu final : public Popup, public LinkHandler * Handles link action. */ void handleLink(const std::string &link, - gcn::MouseEvent *event A_UNUSED); + gcn::MouseEvent *event A_UNUSED) override; private: void addPlayerRelation(std::string name); diff --git a/src/gui/questswindow.h b/src/gui/questswindow.h index 017dd43c3..43a3e9758 100644 --- a/src/gui/questswindow.h +++ b/src/gui/questswindow.h @@ -56,7 +56,7 @@ class QuestsWindow final : public Window, public gcn::ActionListener /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; void updateQuest(const int var, const int val); diff --git a/src/gui/quitdialog.h b/src/gui/quitdialog.h index 4c26ee90e..965e50226 100644 --- a/src/gui/quitdialog.h +++ b/src/gui/quitdialog.h @@ -60,9 +60,9 @@ class QuitDialog final : public Window, public gcn::ActionListener, /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void keyPressed(gcn::KeyEvent &keyEvent); + void keyPressed(gcn::KeyEvent &keyEvent) override; private: void placeOption(ContainerPlacer &placer, diff --git a/src/gui/registerdialog.h b/src/gui/registerdialog.h index 6117da102..bc73e3a8d 100644 --- a/src/gui/registerdialog.h +++ b/src/gui/registerdialog.h @@ -50,7 +50,7 @@ class WrongDataNoticeListener final : public gcn::ActionListener public: WrongDataNoticeListener(); void setTarget(gcn::TextField *const textField); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; private: gcn::TextField *mTarget; }; @@ -80,12 +80,12 @@ class RegisterDialog final : public Window, public gcn::ActionListener, /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Called when a key is pressed in one of the text fields. */ - void keyPressed(gcn::KeyEvent &keyEvent); + void keyPressed(gcn::KeyEvent &keyEvent) override; private: /** diff --git a/src/gui/selldialog.h b/src/gui/selldialog.h index 1fe5e234f..2315a3400 100644 --- a/src/gui/selldialog.h +++ b/src/gui/selldialog.h @@ -84,14 +84,14 @@ class SellDialog final : public Window, /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Updates labels according to selected item. * * @see SelectionListener::selectionChanged */ - void valueChanged(const gcn::SelectionEvent &event); + void valueChanged(const gcn::SelectionEvent &event) override; /** * Gives Player's Money amount diff --git a/src/gui/serverdialog.h b/src/gui/serverdialog.h index 1c6e850cb..c5f7d26e8 100644 --- a/src/gui/serverdialog.h +++ b/src/gui/serverdialog.h @@ -61,12 +61,12 @@ class ServersListModel final : public gcn::ListModel /** * Used to get number of line in the list */ - int getNumberOfElements(); + int getNumberOfElements() override; /** * Used to get an element from the list */ - std::string getElementAt(int elementIndex); + std::string getElementAt(int elementIndex) override; /** * Used to get the corresponding Server struct @@ -111,18 +111,18 @@ class ServerDialog : public Window, /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void keyPressed(gcn::KeyEvent &keyEvent); + void keyPressed(gcn::KeyEvent &keyEvent) override; /** * Called when the selected value changed in the servers list box. */ - void valueChanged(const gcn::SelectionEvent &event); + void valueChanged(const gcn::SelectionEvent &event) override; - void mouseClicked(gcn::MouseEvent &mouseEvent); + void mouseClicked(gcn::MouseEvent &mouseEvent) override; - void logic(); + void logic() override; void updateServer(ServerInfo server, const int index); diff --git a/src/gui/setup.h b/src/gui/setup.h index 5687e8c7e..a33188369 100644 --- a/src/gui/setup.h +++ b/src/gui/setup.h @@ -55,7 +55,7 @@ class Setup final : public Window, public gcn::ActionListener /** * Event handling method. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Enables the reset button when in game. diff --git a/src/gui/setup_colors.h b/src/gui/setup_colors.h index 3f30d8d4c..3f4c3012a 100644 --- a/src/gui/setup_colors.h +++ b/src/gui/setup_colors.h @@ -51,9 +51,9 @@ class Setup_Colors final : public SetupTab, void apply(); void cancel(); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void valueChanged(const gcn::SelectionEvent &event); + void valueChanged(const gcn::SelectionEvent &event) override; private: static const std::string rawmsg; diff --git a/src/gui/setup_input.h b/src/gui/setup_input.h index 2346cc67d..c8d863db5 100644 --- a/src/gui/setup_input.h +++ b/src/gui/setup_input.h @@ -53,7 +53,7 @@ class Setup_Input final : public SetupTab void cancel(); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Get an update on the assigned key. diff --git a/src/gui/setup_joystick.h b/src/gui/setup_joystick.h index 63d9e7880..b470b3cca 100644 --- a/src/gui/setup_joystick.h +++ b/src/gui/setup_joystick.h @@ -48,7 +48,7 @@ class Setup_Joystick final : public SetupTab void cancel(); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; void setTempEnabled(const bool sel); diff --git a/src/gui/setup_relations.h b/src/gui/setup_relations.h index d81a80a60..cc296527e 100644 --- a/src/gui/setup_relations.h +++ b/src/gui/setup_relations.h @@ -55,7 +55,7 @@ public: void reset(); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; virtual void updatedPlayer(const std::string &name); diff --git a/src/gui/setup_theme.h b/src/gui/setup_theme.h index 53f23d267..35b89ea61 100644 --- a/src/gui/setup_theme.h +++ b/src/gui/setup_theme.h @@ -49,7 +49,7 @@ class Setup_Theme final : public SetupTab void apply(); void cancel(); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; private: gcn::Label *mThemeLabel; diff --git a/src/gui/setup_video.h b/src/gui/setup_video.h index fc3f61439..5425e3da2 100644 --- a/src/gui/setup_video.h +++ b/src/gui/setup_video.h @@ -53,7 +53,7 @@ class Setup_Video final : public SetupTab, public gcn::KeyListener void apply(); void cancel(); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; virtual void externalUpdated(); diff --git a/src/gui/shopwindow.h b/src/gui/shopwindow.h index 5faaeb8ab..420c3bef7 100644 --- a/src/gui/shopwindow.h +++ b/src/gui/shopwindow.h @@ -73,12 +73,12 @@ class ShopWindow final : public Window, public gcn::ActionListener, /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Updates the labels according to the selected item. */ - void valueChanged(const gcn::SelectionEvent &event); + void valueChanged(const gcn::SelectionEvent &event) override; /** * Updates the state of buttons and labels. diff --git a/src/gui/shortcutwindow.h b/src/gui/shortcutwindow.h index 531df51ce..0991bb124 100644 --- a/src/gui/shortcutwindow.h +++ b/src/gui/shortcutwindow.h @@ -57,11 +57,11 @@ class ShortcutWindow final : public Window int getTabIndex() const; - void widgetHidden(const gcn::Event &event); + void widgetHidden(const gcn::Event &event) override; - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; - void mouseDragged(gcn::MouseEvent &event); + void mouseDragged(gcn::MouseEvent &event) override; private: ShortcutWindow(); diff --git a/src/gui/skilldialog.h b/src/gui/skilldialog.h index 0fd961e1c..52a9281cf 100644 --- a/src/gui/skilldialog.h +++ b/src/gui/skilldialog.h @@ -91,7 +91,7 @@ class SkillDialog final : public Window, public gcn::ActionListener /** * Called when receiving actions from widget. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Update the given skill's display @@ -115,7 +115,7 @@ class SkillDialog final : public Window, public gcn::ActionListener bool hasSkills() const { return !mSkills.empty(); } - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; void useItem(const int itemId); diff --git a/src/gui/socialwindow.h b/src/gui/socialwindow.h index 0287e9100..863ffdedf 100644 --- a/src/gui/socialwindow.h +++ b/src/gui/socialwindow.h @@ -67,7 +67,7 @@ public: /** * Handle events. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; void showGuildInvite(const std::string &guildName, const int guildId, const std::string &inviterName); @@ -119,7 +119,7 @@ public: void updatePickupFilter(); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; protected: friend class SocialTab; diff --git a/src/gui/specialswindow.h b/src/gui/specialswindow.h index a824c4296..56804ce74 100644 --- a/src/gui/specialswindow.h +++ b/src/gui/specialswindow.h @@ -49,9 +49,9 @@ class SpecialsWindow final : public Window, public gcn::ActionListener /** * Called when receiving actions from widget. */ - void action(const gcn::ActionEvent &actionEvent); + void action(const gcn::ActionEvent &actionEvent) override; - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; private: // (re)constructs the list of specials diff --git a/src/gui/spellpopup.h b/src/gui/spellpopup.h index 97266ca9e..ace4dbdf9 100644 --- a/src/gui/spellpopup.h +++ b/src/gui/spellpopup.h @@ -63,7 +63,7 @@ class SpellPopup final : public Popup */ void view(const int x, const int y); - void mouseMoved(gcn::MouseEvent &mouseEvent); + void mouseMoved(gcn::MouseEvent &mouseEvent) override; private: gcn::Label *mItemName; diff --git a/src/gui/statuspopup.h b/src/gui/statuspopup.h index 99ba46792..380e93e48 100644 --- a/src/gui/statuspopup.h +++ b/src/gui/statuspopup.h @@ -60,8 +60,6 @@ class StatusPopup final : public Popup */ void view(const int x, const int y); -// void mouseMoved(gcn::MouseEvent &mouseEvent); - void update(); private: diff --git a/src/gui/statuswindow.h b/src/gui/statuswindow.h index 0d3fefb4b..25b86d505 100644 --- a/src/gui/statuswindow.h +++ b/src/gui/statuswindow.h @@ -57,7 +57,8 @@ class StatusWindow final : public Window, */ StatusWindow(); - void processEvent(Channels channel, const DepricatedEvent &event); + void processEvent(Channels channel, + const DepricatedEvent &event) override; void setPointsNeeded(const int id, const int needed); @@ -83,7 +84,7 @@ class StatusWindow final : public Window, void updateProgressBar(ProgressBar *const bar, const int id, const bool percent = true) const; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; void clearAttributes(); diff --git a/src/gui/textcommandeditor.h b/src/gui/textcommandeditor.h index 616c6d627..c715e0faa 100644 --- a/src/gui/textcommandeditor.h +++ b/src/gui/textcommandeditor.h @@ -55,7 +55,7 @@ class TextCommandEditor final : public Window, public gcn::ActionListener */ ~TextCommandEditor(); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; void update(); diff --git a/src/gui/textdialog.h b/src/gui/textdialog.h index 71cc88bcd..c9f3b150d 100644 --- a/src/gui/textdialog.h +++ b/src/gui/textdialog.h @@ -56,7 +56,7 @@ public: /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Get the text in the textfield diff --git a/src/gui/textpopup.h b/src/gui/textpopup.h index faf61e311..fd901225a 100644 --- a/src/gui/textpopup.h +++ b/src/gui/textpopup.h @@ -73,7 +73,7 @@ class TextPopup final : public Popup void show(const int x, const int y, const std::string &str1, const std::string &str2, const std::string &str3); - void mouseMoved(gcn::MouseEvent &mouseEvent); + void mouseMoved(gcn::MouseEvent &mouseEvent) override; private: gcn::Label *mText1; diff --git a/src/gui/theme.h b/src/gui/theme.h index 86be2e743..a32237be1 100644 --- a/src/gui/theme.h +++ b/src/gui/theme.h @@ -315,7 +315,7 @@ class Theme final : public Palette, public ConfigListener */ void setMinimumOpacity(const float minimumOpacity); - void optionChanged(const std::string &); + void optionChanged(const std::string &) override; void loadRect(ImageRect &image, const std::string &name, const std::string &name2, const int start = 0, diff --git a/src/gui/tradewindow.h b/src/gui/tradewindow.h index 0ba3b9043..9785a1344 100644 --- a/src/gui/tradewindow.h +++ b/src/gui/tradewindow.h @@ -111,12 +111,12 @@ class TradeWindow final : public Window, * Updates the labels and makes sure only one item is selected in * either my inventory or partner inventory. */ - void valueChanged(const gcn::SelectionEvent &event); + void valueChanged(const gcn::SelectionEvent &event) override; /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; /** * Closes the Trade Window, as well as telling the server that the diff --git a/src/gui/unregisterdialog.h b/src/gui/unregisterdialog.h index e647b2bb9..28f279444 100644 --- a/src/gui/unregisterdialog.h +++ b/src/gui/unregisterdialog.h @@ -57,7 +57,7 @@ class UnRegisterDialog final : public Window, public gcn::ActionListener /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; private: LoginData *mLoginData; diff --git a/src/gui/updaterwindow.h b/src/gui/updaterwindow.h index 0adadb9ec..2f934aee5 100644 --- a/src/gui/updaterwindow.h +++ b/src/gui/updaterwindow.h @@ -109,13 +109,14 @@ class UpdaterWindow final : public Window, void loadPatch(); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void keyPressed(gcn::KeyEvent &keyEvent); + void keyPressed(gcn::KeyEvent &keyEvent) override; - void logic(); + void logic() override; - void handleLink(const std::string &link, gcn::MouseEvent *event A_UNUSED); + void handleLink(const std::string &link, + gcn::MouseEvent *event A_UNUSED) override; static void loadLocalUpdates(const std::string &dir); diff --git a/src/gui/userpalette.h b/src/gui/userpalette.h index f14c2c10c..2fb9c8904 100644 --- a/src/gui/userpalette.h +++ b/src/gui/userpalette.h @@ -150,7 +150,7 @@ class UserPalette final : public Palette, public gcn::ListModel * * @return the number of colors known */ - inline int getNumberOfElements() + inline int getNumberOfElements() override { return static_cast<int>(mColors.size()); } /** @@ -160,7 +160,7 @@ class UserPalette final : public Palette, public gcn::ListModel * * @return the name of the color */ - std::string getElementAt(int i); + std::string getElementAt(int i) override; /** * Commit the colors diff --git a/src/gui/viewport.h b/src/gui/viewport.h index 4d4c61896..b88702afe 100644 --- a/src/gui/viewport.h +++ b/src/gui/viewport.h @@ -83,7 +83,7 @@ class Viewport final : public WindowContainer, /** * Draws the viewport. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Implements player to keep following mouse. @@ -102,22 +102,22 @@ class Viewport final : public WindowContainer, /** * Handles mouse press on map. */ - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; /** * Handles mouse move on map */ - void mouseDragged(gcn::MouseEvent &event); + void mouseDragged(gcn::MouseEvent &event) override; /** * Handles mouse button release on map. */ - void mouseReleased(gcn::MouseEvent &event); + void mouseReleased(gcn::MouseEvent &event) override; /** * Handles mouse move on map. */ - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; /** * Shows a popup for an item. @@ -189,7 +189,7 @@ class Viewport final : public WindowContainer, /** * A relevant config option changed. */ - void optionChanged(const std::string &name); + void optionChanged(const std::string &name) override; /** * Returns camera x offset in pixels. diff --git a/src/gui/whoisonline.h b/src/gui/whoisonline.h index 35565930e..4e0638ef1 100644 --- a/src/gui/whoisonline.h +++ b/src/gui/whoisonline.h @@ -129,15 +129,15 @@ public: void loadList(std::vector<OnlinePlayer*> &list); - void handleLink(const std::string& link, gcn::MouseEvent *event); + void handleLink(const std::string& link, gcn::MouseEvent *event) override; - void logic(); + void logic() override; void slowLogic(); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; const std::set<OnlinePlayer*> &getOnlinePlayers() const { return mOnlinePlayers; } @@ -148,7 +148,7 @@ public: void setAllowUpdate(const bool n) { mAllowUpdate = n; } - void optionChanged(const std::string &name); + void optionChanged(const std::string &name) override; void updateList(StringVect &list); diff --git a/src/gui/widgets/avatarlistbox.h b/src/gui/widgets/avatarlistbox.h index 9ab56e9b0..803a80070 100644 --- a/src/gui/widgets/avatarlistbox.h +++ b/src/gui/widgets/avatarlistbox.h @@ -39,7 +39,7 @@ class AvatarListModel : public gcn::ListModel public: virtual Avatar *getAvatarAt(const int i) = 0; - std::string getElementAt(int i) + std::string getElementAt(int i) override { return getAvatarAt(i)->getName(); } }; @@ -53,11 +53,11 @@ public: /** * Draws the list box. */ - void draw(gcn::Graphics *gcnGraphics); + void draw(gcn::Graphics *gcnGraphics) override; - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; - void optionChanged(const std::string &value); + void optionChanged(const std::string &value) override; private: bool mShowGender; diff --git a/src/gui/widgets/battletab.h b/src/gui/widgets/battletab.h index 12ba23ebf..87b082901 100644 --- a/src/gui/widgets/battletab.h +++ b/src/gui/widgets/battletab.h @@ -35,10 +35,10 @@ class BattleTab final : public ChatTab ~BattleTab(); - int getType() const + int getType() const override { return ChatTab::TAB_BATTLE; } - void saveToLogFile(std::string &msg); + void saveToLogFile(std::string &msg) override; }; extern BattleTab *battleChatTab; diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h index e95507c8c..9cf74ef4f 100644 --- a/src/gui/widgets/browserbox.h +++ b/src/gui/widgets/browserbox.h @@ -140,19 +140,17 @@ class BrowserBox final : public gcn::Widget, /** * Handles mouse actions. */ - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; /** * Draws the browser box. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; void updateHeight(); -// void widgetResized(const gcn::Event &event); - /** * BrowserBox modes. */ diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h index fbc040171..36f539b6a 100644 --- a/src/gui/widgets/button.h +++ b/src/gui/widgets/button.h @@ -80,14 +80,14 @@ class Button final : public gcn::Button, public gcn::WidgetListener /** * Draws the button. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Update the alpha value to the button components. */ void updateAlpha(); - virtual void mouseReleased(gcn::MouseEvent& mouseEvent); + virtual void mouseReleased(gcn::MouseEvent& mouseEvent) override; void setDescription(std::string text) { mDescription = text; } @@ -110,9 +110,9 @@ class Button final : public gcn::Button, public gcn::WidgetListener void setPressed(bool b) { mPressed = b; } - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; - void widgetMoved(const gcn::Event &event); + void widgetMoved(const gcn::Event &event) override; void loadImage(const std::string &imageName); @@ -120,9 +120,9 @@ class Button final : public gcn::Button, public gcn::WidgetListener void setCaption(const std::string& caption); - void keyPressed(gcn::KeyEvent &keyEvent); + void keyPressed(gcn::KeyEvent &keyEvent) override; - void keyReleased(gcn::KeyEvent &keyEvent); + void keyReleased(gcn::KeyEvent &keyEvent) override; bool isPressed2() const; diff --git a/src/gui/widgets/channeltab.h b/src/gui/widgets/channeltab.h index 92126e929..96b6dd6ac 100644 --- a/src/gui/widgets/channeltab.h +++ b/src/gui/widgets/channeltab.h @@ -37,10 +37,10 @@ class ChannelTab final : public ChatTab Channel *getChannel() const { return mChannel; } - void showHelp(); + void showHelp() override; bool handleCommand(const std::string &type, - const std::string &args); + const std::string &args) override; protected: friend class Channel; @@ -55,7 +55,7 @@ class ChannelTab final : public ChatTab */ ~ChannelTab(); - void handleInput(const std::string &msg); + void handleInput(const std::string &msg) override; private: Channel *mChannel; diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h index 0b4a287d0..ba6698e50 100644 --- a/src/gui/widgets/chattab.h +++ b/src/gui/widgets/chattab.h @@ -169,7 +169,7 @@ class ChatTab : public Tab friend class ChatWindow; friend class WhisperWindow; - virtual void setCurrent() + virtual void setCurrent() override { setFlash(0); } virtual void handleInput(const std::string &msg); diff --git a/src/gui/widgets/checkbox.h b/src/gui/widgets/checkbox.h index bb3cf751a..54e9a5e0d 100644 --- a/src/gui/widgets/checkbox.h +++ b/src/gui/widgets/checkbox.h @@ -52,7 +52,7 @@ class CheckBox final : public gcn::CheckBox /** * Draws the caption, then calls drawBox to draw the check box. */ - void draw(gcn::Graphics *const graphics); + void draw(gcn::Graphics *const graphics) override; /** * Update the alpha value to the checkbox components. @@ -67,14 +67,14 @@ class CheckBox final : public gcn::CheckBox /** * Called when the mouse enteres the widget area. */ - void mouseEntered(gcn::MouseEvent& event); + void mouseEntered(gcn::MouseEvent& event) override; /** * Called when the mouse leaves the widget area. */ - void mouseExited(gcn::MouseEvent& event); + void mouseExited(gcn::MouseEvent& event) override; - void keyPressed(gcn::KeyEvent& keyEvent); + void keyPressed(gcn::KeyEvent& keyEvent) override; private: static int instances; diff --git a/src/gui/widgets/desktop.h b/src/gui/widgets/desktop.h index 3cff9a75a..d8fa7d36a 100644 --- a/src/gui/widgets/desktop.h +++ b/src/gui/widgets/desktop.h @@ -57,9 +57,9 @@ class Desktop final : public Container, private gcn::WidgetListener */ void reloadWallpaper(); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; private: void setBestFittingWallpaper(); diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h index 813a19e5f..f76a38b4d 100644 --- a/src/gui/widgets/dropdown.h +++ b/src/gui/widgets/dropdown.h @@ -59,25 +59,25 @@ class DropDown final : public gcn::DropDown */ void updateAlpha(); - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; - void drawFrame(gcn::Graphics *graphics); + void drawFrame(gcn::Graphics *graphics) override; // Inherited from FocusListener - void focusLost(const gcn::Event& event); + void focusLost(const gcn::Event& event) override; // Inherited from KeyListener - void keyPressed(gcn::KeyEvent& keyEvent); + void keyPressed(gcn::KeyEvent& keyEvent) override; // Inherited from MouseListener - void mousePressed(gcn::MouseEvent& mouseEvent); + void mousePressed(gcn::MouseEvent& mouseEvent) override; - void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent); + void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override; - void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent); + void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override; void setSelectedString(std::string str); diff --git a/src/gui/widgets/dropshortcutcontainer.h b/src/gui/widgets/dropshortcutcontainer.h index 0544bf07c..337973412 100644 --- a/src/gui/widgets/dropshortcutcontainer.h +++ b/src/gui/widgets/dropshortcutcontainer.h @@ -52,28 +52,28 @@ class DropShortcutContainer final : public ShortcutContainer /** * Draws the items. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event); + void mouseDragged(gcn::MouseEvent &event) override; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; /** * Handles mouse release. */ - void mouseReleased(gcn::MouseEvent &event); + void mouseReleased(gcn::MouseEvent &event) override; - void widgetHidden(const gcn::Event &event); + void widgetHidden(const gcn::Event &event) override; - void mouseExited(gcn::MouseEvent &event); + void mouseExited(gcn::MouseEvent &event) override; - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; private: bool mItemClicked; diff --git a/src/gui/widgets/emoteshortcutcontainer.h b/src/gui/widgets/emoteshortcutcontainer.h index 56a1629d7..736370a93 100644 --- a/src/gui/widgets/emoteshortcutcontainer.h +++ b/src/gui/widgets/emoteshortcutcontainer.h @@ -53,28 +53,28 @@ class EmoteShortcutContainer final : public ShortcutContainer /** * Draws the items. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event); + void mouseDragged(gcn::MouseEvent &event) override; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; /** * Handles mouse release. */ - void mouseReleased(gcn::MouseEvent &event); + void mouseReleased(gcn::MouseEvent &event) override; - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; - void mouseExited(gcn::MouseEvent &event); + void mouseExited(gcn::MouseEvent &event) override; - void widgetHidden(const gcn::Event &event); + void widgetHidden(const gcn::Event &event) override; private: std::vector<const EmoteSprite*> mEmoteImg; diff --git a/src/gui/widgets/extendedlistbox.h b/src/gui/widgets/extendedlistbox.h index 196189674..af3ae64a9 100644 --- a/src/gui/widgets/extendedlistbox.h +++ b/src/gui/widgets/extendedlistbox.h @@ -36,9 +36,9 @@ class ExtendedListBox final : public ListBox /** * Draws the list box. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; - unsigned int getRowHeight() const + unsigned int getRowHeight() const override { return mRowHeight; } void setRowHeight(unsigned int n) diff --git a/src/gui/widgets/extendednamesmodel.h b/src/gui/widgets/extendednamesmodel.h index be59c7e20..a4b6013c2 100644 --- a/src/gui/widgets/extendednamesmodel.h +++ b/src/gui/widgets/extendednamesmodel.h @@ -34,11 +34,11 @@ class ExtendedNamesModel : public ExtendedListModel virtual ~ExtendedNamesModel(); - virtual int getNumberOfElements(); + virtual int getNumberOfElements() override; - virtual std::string getElementAt(int i); + virtual std::string getElementAt(int i) override; - virtual const Image *getImageAt(int i); + virtual const Image *getImageAt(int i) override; StringVect &getNames() { return mNames; } diff --git a/src/gui/widgets/flowcontainer.h b/src/gui/widgets/flowcontainer.h index f0d1d9638..d04dffb23 100644 --- a/src/gui/widgets/flowcontainer.h +++ b/src/gui/widgets/flowcontainer.h @@ -50,7 +50,7 @@ class FlowContainer final : public Container, * Invoked when a widget changes its size. This is used to determine * the new height of the container. */ - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; int getBoxWidth() const { return mBoxWidth; } diff --git a/src/gui/widgets/guildchattab.h b/src/gui/widgets/guildchattab.h index a8f47db25..54dd67a8d 100644 --- a/src/gui/widgets/guildchattab.h +++ b/src/gui/widgets/guildchattab.h @@ -35,21 +35,22 @@ class GuildChatTab final : public ChatTab ~GuildChatTab(); - bool handleCommand(const std::string &type, const std::string &args); + bool handleCommand(const std::string &type, + const std::string &args) override; - void showHelp(); + void showHelp() override; - void saveToLogFile(std::string &msg); + void saveToLogFile(std::string &msg) override; - int getType() const + int getType() const override { return ChatTab::TAB_GUILD; } - void playNewMessageSound(); + void playNewMessageSound() override; protected: - void handleInput(const std::string &msg); + void handleInput(const std::string &msg) override; - void getAutoCompleteList(StringVect &names) const; + void getAutoCompleteList(StringVect &names) const override; }; #endif diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h index af6bedb62..76fdb4b54 100644 --- a/src/gui/widgets/guitable.h +++ b/src/gui/widgets/guitable.h @@ -89,7 +89,7 @@ public: void setWrappingEnabled(bool wrappingEnabled) { mWrappingEnabled = wrappingEnabled; } - gcn::Rectangle getChildrenArea(); + gcn::Rectangle getChildrenArea() override; /** * Toggle whether to use linewise selection mode, in which the table selects @@ -105,18 +105,18 @@ public: void setLinewiseSelection(bool linewise); // Inherited from Widget - virtual void draw(gcn::Graphics* graphics); + virtual void draw(gcn::Graphics* graphics) override; - virtual gcn::Widget *getWidgetAt(int x, int y); + virtual gcn::Widget *getWidgetAt(int x, int y) override; - virtual void moveToTop(gcn::Widget *child); + virtual void moveToTop(gcn::Widget *child) override; - virtual void moveToBottom(gcn::Widget *child); + virtual void moveToBottom(gcn::Widget *child) override; - virtual void _setFocusHandler(gcn::FocusHandler* focusHandler); + virtual void _setFocusHandler(gcn::FocusHandler* focusHandler) override; // Inherited from KeyListener - virtual void keyPressed(gcn::KeyEvent& keyEvent); + virtual void keyPressed(gcn::KeyEvent& keyEvent) override; /** * Sets the table to be opaque, that is sets the table @@ -137,16 +137,16 @@ public: { return mOpaque; } // Inherited from MouseListener - virtual void mousePressed(gcn::MouseEvent& mouseEvent); + virtual void mousePressed(gcn::MouseEvent& mouseEvent) override; - virtual void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent); + virtual void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override; - virtual void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent); + virtual void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override; - virtual void mouseDragged(gcn::MouseEvent& mouseEvent); + virtual void mouseDragged(gcn::MouseEvent& mouseEvent) override; // Constraints inherited from TableModelListener - virtual void modelUpdated(bool); + virtual void modelUpdated(bool) override; protected: /** Frees all action listeners on inner widgets. */ diff --git a/src/gui/widgets/horizontcontainer.h b/src/gui/widgets/horizontcontainer.h index 736d8fd98..1db5bf7a8 100644 --- a/src/gui/widgets/horizontcontainer.h +++ b/src/gui/widgets/horizontcontainer.h @@ -42,7 +42,7 @@ class HorizontContainer final : public Container, public gcn::WidgetListener virtual void clear(); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; protected: int mSpacing; diff --git a/src/gui/widgets/icon.h b/src/gui/widgets/icon.h index 62e8ac1b1..ec9c8319f 100644 --- a/src/gui/widgets/icon.h +++ b/src/gui/widgets/icon.h @@ -59,7 +59,7 @@ class Icon final : public gcn::Widget /** * Draws the Icon. */ - void draw(gcn::Graphics *g); + void draw(gcn::Graphics *g) override; private: Image *mImage; diff --git a/src/gui/widgets/inttextfield.h b/src/gui/widgets/inttextfield.h index a820de8a3..430ae4746 100644 --- a/src/gui/widgets/inttextfield.h +++ b/src/gui/widgets/inttextfield.h @@ -65,7 +65,7 @@ class IntTextField final : public TextField /** * Responds to key presses. */ - void keyPressed(gcn::KeyEvent &event); + void keyPressed(gcn::KeyEvent &event) override; private: int mMin; /**< Minimum value */ diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h index 40f9a92d7..e7bf11e48 100644 --- a/src/gui/widgets/itemcontainer.h +++ b/src/gui/widgets/itemcontainer.h @@ -73,26 +73,26 @@ class ItemContainer final : public gcn::Widget, /** * Necessary for checking how full the inventory is. */ - void logic(); + void logic() override; /** * Draws the items. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; // KeyListener - void keyPressed(gcn::KeyEvent &event); - void keyReleased(gcn::KeyEvent &event); + void keyPressed(gcn::KeyEvent &event) override; + void keyReleased(gcn::KeyEvent &event) override; // MouseListener - void mousePressed(gcn::MouseEvent &event); - void mouseDragged(gcn::MouseEvent &event); - void mouseReleased(gcn::MouseEvent &event); - void mouseMoved(gcn::MouseEvent &event); - void mouseExited(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; + void mouseDragged(gcn::MouseEvent &event) override; + void mouseReleased(gcn::MouseEvent &event) override; + void mouseMoved(gcn::MouseEvent &event) override; + void mouseExited(gcn::MouseEvent &event) override; // WidgetListener - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; /** * Returns the selected item. diff --git a/src/gui/widgets/itemlinkhandler.h b/src/gui/widgets/itemlinkhandler.h index 5deb76c73..35415a010 100644 --- a/src/gui/widgets/itemlinkhandler.h +++ b/src/gui/widgets/itemlinkhandler.h @@ -34,7 +34,8 @@ class ItemLinkHandler final : public LinkHandler ~ItemLinkHandler(); - void handleLink(const std::string &link, gcn::MouseEvent *event); + void handleLink(const std::string &link, + gcn::MouseEvent *event) override; private: ItemPopup *mItemPopup; diff --git a/src/gui/widgets/itemshortcutcontainer.h b/src/gui/widgets/itemshortcutcontainer.h index 92866b10d..e7a13b45f 100644 --- a/src/gui/widgets/itemshortcutcontainer.h +++ b/src/gui/widgets/itemshortcutcontainer.h @@ -53,28 +53,28 @@ class ItemShortcutContainer final : public ShortcutContainer /** * Draws the items. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event); + void mouseDragged(gcn::MouseEvent &event) override; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; /** * Handles mouse release. */ - void mouseReleased(gcn::MouseEvent &event); + void mouseReleased(gcn::MouseEvent &event) override; - void widgetHidden(const gcn::Event &event); + void widgetHidden(const gcn::Event &event) override; - void mouseExited(gcn::MouseEvent &event); + void mouseExited(gcn::MouseEvent &event) override; - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; private: bool mItemClicked; diff --git a/src/gui/widgets/label.h b/src/gui/widgets/label.h index b9845ef0a..fc82fa900 100644 --- a/src/gui/widgets/label.h +++ b/src/gui/widgets/label.h @@ -47,7 +47,7 @@ class Label final : public gcn::Label /** * Draws the label. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; }; #endif diff --git a/src/gui/widgets/layouthelper.h b/src/gui/widgets/layouthelper.h index 518168a80..2285e15cd 100644 --- a/src/gui/widgets/layouthelper.h +++ b/src/gui/widgets/layouthelper.h @@ -76,7 +76,7 @@ class LayoutHelper final : public gcn::WidgetListener /** * Called whenever the managed container changes size. */ - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; private: Layout mLayout; /**< Layout handler */ diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h index fdb6350c5..efe6da57d 100644 --- a/src/gui/widgets/listbox.h +++ b/src/gui/widgets/listbox.h @@ -47,7 +47,7 @@ class ListBox : public gcn::ListBox /** * Draws the list box. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Update the alpha value to the graphic components. @@ -56,17 +56,17 @@ class ListBox : public gcn::ListBox // Inherited from KeyListener - void keyPressed(gcn::KeyEvent& keyEvent); + void keyPressed(gcn::KeyEvent& keyEvent) override; // Inherited from MouseListener - void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent); + void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override; - void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent); + void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override; - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; - void mouseDragged(gcn::MouseEvent &event); + void mouseDragged(gcn::MouseEvent &event) override; void refocus(); diff --git a/src/gui/widgets/namesmodel.h b/src/gui/widgets/namesmodel.h index 1064a8875..69d9f3c56 100644 --- a/src/gui/widgets/namesmodel.h +++ b/src/gui/widgets/namesmodel.h @@ -25,6 +25,8 @@ #include <guichan/listmodel.hpp> +#include "localconsts.h" + class NamesModel : public gcn::ListModel { public: @@ -32,9 +34,9 @@ class NamesModel : public gcn::ListModel virtual ~NamesModel(); - virtual int getNumberOfElements(); + virtual int getNumberOfElements() override; - virtual std::string getElementAt(int i); + virtual std::string getElementAt(int i) override; StringVect &getNames() { return mNames; } diff --git a/src/gui/widgets/passwordfield.h b/src/gui/widgets/passwordfield.h index ceb88876e..0444427ee 100644 --- a/src/gui/widgets/passwordfield.h +++ b/src/gui/widgets/passwordfield.h @@ -41,7 +41,7 @@ class PasswordField final : public TextField /** * Draws the password field. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; }; #endif diff --git a/src/gui/widgets/playerbox.h b/src/gui/widgets/playerbox.h index dbf104de0..3b3116294 100644 --- a/src/gui/widgets/playerbox.h +++ b/src/gui/widgets/playerbox.h @@ -67,12 +67,12 @@ class PlayerBox final : public gcn::ScrollArea /** * Draws the scroll area. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Draws the background and border of the scroll area. */ - void drawFrame(gcn::Graphics *graphics); + void drawFrame(gcn::Graphics *graphics) override; Being *getBeing() { return mBeing; } diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h index 2442aa220..af7c8d5bd 100644 --- a/src/gui/widgets/popup.h +++ b/src/gui/widgets/popup.h @@ -73,7 +73,7 @@ class Popup : public Container, public gcn::MouseListener, /** * Draws the popup. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Sets the size of this popup. @@ -85,7 +85,7 @@ class Popup : public Container, public gcn::MouseListener, */ void setLocationRelativeTo(const gcn::Widget *const widget); - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; /** * Sets the minimum width of the popup. @@ -149,7 +149,7 @@ class Popup : public Container, public gcn::MouseListener, // Inherited from BasicContainer - virtual gcn::Rectangle getChildrenArea(); + virtual gcn::Rectangle getChildrenArea() override; /** * Sets the location to display the popup. Tries to horizontally center @@ -161,9 +161,9 @@ class Popup : public Container, public gcn::MouseListener, void hide(); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; - void widgetMoved(const gcn::Event &event); + void widgetMoved(const gcn::Event &event) override; private: std::string mPopupName; /**< Name of the popup */ diff --git a/src/gui/widgets/progressbar.h b/src/gui/widgets/progressbar.h index 11c8069a3..e163fe66c 100644 --- a/src/gui/widgets/progressbar.h +++ b/src/gui/widgets/progressbar.h @@ -53,7 +53,7 @@ class ProgressBar final : public gcn::Widget, public gcn::WidgetListener /** * Performs progress bar logic (fading colors) */ - void logic(); + void logic() override; /** * Update the alpha value to the graphic components. @@ -63,7 +63,7 @@ class ProgressBar final : public gcn::Widget, public gcn::WidgetListener /** * Draws the progress bar. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Sets the current progress. @@ -132,9 +132,9 @@ class ProgressBar final : public gcn::Widget, public gcn::WidgetListener const gcn::Color &color, const float progress, const std::string &text = ""); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; - void widgetMoved(const gcn::Event &event); + void widgetMoved(const gcn::Event &event) override; private: float mProgress; diff --git a/src/gui/widgets/progressindicator.h b/src/gui/widgets/progressindicator.h index 4046f21d9..2db3fe8b9 100644 --- a/src/gui/widgets/progressindicator.h +++ b/src/gui/widgets/progressindicator.h @@ -34,10 +34,12 @@ class ProgressIndicator final : public gcn::Widget { public: ProgressIndicator(); + ~ProgressIndicator(); - void logic(); - void draw(gcn::Graphics *graphics); + void logic() override; + + void draw(gcn::Graphics *graphics) override; private: SimpleAnimation *mIndicator; diff --git a/src/gui/widgets/radiobutton.h b/src/gui/widgets/radiobutton.h index ae846bc77..cc0ff7734 100644 --- a/src/gui/widgets/radiobutton.h +++ b/src/gui/widgets/radiobutton.h @@ -47,25 +47,25 @@ class RadioButton final : public gcn::RadioButton /** * Draws the radiobutton, not the caption. */ - void drawBox(gcn::Graphics* graphics); + void drawBox(gcn::Graphics* graphics) override; /** * Implementation of the draw methods. * Thus, avoiding the rhomb around the radio button. */ - void draw(gcn::Graphics* graphics); + void draw(gcn::Graphics* graphics) override; /** * Called when the mouse enteres the widget area. */ - void mouseEntered(gcn::MouseEvent& event); + void mouseEntered(gcn::MouseEvent& event) override; /** * Called when the mouse leaves the widget area. */ - void mouseExited(gcn::MouseEvent& event); + void mouseExited(gcn::MouseEvent& event) override; - void keyPressed(gcn::KeyEvent& keyEvent); + void keyPressed(gcn::KeyEvent& keyEvent) override; private: static int instances; diff --git a/src/gui/widgets/radiogroup.h b/src/gui/widgets/radiogroup.h index 19e67d09d..370d46436 100644 --- a/src/gui/widgets/radiogroup.h +++ b/src/gui/widgets/radiogroup.h @@ -31,7 +31,7 @@ class RadioGroup final : public WidgetGroup RadioGroup(const std::string &group, const int height, const int spacing); - gcn::Widget *createWidget(const std::string &name); + gcn::Widget *createWidget(const std::string &name) override; }; #endif diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h index 064bfdeb0..7a1a3b076 100644 --- a/src/gui/widgets/scrollarea.h +++ b/src/gui/widgets/scrollarea.h @@ -65,7 +65,7 @@ class ScrollArea final : public gcn::ScrollArea, public gcn::WidgetListener * Logic function optionally adapts width or height of contents. This * depends on the scrollbar settings. */ - void logic(); + void logic() override; /** * Update the alpha value to the graphic components. @@ -75,12 +75,12 @@ class ScrollArea final : public gcn::ScrollArea, public gcn::WidgetListener /** * Draws the scroll area. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Draws the background and border of the scroll area. */ - void drawFrame(gcn::Graphics *graphics); + void drawFrame(gcn::Graphics *graphics) override; /** * Sets whether the widget should draw its background or not. @@ -96,25 +96,25 @@ class ScrollArea final : public gcn::ScrollArea, public gcn::WidgetListener /** * Called when the mouse moves in the widget area. */ - void mouseMoved(gcn::MouseEvent& event); + void mouseMoved(gcn::MouseEvent& event) override; /** * Called when the mouse enteres the widget area. */ - void mouseEntered(gcn::MouseEvent& event); + void mouseEntered(gcn::MouseEvent& event) override; /** * Called when the mouse leaves the widget area. */ - void mouseExited(gcn::MouseEvent& event); + void mouseExited(gcn::MouseEvent& event) override; - void mousePressed(gcn::MouseEvent& event); + void mousePressed(gcn::MouseEvent& event) override; - void mouseReleased(gcn::MouseEvent& event); + void mouseReleased(gcn::MouseEvent& event) override; - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; - void widgetMoved(const gcn::Event &event); + void widgetMoved(const gcn::Event &event) override; protected: enum BUTTON_DIR @@ -132,14 +132,14 @@ class ScrollArea final : public gcn::ScrollArea, public gcn::WidgetListener void init(std::string skinName); void drawButton(gcn::Graphics *const graphics, const BUTTON_DIR dir); - void drawUpButton(gcn::Graphics *const graphics); - void drawDownButton(gcn::Graphics *const graphics); - void drawLeftButton(gcn::Graphics *const graphics); - void drawRightButton(gcn::Graphics *const graphics); - void drawVBar(gcn::Graphics *const graphics); - void drawHBar(gcn::Graphics *const graphics); - void drawVMarker(gcn::Graphics *const graphics); - void drawHMarker(gcn::Graphics *const graphics); + void drawUpButton(gcn::Graphics *const graphics) override; + void drawDownButton(gcn::Graphics *const graphics) override; + void drawLeftButton(gcn::Graphics *const graphics) override; + void drawRightButton(gcn::Graphics *const graphics) override; + void drawVBar(gcn::Graphics *const graphics) override; + void drawHBar(gcn::Graphics *const graphics) override; + void drawVMarker(gcn::Graphics *const graphics) override; + void drawHMarker(gcn::Graphics *const graphics) override; static int instances; static float mAlpha; diff --git a/src/gui/widgets/setupitem.h b/src/gui/widgets/setupitem.h index d8affadd1..f36dc2534 100644 --- a/src/gui/widgets/setupitem.h +++ b/src/gui/widgets/setupitem.h @@ -88,7 +88,7 @@ class SetupItem : public gcn::ActionListener virtual std::string getActionEventId(); - virtual void action(const gcn::ActionEvent &event); + virtual void action(const gcn::ActionEvent &event) override; virtual void action(); @@ -145,9 +145,9 @@ class SetupItemCheckBox final : public SetupItem void createControls(); - void fromWidget(); + void fromWidget() override; - void toWidget(); + void toWidget() override; protected: CheckBox *mCheckBox; @@ -170,13 +170,13 @@ class SetupItemTextField final : public SetupItem void createControls(); - void fromWidget(); + void fromWidget() override; - void toWidget(); + void toWidget() override; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void apply(std::string eventName); + void apply(std::string eventName) override; protected: HorizontContainer *mHorizont; @@ -207,13 +207,13 @@ class SetupItemIntTextField final : public SetupItem void createControls(); - void fromWidget(); + void fromWidget() override; - void toWidget(); + void toWidget() override; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void apply(std::string eventName); + void apply(std::string eventName) override; protected: HorizontContainer *mHorizont; @@ -236,13 +236,13 @@ class SetupItemLabel final : public SetupItem void createControls(); - void fromWidget(); + void fromWidget() override; - void toWidget(); + void toWidget() override; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void apply(std::string eventName); + void apply(std::string eventName) override; protected: Label *mLabel; @@ -266,9 +266,9 @@ class SetupItemDropDown final : public SetupItem void createControls(); - void fromWidget(); + void fromWidget() override; - void toWidget(); + void toWidget() override; protected: HorizontContainer *mHorizont; @@ -299,11 +299,11 @@ class SetupItemSlider final : public SetupItem void createControls(); - void fromWidget(); + void fromWidget() override; - void toWidget(); + void toWidget() override; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; void apply(std::string eventName); @@ -346,13 +346,13 @@ class SetupItemSlider2 final : public SetupItem void createControls(); - void fromWidget(); + void fromWidget() override; - void toWidget(); + void toWidget() override; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void apply(std::string eventName); + void apply(std::string eventName) override; void setInvertValue(const int v); @@ -394,13 +394,13 @@ class SetupItemSliderList : public SetupItem void createControls(); - void fromWidget(); + void fromWidget() override; - void toWidget(); + void toWidget() override; - virtual void action(const gcn::ActionEvent &event); + virtual void action(const gcn::ActionEvent &event) override; - void apply(std::string eventName); + void apply(std::string eventName) override; virtual void addMoreControls() = 0; @@ -422,9 +422,9 @@ class SetupItemSound final : public SetupItemSliderList const int width = 150, const bool onTheFly = false, const bool mainConfig = true); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void addMoreControls(); + void addMoreControls() override; protected: Button *mButton; diff --git a/src/gui/widgets/setuptabscroll.h b/src/gui/widgets/setuptabscroll.h index 77103323a..947ca2b26 100644 --- a/src/gui/widgets/setuptabscroll.h +++ b/src/gui/widgets/setuptabscroll.h @@ -46,13 +46,13 @@ class SetupTabScroll : public SetupTab VertContainer *getContainer() const { return mContainer; } - virtual void apply(); + virtual void apply() override; - virtual void cancel(); + virtual void cancel() override; - virtual void externalUpdated(); + virtual void externalUpdated() override; - virtual void action(const gcn::ActionEvent &event A_UNUSED) + virtual void action(const gcn::ActionEvent &event A_UNUSED) override { } int getPreferredFirstItemSize() diff --git a/src/gui/widgets/shopitems.h b/src/gui/widgets/shopitems.h index 978926420..840be4267 100644 --- a/src/gui/widgets/shopitems.h +++ b/src/gui/widgets/shopitems.h @@ -79,7 +79,7 @@ class ShopItems final : public gcn::ListModel /** * Returns the number of items in the shop. */ - int getNumberOfElements() + int getNumberOfElements() override { return static_cast<int>(mShopItems.size()); } bool empty() const @@ -90,7 +90,7 @@ class ShopItems final : public gcn::ListModel * * @param i the index to retrieve */ - std::string getElementAt(int i); + std::string getElementAt(int i) override; /** * Returns the item number i in the shop. diff --git a/src/gui/widgets/shoplistbox.h b/src/gui/widgets/shoplistbox.h index ed5bfa003..906c6b3d3 100644 --- a/src/gui/widgets/shoplistbox.h +++ b/src/gui/widgets/shoplistbox.h @@ -52,12 +52,12 @@ class ShopListBox final : public ListBox /** * Draws the list box. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Returns the height of a row. */ - unsigned int getRowHeight() const + unsigned int getRowHeight() const override { return mRowHeight; } /** @@ -76,9 +76,9 @@ class ShopListBox final : public ListBox */ void setPriceCheck(const bool check); - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; - void mouseExited(gcn::MouseEvent& mouseEvent); + void mouseExited(gcn::MouseEvent& mouseEvent) override; private: void init(); diff --git a/src/gui/widgets/shortcutcontainer.h b/src/gui/widgets/shortcutcontainer.h index 6de2d1963..2551bdb17 100644 --- a/src/gui/widgets/shortcutcontainer.h +++ b/src/gui/widgets/shortcutcontainer.h @@ -55,28 +55,28 @@ class ShortcutContainer : public gcn::Widget, /** * Draws the shortcuts */ - virtual void draw(gcn::Graphics *graphics) = 0; + virtual void draw(gcn::Graphics *graphics) override = 0; /** * Invoked when a widget changes its size. This is used to determine * the new height of the container. */ - virtual void widgetResized(const gcn::Event &event); + virtual void widgetResized(const gcn::Event &event) override; /** * Handles mouse when dragged. */ - virtual void mouseDragged(gcn::MouseEvent &event) = 0; + virtual void mouseDragged(gcn::MouseEvent &event) override = 0; /** * Handles mouse when pressed. */ - virtual void mousePressed(gcn::MouseEvent &event) = 0; + virtual void mousePressed(gcn::MouseEvent &event) override = 0; /** * Handles mouse release. */ - virtual void mouseReleased(gcn::MouseEvent &event) = 0; + virtual void mouseReleased(gcn::MouseEvent &event) override = 0; int getMaxItems() const { return mMaxItems; } diff --git a/src/gui/widgets/slider.h b/src/gui/widgets/slider.h index 494039c73..3d304ad3a 100644 --- a/src/gui/widgets/slider.h +++ b/src/gui/widgets/slider.h @@ -59,7 +59,7 @@ class Slider final : public gcn::Slider /** * Draws the slider. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Draws the marker. @@ -69,14 +69,14 @@ class Slider final : public gcn::Slider /** * Called when the mouse enteres the widget area. */ - void mouseEntered(gcn::MouseEvent& event); + void mouseEntered(gcn::MouseEvent& event) override; /** * Called when the mouse leaves the widget area. */ - void mouseExited(gcn::MouseEvent& event); + void mouseExited(gcn::MouseEvent& event) override; - void keyPressed(gcn::KeyEvent& keyEvent); + void keyPressed(gcn::KeyEvent& keyEvent) override; enum SLIDER_ENUM { @@ -98,10 +98,6 @@ class Slider final : public gcn::Slider void init(); static ImageRect buttons[2]; - //*hStart, *hMid, *hEnd, *hGrip; -// static Image *vStart, *vMid, *vEnd, *vGrip; -// static Image *hStartHi, *hMidHi, *hEndHi, *hGripHi; -// static Image *vStartHi, *vMidHi, *vEndHi, *vGripHi; bool mHasMouse; static float mAlpha; static int mInstances; diff --git a/src/gui/widgets/sliderlist.h b/src/gui/widgets/sliderlist.h index 76dbc012c..f310ea27a 100644 --- a/src/gui/widgets/sliderlist.h +++ b/src/gui/widgets/sliderlist.h @@ -45,15 +45,15 @@ class SliderList final : public Container, void updateAlpha(); - void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent); + void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override; - void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent); + void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override; void resize(); - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; void setSelectedString(std::string str); diff --git a/src/gui/widgets/spellshortcutcontainer.h b/src/gui/widgets/spellshortcutcontainer.h index 570b8b263..09c60624a 100644 --- a/src/gui/widgets/spellshortcutcontainer.h +++ b/src/gui/widgets/spellshortcutcontainer.h @@ -52,28 +52,28 @@ class SpellShortcutContainer final : public ShortcutContainer /** * Draws the items. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event); + void mouseDragged(gcn::MouseEvent &event) override; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; /** * Handles mouse release. */ - void mouseReleased(gcn::MouseEvent &event); + void mouseReleased(gcn::MouseEvent &event) override; - void widgetHidden(const gcn::Event &event); + void widgetHidden(const gcn::Event &event) override; - void mouseExited(gcn::MouseEvent &event); + void mouseExited(gcn::MouseEvent &event) override; - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; private: bool mSpellClicked; diff --git a/src/gui/widgets/tab.h b/src/gui/widgets/tab.h index a8ff5eb3d..6519d5847 100644 --- a/src/gui/widgets/tab.h +++ b/src/gui/widgets/tab.h @@ -49,7 +49,7 @@ class Tab : public gcn::Tab, public gcn::WidgetListener /** * Draw the tabbed area. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Set the normal color for the tab's text. @@ -90,9 +90,9 @@ class Tab : public gcn::Tab, public gcn::WidgetListener int getFlash() const { return mFlash; } - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; - void widgetMoved(const gcn::Event &event); + void widgetMoved(const gcn::Event &event) override; void setLabelFont(gcn::Font *const font); @@ -101,6 +101,7 @@ class Tab : public gcn::Tab, public gcn::WidgetListener protected: friend class TabbedArea; + virtual void setCurrent() { } diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index a616a9935..65eb09447 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -50,7 +50,7 @@ class TabbedArea final : public gcn::TabbedArea, public gcn::WidgetListener /** * Draw the tabbed area. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Return how many tabs have been created. @@ -84,7 +84,7 @@ class TabbedArea final : public gcn::TabbedArea, public gcn::WidgetListener * @param tab The tab widget for the tab. * @param widget The widget to view when the tab is selected. */ - void addTab(gcn::Tab* tab, gcn::Widget* widget); + void addTab(gcn::Tab* tab, gcn::Widget* widget) override; /** * Add a tab. Overridden since it needs to create an instance of Tab @@ -98,25 +98,25 @@ class TabbedArea final : public gcn::TabbedArea, public gcn::WidgetListener /** * Overload the remove tab function as it's broken in guichan 0.8. */ - void removeTab(gcn::Tab *tab); + void removeTab(gcn::Tab *tab) override; void removeAll(); /** * Overload the logic function since it's broken in guichan 0.8. */ - void logic(); + void logic() override; int getContainerHeight() const { return mWidgetContainer->getHeight(); } - void setSelectedTab(gcn::Tab *tab); + void setSelectedTab(gcn::Tab *tab) override; void setSelectedTabByPos(int tab); void setSelectedTabByName(const std::string &name); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; /* void moveLeft(gcn::Tab *tab); @@ -125,11 +125,11 @@ class TabbedArea final : public gcn::TabbedArea, public gcn::WidgetListener */ void adjustTabPositions(); - void action(const gcn::ActionEvent& actionEvent); + void action(const gcn::ActionEvent& actionEvent) override; // Inherited from MouseListener - void mousePressed(gcn::MouseEvent &mouseEvent); + void mousePressed(gcn::MouseEvent &mouseEvent) override; void enableScrollButtons(const bool enable); @@ -148,7 +148,7 @@ class TabbedArea final : public gcn::TabbedArea, public gcn::WidgetListener void fixSize() { adjustSize(); } - void keyPressed(gcn::KeyEvent& keyEvent); + void keyPressed(gcn::KeyEvent& keyEvent) override; void setBlockSwitching(bool b) { mBlockSwitching = b; } diff --git a/src/gui/widgets/tablemodel.h b/src/gui/widgets/tablemodel.h index 4e3938038..6af6d2425 100644 --- a/src/gui/widgets/tablemodel.h +++ b/src/gui/widgets/tablemodel.h @@ -142,11 +142,11 @@ public: virtual int getRows() const; virtual int getColumns() const; - virtual int getRowHeight() const; + virtual int getRowHeight() const override; virtual int getWidth() const; virtual int getHeight() const; virtual int getColumnWidth(int index) const; - virtual gcn::Widget *getElementAt(int row, int column) const; + virtual gcn::Widget *getElementAt(int row, int column) const override; protected: int mRows, mColumns; diff --git a/src/gui/widgets/tabstrip.h b/src/gui/widgets/tabstrip.h index fac0fc502..efdeda657 100644 --- a/src/gui/widgets/tabstrip.h +++ b/src/gui/widgets/tabstrip.h @@ -34,9 +34,9 @@ class TabStrip final : public WidgetGroup TabStrip(const int height, const int spacing = 0); - gcn::Widget *createWidget(const std::string &name); + gcn::Widget *createWidget(const std::string &name) override; - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; }; #endif diff --git a/src/gui/widgets/textbox.h b/src/gui/widgets/textbox.h index a95fd118a..61cf6f665 100644 --- a/src/gui/widgets/textbox.h +++ b/src/gui/widgets/textbox.h @@ -57,14 +57,14 @@ class TextBox final : public gcn::TextBox /** * Draws the text. */ - inline void draw(gcn::Graphics *graphics) + inline void draw(gcn::Graphics *graphics) override { if (mTextColor) mForegroundColor = *mTextColor; gcn::TextBox::draw(graphics); } - void keyPressed(gcn::KeyEvent& keyEvent); + void keyPressed(gcn::KeyEvent& keyEvent) override; private: int mMinWidth; diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h index 12a101b0e..72d679052 100644 --- a/src/gui/widgets/textfield.h +++ b/src/gui/widgets/textfield.h @@ -52,7 +52,7 @@ class TextField : public gcn::TextField /** * Draws the text field. */ - virtual void draw(gcn::Graphics *graphics); + virtual void draw(gcn::Graphics *graphics) override; /** * Update the alpha value to the graphic components. @@ -62,7 +62,7 @@ class TextField : public gcn::TextField /** * Draws the background and border. */ - void drawFrame(gcn::Graphics *graphics); + void drawFrame(gcn::Graphics *graphics) override; /** * Determine whether the field should be numeric or not @@ -81,7 +81,7 @@ class TextField : public gcn::TextField /** * Processes one keypress. */ - void keyPressed(gcn::KeyEvent &keyEvent); + void keyPressed(gcn::KeyEvent &keyEvent) override; /** * Set the minimum value for a range diff --git a/src/gui/widgets/textpreview.h b/src/gui/widgets/textpreview.h index e116e939b..0c127cba0 100644 --- a/src/gui/widgets/textpreview.h +++ b/src/gui/widgets/textpreview.h @@ -97,7 +97,7 @@ class TextPreview final : public gcn::Widget * * @param graphics graphics to draw into */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Set opacity for this widget (whether or not to show the background diff --git a/src/gui/widgets/tradetab.h b/src/gui/widgets/tradetab.h index a31376263..55e6550cb 100644 --- a/src/gui/widgets/tradetab.h +++ b/src/gui/widgets/tradetab.h @@ -35,13 +35,13 @@ class TradeTab final : public ChatTab ~TradeTab(); - int getType() const + int getType() const override { return ChatTab::TAB_TRADE; } - void saveToLogFile(std::string &msg); + void saveToLogFile(std::string &msg) override; protected: - void handleInput(const std::string &msg); + void handleInput(const std::string &msg) override; }; extern TradeTab *tradeChatTab; diff --git a/src/gui/widgets/vertcontainer.h b/src/gui/widgets/vertcontainer.h index 2c9087db2..e8c1da82f 100644 --- a/src/gui/widgets/vertcontainer.h +++ b/src/gui/widgets/vertcontainer.h @@ -46,7 +46,7 @@ class VertContainer final : public Container, public gcn::WidgetListener virtual void clear(); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; private: std::vector<gcn::Widget*> mResizableWidgets; diff --git a/src/gui/widgets/whispertab.h b/src/gui/widgets/whispertab.h index 2a8ca1ab0..502d20efe 100644 --- a/src/gui/widgets/whispertab.h +++ b/src/gui/widgets/whispertab.h @@ -36,15 +36,15 @@ class WhisperTab final : public ChatTab const std::string &getNick() const { return mNick; } - void showHelp(); + void showHelp() override; bool handleCommand(const std::string &type, - const std::string &args); + const std::string &args) override; - int getType() const + int getType() const override { return ChatTab::TAB_WHISPER; } - void saveToLogFile(std::string &msg); + void saveToLogFile(std::string &msg) override; void setWhisperTabColors(); @@ -53,7 +53,7 @@ class WhisperTab final : public ChatTab protected: friend class ChatWindow; - void getAutoCompleteList(StringVect &names) const; + void getAutoCompleteList(StringVect &names) const override; /** * Constructor. * @@ -63,9 +63,9 @@ class WhisperTab final : public ChatTab ~WhisperTab(); - void handleInput(const std::string &msg); + void handleInput(const std::string &msg) override; - void handleCommand(const std::string &msg); + void handleCommand(const std::string &msg) override; private: std::string mNick; diff --git a/src/gui/widgets/widgetgroup.h b/src/gui/widgets/widgetgroup.h index ad2ee4e64..27d1a7357 100644 --- a/src/gui/widgets/widgetgroup.h +++ b/src/gui/widgets/widgetgroup.h @@ -38,13 +38,14 @@ class WidgetGroup : public Container, virtual void addButton(std::string text, std::string tag); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - virtual void add(gcn::Widget *const widget, const int spacing); + virtual void add(gcn::Widget *const widget, + const int spacing); virtual void clear(); - void widgetResized(const gcn::Event &event); + void widgetResized(const gcn::Event &event) override; virtual Widget *createWidget(const std::string &name) = 0; diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index fdcfc23de..7ffa1eb2d 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -74,7 +74,7 @@ class Window : public gcn::Window, private gcn::WidgetListener /** * Draws the window. */ - void draw(gcn::Graphics *graphics); + void draw(gcn::Graphics *graphics) override; /** * Sets the size of this window. @@ -108,14 +108,14 @@ class Window : public gcn::Window, private gcn::WidgetListener /** * Called whenever the widget changes size. */ - virtual void widgetResized(const gcn::Event &event); + virtual void widgetResized(const gcn::Event &event) override; - virtual void widgetMoved(const gcn::Event& event); + virtual void widgetMoved(const gcn::Event& event) override; /** * Called whenever the widget is hidden. */ - virtual void widgetHidden(const gcn::Event &event); + virtual void widgetHidden(const gcn::Event &event) override; /** * Sets whether or not the window has a close button. @@ -247,31 +247,31 @@ class Window : public gcn::Window, private gcn::WidgetListener /** * Starts window resizing when appropriate. */ - void mousePressed(gcn::MouseEvent &event); + void mousePressed(gcn::MouseEvent &event) override; /** * Implements window resizing and makes sure the window is not * dragged/resized outside of the screen. */ - void mouseDragged(gcn::MouseEvent &event); + void mouseDragged(gcn::MouseEvent &event) override; /** * Implements custom cursor image changing context, based on mouse * relative position. */ - void mouseMoved(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; /** * When the mouse button has been let go, this ensures that the mouse * custom cursor is restored back to it's standard image. */ - void mouseReleased(gcn::MouseEvent &event); + void mouseReleased(gcn::MouseEvent &event) override; /** * When the mouse leaves the window this ensures that the custom cursor * is restored back to it's standard image. */ - void mouseExited(gcn::MouseEvent &event); + void mouseExited(gcn::MouseEvent &event) override; /** * Sets the name of the window. This is not the window title. diff --git a/src/gui/widgets/windowcontainer.h b/src/gui/widgets/windowcontainer.h index a2d560cbb..e1b74be1c 100644 --- a/src/gui/widgets/windowcontainer.h +++ b/src/gui/widgets/windowcontainer.h @@ -40,7 +40,7 @@ class WindowContainer : public Container * Do GUI logic. This functions adds automatic deletion of objects that * volunteered to be deleted. */ - void logic(); + void logic() override; /** * Schedule a widget for deletion. It will be deleted at the start of diff --git a/src/gui/windowmenu.h b/src/gui/windowmenu.h index 1a2956df1..1a869c41b 100644 --- a/src/gui/windowmenu.h +++ b/src/gui/windowmenu.h @@ -55,15 +55,13 @@ class WindowMenu final : public Container, ~WindowMenu(); - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; -// void valueChanged(const gcn::SelectionEvent &event); + void mousePressed(gcn::MouseEvent &event) override; - void mousePressed(gcn::MouseEvent &event); + void mouseMoved(gcn::MouseEvent &event) override; - void mouseMoved(gcn::MouseEvent &event); - - void mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED); + void mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED) override; std::map <std::string, gcn::Button*> &getButtonNames() { return mButtonNames; } @@ -77,7 +75,7 @@ class WindowMenu final : public Container, void saveButtons(); - void optionChanged(const std::string &name); + void optionChanged(const std::string &name) override; protected: void drawChildren(gcn::Graphics* graphics); diff --git a/src/gui/worldselectdialog.h b/src/gui/worldselectdialog.h index 30500d311..ba1a41056 100644 --- a/src/gui/worldselectdialog.h +++ b/src/gui/worldselectdialog.h @@ -66,9 +66,9 @@ class WorldSelectDialog final : public Window, public gcn::ActionListener, /** * Called when receiving actions from the widgets. */ - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; - void keyPressed(gcn::KeyEvent &keyEvent); + void keyPressed(gcn::KeyEvent &keyEvent) override; private: WorldListModel *mWorldListModel; diff --git a/src/guichan/include/guichan/widgets/button.hpp b/src/guichan/include/guichan/widgets/button.hpp index 4382f3f7e..290ff0258 100644 --- a/src/guichan/include/guichan/widgets/button.hpp +++ b/src/guichan/include/guichan/widgets/button.hpp @@ -148,13 +148,13 @@ namespace gcn // Inherited from MouseListener - virtual void mousePressed(MouseEvent& mouseEvent); + virtual void mousePressed(MouseEvent& mouseEvent) override; - virtual void mouseEntered(MouseEvent& mouseEvent); + virtual void mouseEntered(MouseEvent& mouseEvent) override; - virtual void mouseExited(MouseEvent& mouseEvent); + virtual void mouseExited(MouseEvent& mouseEvent) override; - virtual void mouseDragged(MouseEvent& mouseEvent); + virtual void mouseDragged(MouseEvent& mouseEvent) override; protected: /** diff --git a/src/guichan/include/guichan/widgets/checkbox.hpp b/src/guichan/include/guichan/widgets/checkbox.hpp index 08aba7aac..529b69ac1 100644 --- a/src/guichan/include/guichan/widgets/checkbox.hpp +++ b/src/guichan/include/guichan/widgets/checkbox.hpp @@ -130,13 +130,13 @@ namespace gcn // Inherited from KeyListener - virtual void keyPressed(KeyEvent& keyEvent); + virtual void keyPressed(KeyEvent& keyEvent) override; // Inherited from MouseListener - virtual void mouseClicked(MouseEvent& mouseEvent); + virtual void mouseClicked(MouseEvent& mouseEvent) override; - virtual void mouseDragged(MouseEvent& mouseEvent); + virtual void mouseDragged(MouseEvent& mouseEvent) override; protected: diff --git a/src/guichan/include/guichan/widgets/dropdown.hpp b/src/guichan/include/guichan/widgets/dropdown.hpp index 62a129082..a2649ca19 100644 --- a/src/guichan/include/guichan/widgets/dropdown.hpp +++ b/src/guichan/include/guichan/widgets/dropdown.hpp @@ -201,20 +201,20 @@ namespace gcn // Inherited from KeyListener - virtual void keyPressed(KeyEvent& keyEvent) = 0; + virtual void keyPressed(KeyEvent& keyEvent) override = 0; // Inherited from MouseListener - virtual void mousePressed(MouseEvent& mouseEvent); + virtual void mousePressed(MouseEvent& mouseEvent) override; - virtual void mouseReleased(MouseEvent& mouseEvent); + virtual void mouseReleased(MouseEvent& mouseEvent) override; - virtual void mouseWheelMovedUp(MouseEvent& mouseEvent); + virtual void mouseWheelMovedUp(MouseEvent& mouseEvent) override; - virtual void mouseWheelMovedDown(MouseEvent& mouseEvent); + virtual void mouseWheelMovedDown(MouseEvent& mouseEvent) override; - virtual void mouseDragged(MouseEvent& mouseEvent); + virtual void mouseDragged(MouseEvent& mouseEvent) override; // Inherited from SelectionListener diff --git a/src/guichan/include/guichan/widgets/listbox.hpp b/src/guichan/include/guichan/widgets/listbox.hpp index ce056acbd..75c32067b 100644 --- a/src/guichan/include/guichan/widgets/listbox.hpp +++ b/src/guichan/include/guichan/widgets/listbox.hpp @@ -197,18 +197,18 @@ namespace gcn // Inherited from KeyListener - virtual void keyPressed(KeyEvent& keyEvent); + virtual void keyPressed(KeyEvent& keyEvent) override; // Inherited from MouseListener - virtual void mousePressed(MouseEvent& mouseEvent); + virtual void mousePressed(MouseEvent& mouseEvent) override; - virtual void mouseWheelMovedUp(MouseEvent& mouseEvent); + virtual void mouseWheelMovedUp(MouseEvent& mouseEvent) override; - virtual void mouseWheelMovedDown(MouseEvent& mouseEvent); + virtual void mouseWheelMovedDown(MouseEvent& mouseEvent) override; - virtual void mouseDragged(MouseEvent& mouseEvent); + virtual void mouseDragged(MouseEvent& mouseEvent) override; protected: diff --git a/src/guichan/include/guichan/widgets/radiobutton.hpp b/src/guichan/include/guichan/widgets/radiobutton.hpp index fc9377787..062040de9 100644 --- a/src/guichan/include/guichan/widgets/radiobutton.hpp +++ b/src/guichan/include/guichan/widgets/radiobutton.hpp @@ -155,14 +155,14 @@ namespace gcn // Inherited from KeyListener - virtual void keyPressed(KeyEvent& keyEvent); + virtual void keyPressed(KeyEvent& keyEvent) override; // Inherited from MouseListener - virtual void mouseClicked(MouseEvent& mouseEvent); + virtual void mouseClicked(MouseEvent& mouseEvent) override; - virtual void mouseDragged(MouseEvent& mouseEvent); + virtual void mouseDragged(MouseEvent& mouseEvent) override; protected: /** diff --git a/src/guichan/include/guichan/widgets/scrollarea.hpp b/src/guichan/include/guichan/widgets/scrollarea.hpp index 84649d530..1abc24e41 100644 --- a/src/guichan/include/guichan/widgets/scrollarea.hpp +++ b/src/guichan/include/guichan/widgets/scrollarea.hpp @@ -349,15 +349,15 @@ namespace gcn // Inherited from MouseListener - virtual void mousePressed(MouseEvent& mouseEvent); + virtual void mousePressed(MouseEvent& mouseEvent) override; - virtual void mouseReleased(MouseEvent& mouseEvent); + virtual void mouseReleased(MouseEvent& mouseEvent) override; - virtual void mouseDragged(MouseEvent& mouseEvent); + virtual void mouseDragged(MouseEvent& mouseEvent) override; - virtual void mouseWheelMovedUp(MouseEvent& mouseEvent); + virtual void mouseWheelMovedUp(MouseEvent& mouseEvent) override; - virtual void mouseWheelMovedDown(MouseEvent& mouseEvent); + virtual void mouseWheelMovedDown(MouseEvent& mouseEvent) override; protected: /** diff --git a/src/guichan/include/guichan/widgets/slider.hpp b/src/guichan/include/guichan/widgets/slider.hpp index bf2ce5937..e2d1f526f 100644 --- a/src/guichan/include/guichan/widgets/slider.hpp +++ b/src/guichan/include/guichan/widgets/slider.hpp @@ -208,18 +208,18 @@ namespace gcn // Inherited from MouseListener. - virtual void mousePressed(MouseEvent& mouseEvent); + virtual void mousePressed(MouseEvent& mouseEvent) override; - virtual void mouseDragged(MouseEvent& mouseEvent); + virtual void mouseDragged(MouseEvent& mouseEvent) override; - virtual void mouseWheelMovedUp(MouseEvent& mouseEvent); + virtual void mouseWheelMovedUp(MouseEvent& mouseEvent) override; - virtual void mouseWheelMovedDown(MouseEvent& mouseEvent); + virtual void mouseWheelMovedDown(MouseEvent& mouseEvent) override; // Inherited from KeyListener - virtual void keyPressed(KeyEvent& keyEvent); + virtual void keyPressed(KeyEvent& keyEvent) override; protected: diff --git a/src/guichan/include/guichan/widgets/tab.hpp b/src/guichan/include/guichan/widgets/tab.hpp index 0e490129f..1936d59b7 100644 --- a/src/guichan/include/guichan/widgets/tab.hpp +++ b/src/guichan/include/guichan/widgets/tab.hpp @@ -124,9 +124,9 @@ namespace gcn // Inherited from MouseListener - virtual void mouseEntered(MouseEvent& mouseEvent); + virtual void mouseEntered(MouseEvent& mouseEvent) override; - virtual void mouseExited(MouseEvent& mouseEvent); + virtual void mouseExited(MouseEvent& mouseEvent) override; protected: /** diff --git a/src/guichan/include/guichan/widgets/tabbedarea.hpp b/src/guichan/include/guichan/widgets/tabbedarea.hpp index ea378d1d6..087d15772 100644 --- a/src/guichan/include/guichan/widgets/tabbedarea.hpp +++ b/src/guichan/include/guichan/widgets/tabbedarea.hpp @@ -211,7 +211,7 @@ namespace gcn // Inherited from KeyListener - virtual void keyPressed(KeyEvent& keyEvent); + virtual void keyPressed(KeyEvent& keyEvent) override; // Inherited from MouseListener diff --git a/src/guichan/include/guichan/widgets/textbox.hpp b/src/guichan/include/guichan/widgets/textbox.hpp index ef12e36fe..f440834c4 100644 --- a/src/guichan/include/guichan/widgets/textbox.hpp +++ b/src/guichan/include/guichan/widgets/textbox.hpp @@ -235,14 +235,14 @@ namespace gcn // Inherited from KeyListener - virtual void keyPressed(KeyEvent& keyEvent); + virtual void keyPressed(KeyEvent& keyEvent) override; // Inherited from MouseListener - virtual void mousePressed(MouseEvent& mouseEvent); + virtual void mousePressed(MouseEvent& mouseEvent) override; - virtual void mouseDragged(MouseEvent& mouseEvent); + virtual void mouseDragged(MouseEvent& mouseEvent) override; protected: /** diff --git a/src/guichan/include/guichan/widgets/textfield.hpp b/src/guichan/include/guichan/widgets/textfield.hpp index c6f2709dd..d747aeac1 100644 --- a/src/guichan/include/guichan/widgets/textfield.hpp +++ b/src/guichan/include/guichan/widgets/textfield.hpp @@ -127,9 +127,9 @@ namespace gcn // Inherited from MouseListener - virtual void mousePressed(MouseEvent& mouseEvent); + virtual void mousePressed(MouseEvent& mouseEvent) override; - virtual void mouseDragged(MouseEvent& mouseEvent); + virtual void mouseDragged(MouseEvent& mouseEvent) override; protected: /** diff --git a/src/guichan/include/guichan/widgets/window.hpp b/src/guichan/include/guichan/widgets/window.hpp index a9138609b..3949d9f59 100644 --- a/src/guichan/include/guichan/widgets/window.hpp +++ b/src/guichan/include/guichan/widgets/window.hpp @@ -188,11 +188,11 @@ namespace gcn // Inherited from MouseListener - virtual void mousePressed(MouseEvent& mouseEvent); + virtual void mousePressed(MouseEvent& mouseEvent) override; - virtual void mouseDragged(MouseEvent& mouseEvent); + virtual void mouseDragged(MouseEvent& mouseEvent) override; - virtual void mouseReleased(MouseEvent& mouseEvent); + virtual void mouseReleased(MouseEvent& mouseEvent) override; protected: /** diff --git a/src/guild.h b/src/guild.h index d54d4581f..76c077017 100644 --- a/src/guild.h +++ b/src/guild.h @@ -48,7 +48,7 @@ public: void setPos(const int pos) { mPos = pos; } - std::string getAdditionString() const; + std::string getAdditionString() const override; protected: friend class Guild; @@ -143,10 +143,10 @@ public: * Get size of members list. * @return Returns the number of members in the guild. */ - int getNumberOfElements() + int getNumberOfElements() override { return static_cast<int>(mMembers.size()); } - Avatar *getAvatarAt(const int i); + Avatar *getAvatarAt(const int i) override; /** * Get whether user can invite users to this guild. diff --git a/src/imageparticle.h b/src/imageparticle.h index 7196748fe..df1f5bdf1 100644 --- a/src/imageparticle.h +++ b/src/imageparticle.h @@ -52,7 +52,7 @@ class ImageParticle : public Particle /** * Draws the particle image */ - virtual bool draw(Graphics *graphics, int offsetX, int offsetY) const; + virtual bool draw(Graphics *graphics, int offsetX, int offsetY) const override; static std::map<std::string, int> imageParticleCountByName; protected: diff --git a/src/imagesprite.h b/src/imagesprite.h index 3f5ba6db6..fd5bcd239 100644 --- a/src/imagesprite.h +++ b/src/imagesprite.h @@ -35,39 +35,40 @@ public: ~ImageSprite(); - bool reset() + bool reset() override { return false; } - bool play(std::string action A_UNUSED) + bool play(std::string action A_UNUSED) override { return false; } - bool update(int time A_UNUSED) + bool update(int time A_UNUSED) override { return false; } - bool draw(Graphics* graphics, int posX, int posY) const; + bool draw(Graphics* graphics, int posX, int posY) const override; - int getWidth() const + int getWidth() const override { return mImage ? mImage->getWidth() : 0; } - int getHeight() const + int getHeight() const override { return mImage ? mImage->getHeight() : 0; } const Image* getImage() const { return mImage; } - virtual bool setSpriteDirection(const SpriteDirection direction A_UNUSED) + virtual bool setSpriteDirection(const SpriteDirection + direction A_UNUSED) override { return false; } int getNumberOfLayers() const { return 1; } - unsigned int getCurrentFrame() const + unsigned int getCurrentFrame() const override { return 0; } - unsigned int getFrameCount() const + unsigned int getFrameCount() const override { return 1; } - bool updateNumber(const unsigned num A_UNUSED) + bool updateNumber(const unsigned num A_UNUSED) override { return false; } private: diff --git a/src/localplayer.h b/src/localplayer.h index cfd2902d2..79c9b9086 100644 --- a/src/localplayer.h +++ b/src/localplayer.h @@ -46,7 +46,7 @@ struct SkillInfo; class AwayListener final : public gcn::ActionListener { public: - void action(const gcn::ActionEvent &event); + void action(const gcn::ActionEvent &event) override; }; /** @@ -81,11 +81,12 @@ class LocalPlayer final : public Being, */ ~LocalPlayer(); - virtual void logic(); + virtual void logic() override; void slowLogic(); - virtual void setAction(const Action &action, const int attackType = 0); + virtual void setAction(const Action &action, + const int attackType = 0) override; /** * Compute the next pathnode location when walking using keyboard. @@ -99,7 +100,7 @@ class LocalPlayer final : public Being, * Also, when specified, it picks up an item at the end of a path * or attack target. */ - virtual void nextTile() + virtual void nextTile() override { nextTile(0); } virtual void nextTile(unsigned char dir); @@ -123,7 +124,7 @@ class LocalPlayer final : public Being, * Called when an ActorSprite has been destroyed. * @param actorSprite the ActorSprite being destroyed. */ - void actorSpriteDestroyed(const ActorSprite &actorSprite); + void actorSpriteDestroyed(const ActorSprite &actorSprite) override; /** * Gets the attack range. @@ -204,7 +205,7 @@ class LocalPlayer final : public Being, const unsigned char color, const int floorItemId, const unsigned char fail); - int getLevel() const; + int getLevel() const override; int getTargetTime(); @@ -395,9 +396,10 @@ class LocalPlayer final : public Being, /** * Called when a option (set with config.addListener()) is changed */ - void optionChanged(const std::string &value); + void optionChanged(const std::string &value) override; - void processEvent(Channels channel, const DepricatedEvent &event); + void processEvent(Channels channel, + const DepricatedEvent &event) override; /** * set a following player. @@ -477,7 +479,7 @@ class LocalPlayer final : public Being, void resetYellowBar(); - virtual unsigned char getWalkMask() const; + virtual unsigned char getWalkMask() const override; void saveHomes(); @@ -520,7 +522,7 @@ class LocalPlayer final : public Being, std::string getGameModifiersString(); protected: - void updateCoords(); + void updateCoords() override; /** Whether or not the name settings have changed */ bool mUpdateName; @@ -351,7 +351,7 @@ class Map final : public Properties, public ConfigListener */ TileAnimation *getAnimationForGid(const int gid) const; - void optionChanged(const std::string &value); + void optionChanged(const std::string &value) override; MapItem *findPortalXY(const int x, const int y) const; diff --git a/src/maplayer.h b/src/maplayer.h index 1042b2a87..355ae3f80 100644 --- a/src/maplayer.h +++ b/src/maplayer.h @@ -156,7 +156,7 @@ class MapLayer final: public ConfigListener // void getTileInfo(int x, int y, int &width, int &cnt) const; - void optionChanged(const std::string &value); + void optionChanged(const std::string &value) override; int getTileDrawWidth(const Image *img, const int endX, int &width) const; diff --git a/src/net/ea/gamehandler.h b/src/net/ea/gamehandler.h index ba68c710e..969abbbbb 100644 --- a/src/net/ea/gamehandler.h +++ b/src/net/ea/gamehandler.h @@ -38,7 +38,7 @@ class GameHandler : public Net::GameHandler, public Listener GameHandler(); virtual void processEvent(Channels channel, - const DepricatedEvent &event); + const DepricatedEvent &event) override; virtual void who(); diff --git a/src/net/ea/gui/guildtab.h b/src/net/ea/gui/guildtab.h index 6ccf70903..07b9831ec 100644 --- a/src/net/ea/gui/guildtab.h +++ b/src/net/ea/gui/guildtab.h @@ -38,21 +38,22 @@ class GuildTab : public ChatTab ~GuildTab(); - bool handleCommand(const std::string &type, const std::string &args); + bool handleCommand(const std::string &type, + const std::string &args) override; - void showHelp(); + void showHelp() override; - void saveToLogFile(std::string &msg); + void saveToLogFile(std::string &msg) override; - int getType() const + int getType() const override { return ChatTab::TAB_GUILD; } - void playNewMessageSound(); + void playNewMessageSound() override; protected: - void handleInput(const std::string &msg); + void handleInput(const std::string &msg) override; - void getAutoCompleteList(StringVect &names) const; + void getAutoCompleteList(StringVect &names) const override; }; } // namespace Ea diff --git a/src/net/ea/gui/partytab.h b/src/net/ea/gui/partytab.h index a92f6e207..7b503fd71 100644 --- a/src/net/ea/gui/partytab.h +++ b/src/net/ea/gui/partytab.h @@ -38,21 +38,22 @@ class PartyTab : public ChatTab ~PartyTab(); - void showHelp(); + void showHelp() override; - bool handleCommand(const std::string &type, const std::string &args); + bool handleCommand(const std::string &type, + const std::string &args) override; - int getType() const + int getType() const override { return ChatTab::TAB_PARTY; } - void saveToLogFile(std::string &msg); + void saveToLogFile(std::string &msg) override; - void playNewMessageSound(); + void playNewMessageSound() override; protected: - void handleInput(const std::string &msg); + void handleInput(const std::string &msg) override; - virtual void getAutoCompleteList(StringVect&) const; + virtual void getAutoCompleteList(StringVect&) const override; }; extern PartyTab *partyTab; diff --git a/src/net/eathena/generalhandler.h b/src/net/eathena/generalhandler.h index 4c7965c4a..85c220a79 100644 --- a/src/net/eathena/generalhandler.h +++ b/src/net/eathena/generalhandler.h @@ -53,7 +53,8 @@ class GeneralHandler : public MessageHandler, public Net::GeneralHandler, void clearHandlers(); - void processEvent(Channels channel, const DepricatedEvent &event); + void processEvent(Channels channel, + const DepricatedEvent &event) override; void reloadPartially(); diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h index 88a0331d7..a296d6ad5 100644 --- a/src/net/tmwa/generalhandler.h +++ b/src/net/tmwa/generalhandler.h @@ -53,7 +53,8 @@ class GeneralHandler : public MessageHandler, public Net::GeneralHandler, void clearHandlers(); - void processEvent(Channels channel, const DepricatedEvent &event); + void processEvent(Channels channel, + const DepricatedEvent &event) override; void reloadPartially(); diff --git a/src/normalopenglgraphics.h b/src/normalopenglgraphics.h index a70b153b5..b2cb90e67 100644 --- a/src/normalopenglgraphics.h +++ b/src/normalopenglgraphics.h @@ -48,7 +48,7 @@ class NormalOpenGLGraphics final : public Graphics bool setVideoMode(const int w, const int h, const int bpp, const bool fs, const bool hwaccel, - const bool resize, const bool noFrame); + const bool resize, const bool noFrame) override; /** @@ -58,7 +58,7 @@ class NormalOpenGLGraphics final : public Graphics int dstX, int dstY, const int width, const int height, const int desiredWidth, const int desiredHeight, - const bool useColor); + const bool useColor) override; /** * Used to get the smooth rescale option over the standard function. @@ -71,7 +71,7 @@ class NormalOpenGLGraphics final : public Graphics void drawImagePattern(const Image *const image, const int x, const int y, - const int w, const int h); + const int w, const int h) override; /** * Draw a pattern based on a rescaled version of the given image... @@ -80,21 +80,21 @@ class NormalOpenGLGraphics final : public Graphics const int x, const int y, const int w, const int h, const int scaledWidth, - const int scaledHeight); + const int scaledHeight) override; void calcImagePattern(GraphicsVertexes *const vert, const Image *const image, const int x, const int y, - const int w, const int h); + const int w, const int h) override; - void calcTile(ImageVertexes *const vert, int x, int y); + void calcTile(ImageVertexes *const vert, int x, int y) override; - void drawTile(const ImageVertexes *const vert); + void drawTile(const ImageVertexes *const vert) override; void drawImagePattern2(GraphicsVertexes *const vert, - const Image *const image); + const Image *const image) override; - void updateScreen(); + void updateScreen() override; void _beginDraw(); void _endDraw(); @@ -130,19 +130,19 @@ class NormalOpenGLGraphics final : public Graphics void drawLineArrayf(int size); - void initArrays(); + void initArrays() override; static void dumpSettings(); /** * Takes a screenshot and returns it as SDL surface. */ - SDL_Surface *getScreenshot(); + SDL_Surface *getScreenshot() override; - void prepareScreenshot(); + void prepareScreenshot() override; bool drawNet(const int x1, const int y1, const int x2, const int y2, - const int width, const int height); + const int width, const int height) override; int getMemoryUsage(); @@ -157,7 +157,7 @@ class NormalOpenGLGraphics final : public Graphics int srcX, int srcY, int dstX, int dstY, const int width, const int height, - const bool useColor); + const bool useColor) override; void setTexturingAndBlending(bool enable); diff --git a/src/particle.h b/src/particle.h index 04a1b3e85..fc0090c61 100644 --- a/src/particle.h +++ b/src/particle.h @@ -105,18 +105,18 @@ class Particle : public Actor /** * Draws the particle image. */ - virtual bool draw(Graphics *graphics, int offsetX, int offsetY) const; + virtual bool draw(Graphics *graphics, int offsetX, int offsetY) const override; /** * Necessary for sorting with the other sprites. */ - virtual int getPixelY() const + virtual int getPixelY() const override { return static_cast<int>(mPos.y) - 16; } /** * Necessary for sorting with the other sprites for sorting only. */ - virtual int getSortPixelY() const + virtual int getSortPixelY() const override { return static_cast<int>(mPos.y) - 16; } /** @@ -284,7 +284,7 @@ class Particle : public Actor virtual float getAlpha() const { return 1.0f; } - virtual void setAlpha(const float alpha A_UNUSED) + virtual void setAlpha(const float alpha A_UNUSED) override { } virtual void setDeathEffect(const std::string &effectFile, diff --git a/src/particlecontainer.h b/src/particlecontainer.h index 0f1480094..a40bf1ce9 100644 --- a/src/particlecontainer.h +++ b/src/particlecontainer.h @@ -90,9 +90,9 @@ public: */ void removeLocally(const Particle *const particle); - virtual void clearLocally(); + virtual void clearLocally() override; - virtual void moveTo(const float x, const float y); + virtual void moveTo(const float x, const float y) override; protected: std::list<Particle *> mElements; /**< Contained particle effects */ @@ -120,8 +120,9 @@ public: */ virtual void delLocally(const int index); - virtual void clearLocally(); - virtual void moveTo(const float x, const float y); + virtual void clearLocally() override; + + virtual void moveTo(const float x, const float y) override; protected: std::vector<Particle *> mIndexedElements; diff --git a/src/party.h b/src/party.h index 2d7386f17..e4ae9dbff 100644 --- a/src/party.h +++ b/src/party.h @@ -120,10 +120,10 @@ public: * Get size of members list. * @return Returns the number of members in the party. */ - int getNumberOfElements() + int getNumberOfElements() override { return static_cast<int>(mMembers.size()); } - Avatar *getAvatarAt(const int i); + Avatar *getAvatarAt(const int i) override; /** * Get whether user can invite users to this party. diff --git a/src/playerrelations.cpp b/src/playerrelations.cpp index b163f57b0..7e92feb5f 100644 --- a/src/playerrelations.cpp +++ b/src/playerrelations.cpp @@ -72,7 +72,7 @@ class PlayerConfSerialiser final : public: virtual ConfigurationObject *writeConfigItem( std::pair<std::string, PlayerRelation *> value, - ConfigurationObject *cobj) + ConfigurationObject *cobj) override { if (!cobj || !value.second) return nullptr; @@ -85,7 +85,7 @@ public: virtual std::map<std::string, PlayerRelation *> * readConfigItem(ConfigurationObject *const cobj, - std::map<std::string, PlayerRelation *> *container) + std::map<std::string, PlayerRelation *> *container) override { if (!cobj) return container; @@ -474,7 +474,7 @@ public: } virtual void ignore(Being *const being A_UNUSED, - const unsigned int flags A_UNUSED) + const unsigned int flags A_UNUSED) override { } }; @@ -489,7 +489,8 @@ public: mShortName = "dotdotdot"; } - virtual void ignore(Being *const being, const unsigned int flags A_UNUSED) + virtual void ignore(Being *const being, + const unsigned int flags A_UNUSED) override { if (!being) return; @@ -510,7 +511,8 @@ public: mShortName = "blinkname"; } - virtual void ignore(Being *const being, const unsigned int flags A_UNUSED) + virtual void ignore(Being *const being, + const unsigned int flags A_UNUSED) override { if (!being) return; @@ -532,7 +534,8 @@ public: mShortName = shortname; } - virtual void ignore(Being *const being, const unsigned int flags A_UNUSED) + virtual void ignore(Being *const being, + const unsigned int flags A_UNUSED) override { if (!being) return; diff --git a/src/rotationalparticle.h b/src/rotationalparticle.h index d7e8904d4..c873160ec 100644 --- a/src/rotationalparticle.h +++ b/src/rotationalparticle.h @@ -41,7 +41,7 @@ class RotationalParticle final : public ImageParticle ~RotationalParticle(); - virtual bool update(); + virtual bool update() override; private: SimpleAnimation *mAnimation; /**< Used animation for this particle */ diff --git a/src/safeopenglgraphics.h b/src/safeopenglgraphics.h index 72a9485d7..efa9da832 100644 --- a/src/safeopenglgraphics.h +++ b/src/safeopenglgraphics.h @@ -45,7 +45,7 @@ class SafeOpenGLGraphics final : public Graphics bool setVideoMode(const int w, const int h, const int bpp, const bool fs, const bool hwaccel, - const bool resize, const bool noFrame); + const bool resize, const bool noFrame) override; /** * Draws a resclaled version of the image @@ -54,7 +54,7 @@ class SafeOpenGLGraphics final : public Graphics int dstX, int dstY, const int width, const int height, const int desiredWidth, const int desiredHeight, - const bool useColor); + const bool useColor) override; /** * Used to get the smooth rescale option over the standard function. @@ -67,7 +67,7 @@ class SafeOpenGLGraphics final : public Graphics void drawImagePattern(const Image *const image, const int x, const int y, - const int w, const int h); + const int w, const int h) override; /** * Draw a pattern based on a rescaled version of the given image... @@ -76,7 +76,7 @@ class SafeOpenGLGraphics final : public Graphics const int x, const int y, const int w, const int h, const int scaledWidth, - const int scaledHeight); + const int scaledHeight) override; bool calcImageRect(GraphicsVertexes *const vert, const int x, const int y, @@ -89,21 +89,22 @@ class SafeOpenGLGraphics final : public Graphics const Image *const right, const Image *const bottom, const Image *const left, - const Image *const center); + const Image *const center) override; void drawImageRect2(GraphicsVertexes *const vert, - const ImageRect &imgRect); + const ImageRect &imgRect) override; - void calcTile(ImageVertexes *const vert, int x, int y); + void calcTile(ImageVertexes *const vert, int x, int y) override; - void drawTile(const ImageVertexes *const vert); + void drawTile(const ImageVertexes *const vert) override; - void updateScreen(); + void updateScreen() override; void _beginDraw(); void _endDraw(); bool pushClipArea(gcn::Rectangle area); + void popClipArea(); void setColor(const gcn::Color &color); @@ -116,16 +117,16 @@ class SafeOpenGLGraphics final : public Graphics void drawRectangle(const gcn::Rectangle &rect); - void fillRectangle(const gcn::Rectangle &rect); + void fillRectangle(const gcn::Rectangle &rect) override; void setTargetPlane(int width, int height); /** * Takes a screenshot and returns it as SDL surface. */ - SDL_Surface *getScreenshot(); + SDL_Surface *getScreenshot() override; - void prepareScreenshot(); + void prepareScreenshot() override; static void bindTexture(GLenum target, GLuint texture); diff --git a/src/sound.h b/src/sound.h index 9da26c8fe..c3e5e469a 100644 --- a/src/sound.h +++ b/src/sound.h @@ -52,7 +52,7 @@ class Sound final : public ConfigListener Sound(); ~Sound(); - void optionChanged(const std::string &value); + void optionChanged(const std::string &value) override; /** * Installs the sound engine. diff --git a/src/text.h b/src/text.h index 10d85284d..74910f0b1 100644 --- a/src/text.h +++ b/src/text.h @@ -108,7 +108,7 @@ class FlashText final : public Text * Draws the text. */ virtual void draw(gcn::Graphics *const graphics, - const int xOff, const int yOff); + const int xOff, const int yOff) override; private: int mTime; /**< Time left for flashing */ diff --git a/src/textparticle.h b/src/textparticle.h index 892a109b8..6b633fb05 100644 --- a/src/textparticle.h +++ b/src/textparticle.h @@ -38,14 +38,15 @@ class TextParticle final : public Particle /** * Draws the particle image. */ - virtual bool draw(Graphics *graphics, int offsetX, int offsetY) const; + virtual bool draw(Graphics *graphics, + int offsetX, int offsetY) const override; // hack to improve text visibility - virtual int getPixelY() const + virtual int getPixelY() const override { return static_cast<int>(mPos.y + mPos.z); } // hack to improve text visibility (for sorting only) - virtual int getSortPixelY() const + virtual int getSortPixelY() const override { return static_cast<int>(mPos.y + mPos.z); } private: diff --git a/src/variabledata.h b/src/variabledata.h index 90279d28e..483eab951 100644 --- a/src/variabledata.h +++ b/src/variabledata.h @@ -54,7 +54,7 @@ class IntData final : public VariableData int getData() const { return mData; } - int getType() const + int getType() const override { return DATA_INT; } private: @@ -71,7 +71,7 @@ class StringData final : public VariableData const std::string &getData() const { return mData; } - int getType() const + int getType() const override { return DATA_STRING; } private: @@ -88,7 +88,7 @@ class FloatData final : public VariableData double getData() const { return mData; } - int getType() const + int getType() const override { return DATA_FLOAT; } private: @@ -105,7 +105,7 @@ class BoolData final : public VariableData bool getData() const { return mData; } - int getType() const + int getType() const override { return DATA_BOOL; } private: |