From f9c0a11f184444b82e678b9aea4b14d3982d5201 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 22 May 2013 22:56:46 +0300 Subject: improve textcommandeditor. --- src/gui/textcommandeditor.cpp | 47 ++++++++++++++++--------------------------- 1 file changed, 17 insertions(+), 30 deletions(-) (limited to 'src/gui/textcommandeditor.cpp') 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 -#include -#include +#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 +#include +#include + #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(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); -- cgit v1.2.3-70-g09d2