diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-05-22 22:56:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-05-22 22:56:46 +0300 |
commit | f9c0a11f184444b82e678b9aea4b14d3982d5201 (patch) | |
tree | 181e29a12dc5b7d56bef4a808a804b9cfe5717b9 /src | |
parent | f3405f599e202d06cfd7aa98559fd64df039242d (diff) | |
download | plus-f9c0a11f184444b82e678b9aea4b14d3982d5201.tar.gz plus-f9c0a11f184444b82e678b9aea4b14d3982d5201.tar.bz2 plus-f9c0a11f184444b82e678b9aea4b14d3982d5201.tar.xz plus-f9c0a11f184444b82e678b9aea4b14d3982d5201.zip |
improve textcommandeditor.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/textcommandeditor.cpp | 47 | ||||
-rw-r--r-- | src/gui/textcommandeditor.h | 8 | ||||
-rw-r--r-- | src/gui/widgets/window.h | 2 |
3 files changed, 19 insertions, 38 deletions
diff --git a/src/gui/textcommandeditor.cpp b/src/gui/textcommandeditor.cpp index 7df02e704..7b3703cfb 100644 --- a/src/gui/textcommandeditor.cpp +++ b/src/gui/textcommandeditor.cpp @@ -22,9 +22,12 @@ #include "gui/textcommandeditor.h" -#include <SDL.h> -#include <SDL_thread.h> -#include <algorithm> +#include "configuration.h" +#include "item.h" +#include "localplayer.h" +#include "main.h" +#include "keyboardconfig.h" +#include "spellmanager.h" #include "gui/chatwindow.h" @@ -38,17 +41,14 @@ #include "gui/widgets/radiobutton.h" #include "gui/widgets/guitable.h" -#include "configuration.h" -#include "item.h" -#include "localplayer.h" -#include "main.h" -#include "keyboardconfig.h" -#include "spellmanager.h" - #include "utils/gettext.h" #include "resources/iteminfo.h" +#include <SDL.h> +#include <SDL_thread.h> +#include <algorithm> + #include "debug.h" class IconsModal final : public gcn::ListModel @@ -68,7 +68,7 @@ public: continue; const ItemInfo &info = (*i->second); - std::string name = info.getName(); + const std::string name = info.getName(); if (name != "unnamed" && !info.getName().empty() && info.getName() != "unnamed") { @@ -86,12 +86,12 @@ public: virtual ~IconsModal() { } - virtual int getNumberOfElements() + virtual int getNumberOfElements() override { return static_cast<int>(mStrings.size()); } - virtual std::string getElementAt(int i) + virtual std::string getElementAt(int i) override { if (i < 0 || i >= getNumberOfElements()) return "???"; @@ -134,12 +134,12 @@ public: virtual ~TargetTypeModel() { } - virtual int getNumberOfElements() + virtual int getNumberOfElements() override { return 3; } - virtual std::string getElementAt(int i) + virtual std::string getElementAt(int i) override { if (i >= getNumberOfElements() || i < 0) return "???"; @@ -153,12 +153,12 @@ public: virtual ~MagicSchoolModel() { } - virtual int getNumberOfElements() + virtual int getNumberOfElements() override { return 6; } - virtual std::string getElementAt(int i) + virtual std::string getElementAt(int i) override { if (i >= getNumberOfElements() || i < 0) return "???"; @@ -325,7 +325,6 @@ TextCommandEditor::~TextCommandEditor() void TextCommandEditor::action(const gcn::ActionEvent &event) { const std::string &eventId = event.getId(); - if (eventId == "magic") { mIsMagicCommand = true; @@ -352,18 +351,6 @@ void TextCommandEditor::action(const gcn::ActionEvent &event) } } -void TextCommandEditor::update() -{ -} - -void TextCommandEditor::updateList() -{ -} - -void TextCommandEditor::reset() -{ -} - void TextCommandEditor::showControls(const bool show) { mManaField->setVisible(show); diff --git a/src/gui/textcommandeditor.h b/src/gui/textcommandeditor.h index 86d1c7c7d..3036c5d5f 100644 --- a/src/gui/textcommandeditor.h +++ b/src/gui/textcommandeditor.h @@ -59,13 +59,7 @@ class TextCommandEditor final : public Window, public gcn::ActionListener void action(const gcn::ActionEvent &event) override; - void update(); - - void updateList(); - - void reset(); - - void scheduleDelete(); + void scheduleDelete() override; private: void showControls(const bool show); diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index 45a70dbeb..8ff32d273 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -248,7 +248,7 @@ class Window : public gcn::Window, * Schedule this window for deletion. It will be deleted at the start * of the next logic update. */ - void scheduleDelete(); + virtual void scheduleDelete(); /** * Starts window resizing when appropriate. |