summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2011-04-09 00:03:44 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2011-04-09 17:54:12 +0200
commit30d4b0adf4f17f05d1d62fc3428c896ef1079b6b (patch)
treeacc6dab5d6894a949df3ab4d913ef72a1b1ebdca /src/gui
parentb499cf0c03f2589d36a1df14c81530347243940a (diff)
downloadMana-30d4b0adf4f17f05d1d62fc3428c896ef1079b6b.tar.gz
Mana-30d4b0adf4f17f05d1d62fc3428c896ef1079b6b.tar.bz2
Mana-30d4b0adf4f17f05d1d62fc3428c896ef1079b6b.tar.xz
Mana-30d4b0adf4f17f05d1d62fc3428c896ef1079b6b.zip
Moved Events to Mana::Event::Type
Acked-by: Jared Adams
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/chat.cpp12
-rw-r--r--src/gui/chat.h2
-rw-r--r--src/gui/gui.cpp2
-rw-r--r--src/gui/inventorywindow.cpp16
-rw-r--r--src/gui/itemamount.cpp8
-rw-r--r--src/gui/ministatus.cpp4
-rw-r--r--src/gui/npcdialog.cpp20
-rw-r--r--src/gui/outfitwindow.cpp4
-rw-r--r--src/gui/popupmenu.cpp6
-rw-r--r--src/gui/skilldialog.cpp2
-rw-r--r--src/gui/statuswindow.cpp4
-rw-r--r--src/gui/viewport.cpp5
-rw-r--r--src/gui/widgets/itemcontainer.cpp6
13 files changed, 46 insertions, 45 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 2ac5100d..fecf892a 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -379,29 +379,29 @@ void ChatWindow::event(Channels channel, const Mana::Event &event)
{
if (channel == CHANNEL_NOTICES)
{
- if (event.getName() == EVENT_SERVERNOTICE)
+ if (event.getType() == Mana::Event::ServerNotice)
localChatTab->chatLog(event.getString("message"), BY_SERVER);
}
else if (channel == CHANNEL_CHAT)
{
- if (event.getName() == EVENT_WHISPER)
+ if (event.getType() == Mana::Event::Whisper)
{
whisper(event.getString("nick"), event.getString("message"));
}
- else if (event.getName() == EVENT_WHISPERERROR)
+ else if (event.getType() == Mana::Event::WhisperError)
{
whisper(event.getString("nick"),
event.getString("error"), BY_SERVER);
}
- else if (event.getName() == EVENT_PLAYER)
+ else if (event.getType() == Mana::Event::Player)
{
localChatTab->chatLog(event.getString("message"), BY_PLAYER);
}
- else if (event.getName() == EVENT_ANNOUNCEMENT)
+ else if (event.getType() == Mana::Event::Announcement)
{
localChatTab->chatLog(event.getString("message"), BY_GM);
}
- else if (event.getName() == EVENT_BEING)
+ else if (event.getType() == Mana::Event::Being)
{
if (event.getInt("permissions") & PlayerRelation::SPEECH_LOG)
localChatTab->chatLog(event.getString("message"), BY_OTHER);
diff --git a/src/gui/chat.h b/src/gui/chat.h
index f546502c..211e7da7 100644
--- a/src/gui/chat.h
+++ b/src/gui/chat.h
@@ -158,7 +158,7 @@ class ChatWindow : public Window,
void mousePressed(gcn::MouseEvent &event);
void mouseDragged(gcn::MouseEvent &event);
- void event(Channels channel, const Mana::Event &event);
+ void event(Channels channel, const Mana::Event &event);
/**
* Scrolls the chat window
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index c0d1babf..500a2d74 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -61,7 +61,7 @@ class GuiConfigListener : public Mana::Listener
{
if (channel == CHANNEL_CONFIG)
{
- if (event.getName() == EVENT_CONFIGOPTIONCHANGED &&
+ if (event.getType() == Mana::Event::ConfigOptionChanged &&
event.getString("option") == "customcursor")
{
bool bCustomCursor = config.getBoolValue("customcursor");
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index 02801ced..39a9cf6e 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -195,19 +195,19 @@ void InventoryWindow::action(const gcn::ActionEvent &event)
return;
if (event.getId() == "activate")
- item->doEvent(EVENT_DOUSE);
+ item->doEvent(Mana::Event::DoUse);
else if (event.getId() == "equip")
{
if (item->isEquippable())
{
if (item->isEquipped())
- item->doEvent(EVENT_DOUNEQUIP);
+ item->doEvent(Mana::Event::DoUnequip);
else
- item->doEvent(EVENT_DOEQUIP);
+ item->doEvent(Mana::Event::DoEquip);
}
else
{
- item->doEvent(EVENT_DOUSE);
+ item->doEvent(Mana::Event::DoUse);
}
}
else if (event.getId() == "drop")
@@ -265,7 +265,7 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event)
return;
if (mInventory->isMainInventory())
{
- Mana::Event event(EVENT_DOMOVE);
+ Mana::Event event(Mana::Event::DoMove);
event.setItem("item", item);
event.setInt("amount", item->getQuantity());
event.setInt("source", Inventory::INVENTORY);
@@ -274,7 +274,7 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event)
}
else
{
- Mana::Event event(EVENT_DOMOVE);
+ Mana::Event event(Mana::Event::DoMove);
event.setItem("item", item);
event.setInt("amount", item->getQuantity());
event.setInt("source", Inventory::STORAGE);
@@ -383,7 +383,7 @@ void InventoryWindow::close()
}
else
{
- Mana::Event event(EVENT_DOCLOSEINVENTORY);
+ Mana::Event event(Mana::Event::DoCloseInventory);
event.setInt("type", mInventory->getType());
event.trigger(CHANNEL_ITEM);
scheduleDelete();
@@ -392,7 +392,7 @@ void InventoryWindow::close()
void InventoryWindow::event(Channels channel, const Mana::Event &event)
{
- if (event.getName() == EVENT_UPDATEATTRIBUTE)
+ if (event.getType() == Mana::Event::UpdateAttribute)
{
int id = event.getInt("id");
if (id == TOTAL_WEIGHT ||
diff --git a/src/gui/itemamount.cpp b/src/gui/itemamount.cpp
index 85325c66..7d3931bf 100644
--- a/src/gui/itemamount.cpp
+++ b/src/gui/itemamount.cpp
@@ -47,14 +47,14 @@ void ItemAmountWindow::finish(Item *item, int amount, Usage usage)
tradeWindow->tradeItem(item, amount);
break;
case ItemDrop:
- item->doEvent(EVENT_DODROP, amount);
+ item->doEvent(Mana::Event::DoDrop, amount);
break;
case ItemSplit:
- item->doEvent(EVENT_DOSPLIT, amount);
+ item->doEvent(Mana::Event::DoSplit, amount);
break;
case StoreAdd:
{
- Mana::Event event(EVENT_DOMOVE);
+ Mana::Event event(Mana::Event::DoMove);
event.setItem("item", item);
event.setInt("amount", amount);
event.setInt("source", Inventory::INVENTORY);
@@ -64,7 +64,7 @@ void ItemAmountWindow::finish(Item *item, int amount, Usage usage)
break;
case StoreRemove:
{
- Mana::Event event(EVENT_DOMOVE);
+ Mana::Event event(Mana::Event::DoMove);
event.setItem("item", item);
event.setInt("amount", amount);
event.setInt("source", Inventory::STORAGE);
diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp
index fae40d03..8093a893 100644
--- a/src/gui/ministatus.cpp
+++ b/src/gui/ministatus.cpp
@@ -123,7 +123,7 @@ void MiniStatusWindow::event(Channels channel, const Mana::Event &event)
{
if (channel == CHANNEL_ATTRIBUTES)
{
- if (event.getName() == EVENT_UPDATEATTRIBUTE)
+ if (event.getType() == Mana::Event::UpdateAttribute)
{
int id = event.getInt("id");
if (id == HP || id == MAX_HP)
@@ -142,7 +142,7 @@ void MiniStatusWindow::event(Channels channel, const Mana::Event &event)
}
else if (channel == CHANNEL_ACTORSPRITE)
{
- if (event.getName() == EVENT_UPDATESTATUSEFFECT)
+ if (event.getType() == Mana::Event::UpdateStatusEffect)
{
int index = event.getInt("index");
bool newStatus = event.getBool("newStatus");
diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp
index 590001b0..799054ba 100644
--- a/src/gui/npcdialog.cpp
+++ b/src/gui/npcdialog.cpp
@@ -392,7 +392,7 @@ void NpcDialog::event(Channels channel, const Mana::Event &event)
if (channel != CHANNEL_CONFIG)
return;
- if (event.getName() == EVENT_CONFIGOPTIONCHANGED &&
+ if (event.getType() == Mana::Event::ConfigOptionChanged &&
event.getString("option") == "logNpcInGui")
{
mLogInteraction = config.getBoolValue("logNpcInGui");
@@ -512,13 +512,13 @@ void NpcEventListener::event(Channels channel,
if (channel != CHANNEL_NPC)
return;
- if (event.getName() == EVENT_MESSAGE)
+ if (event.getType() == Mana::Event::Message)
{
NpcDialog *dialog = getDialog(event.getInt("id"));
dialog->addText(event.getString("text"));
}
- else if (event.getName() == EVENT_MENU)
+ else if (event.getType() == Mana::Event::Menu)
{
NpcDialog *dialog = getDialog(event.getInt("id"));
@@ -528,7 +528,7 @@ void NpcEventListener::event(Channels channel,
for (int i = 1; i <= count; i++)
dialog->addChoice(event.getString("choice" + toString(i)));
}
- else if (event.getName() == EVENT_INTEGERINPUT)
+ else if (event.getType() == Mana::Event::IntegerInput)
{
NpcDialog *dialog = getDialog(event.getInt("id"));
@@ -538,7 +538,7 @@ void NpcEventListener::event(Channels channel,
dialog->integerRequest(defaultValue, min, max);
}
- else if (event.getName() == EVENT_STRINGINPUT)
+ else if (event.getType() == Mana::Event::StringInput)
{
NpcDialog *dialog = getDialog(event.getInt("id"));
@@ -551,7 +551,7 @@ void NpcEventListener::event(Channels channel,
dialog->textRequest("");
}
}
- else if (event.getName() == EVENT_NEXT)
+ else if (event.getType() == Mana::Event::Next)
{
int id = event.getInt("id");
NpcDialog *dialog = getDialog(id, false);
@@ -565,7 +565,7 @@ void NpcEventListener::event(Channels channel,
dialog->showNextButton();
}
- else if (event.getName() == EVENT_CLOSE)
+ else if (event.getType() == Mana::Event::Close)
{
int id = event.getInt("id");
NpcDialog *dialog = getDialog(id, false);
@@ -579,11 +579,11 @@ void NpcEventListener::event(Channels channel,
dialog->showCloseButton();
}
- else if (event.getName() == EVENT_CLOSEALL)
+ else if (event.getType() == Mana::Event::CloseAll)
{
NpcDialog::closeAll();
}
- else if (event.getName() == EVENT_END)
+ else if (event.getType() == Mana::Event::End)
{
int id = event.getInt("id");
NpcDialog *dialog = getDialog(id, false);
@@ -591,7 +591,7 @@ void NpcEventListener::event(Channels channel,
if (dialog)
dialog->close();
}
- else if (event.getName() == EVENT_POST)
+ else if (event.getType() == Mana::Event::Post)
{
new NpcPostDialog(event.getInt("id"));
}
diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp
index 8da8914a..e54fed04 100644
--- a/src/gui/outfitwindow.cpp
+++ b/src/gui/outfitwindow.cpp
@@ -172,7 +172,7 @@ void OutfitWindow::wearOutfit(int outfit)
if (item && !item->isEquipped() && item->getQuantity())
{
if (item->isEquippable())
- item->doEvent(EVENT_DOEQUIP);
+ item->doEvent(Mana::Event::DoEquip);
}
}
}
@@ -341,7 +341,7 @@ void OutfitWindow::unequipNotInOutfit(int outfit)
Item *item = inventory->getItem(i);
if (item)
- item->doEvent(EVENT_DOUNEQUIP);
+ item->doEvent(Mana::Event::DoUnequip);
}
}
}
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index f5259c35..6c8662a0 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -269,13 +269,13 @@ void PopupMenu::handleLink(const std::string &link)
if (mItem->isEquippable())
{
if (mItem->isEquipped())
- mItem->doEvent(EVENT_DOUNEQUIP);
+ mItem->doEvent(Mana::Event::DoUnequip);
else
- mItem->doEvent(EVENT_DOEQUIP);
+ mItem->doEvent(Mana::Event::DoEquip);
}
else
{
- mItem->doEvent(EVENT_DOUSE);
+ mItem->doEvent(Mana::Event::DoUse);
}
}
else if (link == "chat")
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp
index 5b3314d1..dfded635 100644
--- a/src/gui/skilldialog.cpp
+++ b/src/gui/skilldialog.cpp
@@ -282,7 +282,7 @@ void SkillDialog::update()
void SkillDialog::event(Channels channel, const Mana::Event &event)
{
- if (event.getName() == EVENT_UPDATEATTRIBUTE)
+ if (event.getType() == Mana::Event::UpdateAttribute)
{
if (event.getInt("id") == SKILL_POINTS)
{
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp
index a3420f06..a37c30ba 100644
--- a/src/gui/statuswindow.cpp
+++ b/src/gui/statuswindow.cpp
@@ -219,7 +219,7 @@ StatusWindow::StatusWindow():
void StatusWindow::event(Channels channel, const Mana::Event &event)
{
- if (event.getName() == EVENT_UPDATEATTRIBUTE)
+ if (event.getType() == Mana::Event::UpdateAttribute)
{
switch(event.getInt("id"))
{
@@ -265,7 +265,7 @@ void StatusWindow::event(Channels channel, const Mana::Event &event)
break;
}
}
- else if (event.getName() == EVENT_UPDATESTAT)
+ else if (event.getType() == Mana::Event::UpdateStat)
{
int id = event.getInt("id");
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 9d03cab5..d9693863 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -586,7 +586,8 @@ void Viewport::hideBeingPopup()
void Viewport::event(Channels channel, const Mana::Event &event)
{
- if (channel == CHANNEL_ACTORSPRITE && event.getName() == EVENT_DESTROYED)
+ if (channel == CHANNEL_ACTORSPRITE
+ && event.getType() == Mana::Event::Destroyed)
{
ActorSprite *actor = event.getActor("source");
@@ -597,7 +598,7 @@ void Viewport::event(Channels channel, const Mana::Event &event)
mHoverItem = 0;
}
else if (channel == CHANNEL_CONFIG &&
- event.getName() == EVENT_CONFIGOPTIONCHANGED)
+ event.getType() == Mana::Event::ConfigOptionChanged)
{
const std::string option = event.getString("option");
if (option == "ScrollLaziness" || option == "ScrollRadius")
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 15fcbfe2..5b6788fa 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -346,7 +346,7 @@ void ItemContainer::mouseReleased(gcn::MouseEvent &event)
Item *item = getSelectedItem();
{
- Mana::Event event(EVENT_DOMOVE);
+ Mana::Event event(Mana::Event::DoMove);
event.setItem("item", item);
event.setInt("newIndex", index);
event.trigger(CHANNEL_ITEM);
@@ -418,7 +418,7 @@ void ItemContainer::keyAction()
mHighlightedIndex != -1)
{
Item *item = getSelectedItem();
- Mana::Event event(EVENT_DOMOVE);
+ Mana::Event event(Mana::Event::DoMove);
event.setItem("item", item);
event.setInt("newIndex", mHighlightedIndex);
event.trigger(CHANNEL_ITEM);
@@ -434,7 +434,7 @@ void ItemContainer::keyAction()
else if (mSelectedIndex != -1)
{
Item *item = getSelectedItem();
- Mana::Event event(EVENT_DOMOVE);
+ Mana::Event event(Mana::Event::DoMove);
event.setItem("item", item);
event.setInt("newIndex", mHighlightedIndex);
event.trigger(CHANNEL_ITEM);