summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-09 19:49:14 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-09 19:49:14 +0300
commit7e3bd20e9675202e30fac741f3d3acb4f19b109d (patch)
tree9e12ab198b68e8f6ed0dd2121a72066c7b7053ba /src/gui
parentb9d66c41246fef56e41f600b5523a5ff1a29a1c8 (diff)
downloadmanaplus-7e3bd20e9675202e30fac741f3d3acb4f19b109d.tar.gz
manaplus-7e3bd20e9675202e30fac741f3d3acb4f19b109d.tar.bz2
manaplus-7e3bd20e9675202e30fac741f3d3acb4f19b109d.tar.xz
manaplus-7e3bd20e9675202e30fac741f3d3acb4f19b109d.zip
Small refactoring based on idea from mana commit 30d4b0adf4f17f05d1d62fc3428c896ef1079b6b
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/chatwindow.cpp14
-rw-r--r--src/gui/chatwindow.h2
-rw-r--r--src/gui/inventorywindow.cpp6
-rw-r--r--src/gui/inventorywindow.h2
-rw-r--r--src/gui/killstats.cpp6
-rw-r--r--src/gui/killstats.h2
-rw-r--r--src/gui/ministatus.cpp8
-rw-r--r--src/gui/ministatus.h2
-rw-r--r--src/gui/statuswindow.cpp8
-rw-r--r--src/gui/statuswindow.h2
10 files changed, 26 insertions, 26 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
index 47db83c75..372461b29 100644
--- a/src/gui/chatwindow.cpp
+++ b/src/gui/chatwindow.cpp
@@ -154,7 +154,7 @@ ChatWindow::ChatWindow():
mChatHistoryIndex(0)
{
listen(CHANNEL_NOTICES);
- listen(CHANNEL_ATTRIBUTES);
+ listen(Mana::CHANNEL_ATTRIBUTES);
setWindowName("Chat");
@@ -798,19 +798,19 @@ void ChatWindow::keyPressed(gcn::KeyEvent &event)
addInputText(Temp, false);
}
-void ChatWindow::event(Channels channel, const Mana::Event &event)
+void ChatWindow::event(Mana::Channels channel, const Mana::Event &event)
{
- if (channel == CHANNEL_NOTICES)
+ if (channel == Mana::CHANNEL_NOTICES)
{
- if (event.getName() == EVENT_SERVERNOTICE && localChatTab)
+ if (event.getName() == Mana::EVENT_SERVERNOTICE && localChatTab)
localChatTab->chatLog(event.getString("message"), BY_SERVER);
}
- else if (channel == CHANNEL_ATTRIBUTES)
+ else if (channel == Mana::CHANNEL_ATTRIBUTES)
{
if (!config.getBoolValue("showBattleEvents"))
return;
- if (event.getName() == EVENT_UPDATEATTRIBUTE)
+ if (event.getName() == Mana::EVENT_UPDATEATTRIBUTE)
{
switch (event.getInt("id"))
{
@@ -834,7 +834,7 @@ void ChatWindow::event(Channels channel, const Mana::Event &event)
break;
};
}
- else if (event.getName() == EVENT_UPDATESTAT)
+ else if (event.getName() == Mana::EVENT_UPDATESTAT)
{
if (!config.getBoolValue("showJobExp"))
return;
diff --git a/src/gui/chatwindow.h b/src/gui/chatwindow.h
index d8457d691..d22aea64c 100644
--- a/src/gui/chatwindow.h
+++ b/src/gui/chatwindow.h
@@ -191,7 +191,7 @@ class ChatWindow : public Window,
*/
void mousePressed(gcn::MouseEvent &event);
- void event(Channels channel, const Mana::Event &event);
+ void event(Mana::Channels channel, const Mana::Event &event);
/**
* Scrolls the chat window
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index b897ad4b8..403868cd1 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -78,7 +78,7 @@ InventoryWindow::InventoryWindow(Inventory *inventory):
setWindowName("Inventory");
}
- listen(CHANNEL_ATTRIBUTES);
+ listen(Mana::CHANNEL_ATTRIBUTES);
if (setupWindow)
setupWindow->registerWindowForReset(this);
@@ -493,10 +493,10 @@ void InventoryWindow::close()
}
}
-void InventoryWindow::event(Channels channel _UNUSED_,
+void InventoryWindow::event(Mana::Channels channel _UNUSED_,
const Mana::Event &event)
{
- if (event.getName() == EVENT_UPDATEATTRIBUTE)
+ if (event.getName() == Mana::EVENT_UPDATEATTRIBUTE)
{
int id = event.getInt("id");
if (id == TOTAL_WEIGHT || id == MAX_WEIGHT)
diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h
index de899afb8..63da97173 100644
--- a/src/gui/inventorywindow.h
+++ b/src/gui/inventorywindow.h
@@ -124,7 +124,7 @@ class InventoryWindow : public Window,
void updateDropButton();
- void event(Channels channel, const Mana::Event &event);
+ void event(Mana::Channels channel, const Mana::Event &event);
private:
/**
diff --git a/src/gui/killstats.cpp b/src/gui/killstats.cpp
index e373153e6..1486fdd64 100644
--- a/src/gui/killstats.cpp
+++ b/src/gui/killstats.cpp
@@ -54,7 +54,7 @@ KillStats::KillStats():
setResizable(true);
setDefaultSize(250, 250, 350, 300);
- listen(CHANNEL_ATTRIBUTES);
+ listen(Mana::CHANNEL_ATTRIBUTES);
int xp(PlayerInfo::getAttribute(EXP));
int xpNextLevel(PlayerInfo::getAttribute(EXP_NEEDED));
@@ -409,10 +409,10 @@ void KillStats::validateJacko()
}
}
-void KillStats::event(Channels channel _UNUSED_,
+void KillStats::event(Mana::Channels channel _UNUSED_,
const Mana::Event &event)
{
- if (event.getName() == EVENT_UPDATEATTRIBUTE)
+ if (event.getName() == Mana::EVENT_UPDATEATTRIBUTE)
{
int id = event.getInt("id");
if (id == EXP || id == EXP_NEEDED)
diff --git a/src/gui/killstats.h b/src/gui/killstats.h
index df53aa319..59b1ff653 100644
--- a/src/gui/killstats.h
+++ b/src/gui/killstats.h
@@ -77,7 +77,7 @@ class KillStats : public Window, gcn::ActionListener, public Mana::Listener
void addLog(std::string str);
- void event(Channels channel _UNUSED_,
+ void event(Mana::Channels channel _UNUSED_,
const Mana::Event &event);
private:
diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp
index e0103f080..213693e0a 100644
--- a/src/gui/ministatus.cpp
+++ b/src/gui/ministatus.cpp
@@ -51,7 +51,7 @@ extern volatile int tick_time;
MiniStatusWindow::MiniStatusWindow():
Popup("MiniStatus")
{
- listen(CHANNEL_ATTRIBUTES);
+ listen(Mana::CHANNEL_ATTRIBUTES);
mHpBar = createBar(0, 100, 20, Theme::PROG_HP, "hp bar", _("health bar"));
StatusWindow::updateHPBar(mHpBar);
@@ -209,10 +209,10 @@ void MiniStatusWindow::drawIcons(Graphics *graphics)
}
}
-void MiniStatusWindow::event(Channels channel _UNUSED_,
+void MiniStatusWindow::event(Mana::Channels channel _UNUSED_,
const Mana::Event &event)
{
- if (event.getName() == EVENT_UPDATEATTRIBUTE)
+ if (event.getName() == Mana::EVENT_UPDATEATTRIBUTE)
{
int id = event.getInt("id");
if (id == HP || id == MAX_HP)
@@ -226,7 +226,7 @@ void MiniStatusWindow::event(Channels channel _UNUSED_,
else if (id == MONEY)
StatusWindow::updateMoneyBar(mMoneyBar);
}
- else if (event.getName() == EVENT_UPDATESTAT)
+ else if (event.getName() == Mana::EVENT_UPDATESTAT)
{
StatusWindow::updateMPBar(mMpBar);
StatusWindow::updateJobBar(mJobBar);
diff --git a/src/gui/ministatus.h b/src/gui/ministatus.h
index 9a88a3d7d..a2648d44b 100644
--- a/src/gui/ministatus.h
+++ b/src/gui/ministatus.h
@@ -66,7 +66,7 @@ class MiniStatusWindow : public Popup,
void drawIcons(Graphics *graphics);
- void event(Channels channel, const Mana::Event &event);
+ void event(Mana::Channels channel, const Mana::Event &event);
void updateStatus();
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp
index 19ec14a50..82c97ff43 100644
--- a/src/gui/statuswindow.cpp
+++ b/src/gui/statuswindow.cpp
@@ -114,7 +114,7 @@ class ChangeDisplay : public AttrDisplay, gcn::ActionListener
StatusWindow::StatusWindow():
Window(player_node ? player_node->getName() : "?")
{
- listen(CHANNEL_ATTRIBUTES);
+ listen(Mana::CHANNEL_ATTRIBUTES);
setWindowName("Status");
setupWindow->registerWindowForReset(this);
@@ -260,14 +260,14 @@ StatusWindow::StatusWindow():
mLvlLabel->adjustSize();
}
-void StatusWindow::event(Channels channel _UNUSED_,
+void StatusWindow::event(Mana::Channels channel _UNUSED_,
const Mana::Event &event)
{
static bool blocked = false;
if (blocked)
return;
- if (event.getName() == EVENT_UPDATEATTRIBUTE)
+ if (event.getName() == Mana::EVENT_UPDATEATTRIBUTE)
{
switch(event.getInt("id"))
{
@@ -326,7 +326,7 @@ void StatusWindow::event(Channels channel _UNUSED_,
break;
}
}
- else if (event.getName() == EVENT_UPDATESTAT)
+ else if (event.getName() == Mana::EVENT_UPDATESTAT)
{
int id = event.getInt("id");
if (id == Net::getPlayerHandler()->getJobLocation())
diff --git a/src/gui/statuswindow.h b/src/gui/statuswindow.h
index f9837ba26..79126a095 100644
--- a/src/gui/statuswindow.h
+++ b/src/gui/statuswindow.h
@@ -56,7 +56,7 @@ class StatusWindow : public Window, public Mana::Listener
*/
StatusWindow();
- void event(Channels channel, const Mana::Event &event);
+ void event(Mana::Channels channel, const Mana::Event &event);
void setPointsNeeded(int id, int needed);