summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-28 02:17:35 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-28 02:17:35 +0100
commit91da5b104a0895578a0a2a7debbfb495e50ef4f4 (patch)
treeb6e5342f6b93875cc9b21384f9bdcada405173c6 /src
parentad9036cb9026091ae0d5b0150513a907e092613f (diff)
downloadmana-91da5b104a0895578a0a2a7debbfb495e50ef4f4.tar.gz
mana-91da5b104a0895578a0a2a7debbfb495e50ef4f4.tar.bz2
mana-91da5b104a0895578a0a2a7debbfb495e50ef4f4.tar.xz
mana-91da5b104a0895578a0a2a7debbfb495e50ef4f4.zip
Some more cleanup
Renamed Skill_Tab to SkillTab and got rid of MAX_SLOT, using maxSlot instead.
Diffstat (limited to 'src')
-rw-r--r--src/gui/char_select.cpp62
-rw-r--r--src/gui/skilldialog.cpp58
-rw-r--r--src/gui/skilldialog.h15
3 files changed, 67 insertions, 68 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp
index a0f7230e..bf885de9 100644
--- a/src/gui/char_select.cpp
+++ b/src/gui/char_select.cpp
@@ -19,50 +19,48 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <string>
-
-#include <guichan/font.hpp>
-
-#include "button.h"
-#include "char_select.h"
-#include "confirm_dialog.h"
-#include "label.h"
-#include "ok_dialog.h"
-#include "playerbox.h"
-#include "textfield.h"
+#include "gui/button.h"
+#include "gui/char_select.h"
+#include "gui/confirm_dialog.h"
+#include "gui/label.h"
+#include "gui/ok_dialog.h"
+#include "gui/playerbox.h"
+#include "gui/textfield.h"
#ifdef TMWSERV_SUPPORT
-#include "radiobutton.h"
-#include "slider.h"
+#include "gui/radiobutton.h"
+#include "gui/slider.h"
-#include "unregisterdialog.h"
-#include "changepassworddialog.h"
-#include "changeemaildialog.h"
+#include "gui/unregisterdialog.h"
+#include "gui/changepassworddialog.h"
+#include "gui/changeemaildialog.h"
-#include "../logindata.h"
+#include "logindata.h"
-#include "../net/tmwserv/accountserver/account.h"
-#include "../net/tmwserv/charserverhandler.h"
+#include "net/tmwserv/accountserver/account.h"
+#include "net/tmwserv/charserverhandler.h"
#else
-#include "../net/ea/charserverhandler.h"
+#include "net/ea/charserverhandler.h"
#endif
-#include "widgets/layout.h"
+#include "gui/widgets/layout.h"
-#include "../game.h"
-#include "../localplayer.h"
-#include "../main.h"
-#include "../units.h"
+#include "game.h"
+#include "localplayer.h"
+#include "main.h"
+#include "units.h"
-#include "../net/messageout.h"
+#include "net/messageout.h"
-#include "../resources/colordb.h"
+#include "resources/colordb.h"
-#include "../utils/gettext.h"
-#include "../utils/strprintf.h"
-#include "../utils/stringutils.h"
+#include "utils/gettext.h"
+#include "utils/strprintf.h"
+#include "utils/stringutils.h"
-#define MAX_SLOT 2
+#include <guichan/font.hpp>
+
+#include <string>
// Defined in main.cpp, used here for setting the char create dialog
extern CharServerHandler charServerHandler;
@@ -258,7 +256,7 @@ void CharSelectDialog::action(const gcn::ActionEvent &event)
{
new CharDeleteConfirm(this);
}
- else if (n_character <= MAX_SLOT)
+ else if (n_character <= maxSlot)
{
// Start new character dialog
CharCreateDialog *charCreateDialog =
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp
index 16c983ad..4afd92ac 100644
--- a/src/gui/skilldialog.cpp
+++ b/src/gui/skilldialog.cpp
@@ -19,28 +19,30 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <guichan/widgets/label.hpp>
-#include <guichan/widgets/container.hpp>
-#include <guichan/widgets/icon.hpp>
+#include "gui/skilldialog.h"
+
+#include "gui/icon.h"
+#include "gui/button.h"
+#include "gui/listbox.h"
+#include "gui/scrollarea.h"
+#include "gui/windowcontainer.h"
+#include "gui/progressbar.h"
-#include "skilldialog.h"
+#include "gui/widgets/tabbedarea.h"
-#include "icon.h"
-#include "button.h"
-#include "listbox.h"
-#include "scrollarea.h"
-#include "windowcontainer.h"
-#include "progressbar.h"
+#include "localplayer.h"
-#include "widgets/tabbedarea.h"
+#include "utils/dtor.h"
+#include "utils/gettext.h"
+#include "utils/stringutils.h"
-#include "../localplayer.h"
+#include <guichan/widgets/label.hpp>
+#include <guichan/widgets/container.hpp>
+#include <guichan/widgets/icon.hpp>
-#include "../utils/dtor.h"
-#include "../utils/gettext.h"
-#include "../utils/stringutils.h"
+#include <vector>
-class Skill_Tab : public GCContainer, public gcn::ActionListener
+class SkillTab : public GCContainer, public gcn::ActionListener
{
public:
/**
@@ -51,7 +53,7 @@ class Skill_Tab : public GCContainer, public gcn::ActionListener
/**
* Constructor
*/
- Skill_Tab(const std::string &type);
+ SkillTab(const std::string &type);
/**
* Update this tab
@@ -105,18 +107,18 @@ SkillDialog::SkillDialog():
TabbedArea *panel = new TabbedArea;
panel->setDimension(gcn::Rectangle(5, 5, 270, 420));
- Skill_Tab *tab;
+ SkillTab *tab;
// Add each type of skill tab to the panel
- tab = new Skill_Tab("Weapon");
+ tab = new SkillTab("Weapon");
panel->addTab(_("Weapons"), tab);
mTabs.push_back(tab);
- tab = new Skill_Tab("Magic");
+ tab = new SkillTab("Magic");
panel->addTab(_("Magic"), tab);
mTabs.push_back(tab);
- tab = new Skill_Tab("Craft");
+ tab = new SkillTab("Craft");
panel->addTab(_("Crafts"), tab);
mTabs.push_back(tab);
@@ -153,14 +155,14 @@ void SkillDialog::draw(gcn::Graphics *g)
void SkillDialog::update()
{
- for(std::list<Skill_Tab*>::const_iterator i = mTabs.begin();
+ for(std::list<SkillTab*>::const_iterator i = mTabs.begin();
i != mTabs.end(); ++i)
{
(*i)->update();
}
}
-Skill_Tab::Skill_Tab(const std::string &type): type(type)
+SkillTab::SkillTab(const std::string &type): type(type)
{
setOpaque(false);
setDimension(gcn::Rectangle(0, 0, 270, 420));
@@ -200,7 +202,7 @@ Skill_Tab::Skill_Tab(const std::string &type): type(type)
}
-int Skill_Tab::getSkillNum()
+int SkillTab::getSkillNum()
{
int skillNum = 0;
@@ -222,7 +224,7 @@ int Skill_Tab::getSkillNum()
else return skillNum;
}
-int Skill_Tab::getSkillBegin()
+int SkillTab::getSkillBegin()
{
int skillBegin = 0;
@@ -244,14 +246,14 @@ int Skill_Tab::getSkillBegin()
else return skillBegin;
}
-Icon* Skill_Tab::getIcon(int index)
+Icon* SkillTab::getIcon(int index)
{
int skillBegin = getSkillBegin();
std::string icon = LocalPlayer::getSkillInfo(index + skillBegin).icon;
return new Icon(icon);
}
-void Skill_Tab::updateSkill(int index)
+void SkillTab::updateSkill(int index)
{
int skillBegin = getSkillBegin();
@@ -306,7 +308,7 @@ void Skill_Tab::updateSkill(int index)
}
}
-void Skill_Tab::update()
+void SkillTab::update()
{
int skillNum = getSkillNum();
diff --git a/src/gui/skilldialog.h b/src/gui/skilldialog.h
index b79be800..8d1f6a88 100644
--- a/src/gui/skilldialog.h
+++ b/src/gui/skilldialog.h
@@ -22,20 +22,19 @@
#ifndef SKILL_H
#define SKILL_H
-#include <vector>
-#include <list>
+#include "gui/window.h"
+#include "gui/gccontainer.h"
+
+#include "guichanfwd.h"
#include <guichan/listmodel.hpp>
#include <guichan/actionlistener.hpp>
-#include "window.h"
-#include "gccontainer.h"
-
-#include "../guichanfwd.h"
+#include <list>
class ProgressBar;
class Icon;
-class Skill_Tab;
+class SkillTab;
/**
* The skill dialog.
@@ -71,7 +70,7 @@ class SkillDialog : public Window, public gcn::ActionListener
void draw(gcn::Graphics *g);
private:
- std::list<Skill_Tab*> mTabs;
+ std::list<SkillTab*> mTabs;
};
extern SkillDialog *skillDialog;