diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-04-09 00:11:54 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-04-09 17:54:12 +0200 |
commit | 1e1f619b9ae5aa26058c499c988f45d1fb1b6d53 (patch) | |
tree | 1fe58c53388054ced122b5327e33fc2851a0606a /src/gui | |
parent | 30d4b0adf4f17f05d1d62fc3428c896ef1079b6b (diff) | |
download | mana-1e1f619b9ae5aa26058c499c988f45d1fb1b6d53.tar.gz mana-1e1f619b9ae5aa26058c499c988f45d1fb1b6d53.tar.bz2 mana-1e1f619b9ae5aa26058c499c988f45d1fb1b6d53.tar.xz mana-1e1f619b9ae5aa26058c499c988f45d1fb1b6d53.zip |
Moved Channels to Mana::Event::Channel
Acked-by: Jared Adams
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/chat.cpp | 10 | ||||
-rw-r--r-- | src/gui/chat.h | 2 | ||||
-rw-r--r-- | src/gui/equipmentwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/gui.cpp | 6 | ||||
-rw-r--r-- | src/gui/inventorywindow.cpp | 10 | ||||
-rw-r--r-- | src/gui/inventorywindow.h | 2 | ||||
-rw-r--r-- | src/gui/itemamount.cpp | 4 | ||||
-rw-r--r-- | src/gui/ministatus.cpp | 9 | ||||
-rw-r--r-- | src/gui/ministatus.h | 2 | ||||
-rw-r--r-- | src/gui/npcdialog.cpp | 14 | ||||
-rw-r--r-- | src/gui/npcdialog.h | 2 | ||||
-rw-r--r-- | src/gui/skilldialog.cpp | 4 | ||||
-rw-r--r-- | src/gui/skilldialog.h | 2 | ||||
-rw-r--r-- | src/gui/statuswindow.cpp | 5 | ||||
-rw-r--r-- | src/gui/statuswindow.h | 2 | ||||
-rw-r--r-- | src/gui/viewport.cpp | 10 | ||||
-rw-r--r-- | src/gui/viewport.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/itemcontainer.cpp | 6 |
18 files changed, 48 insertions, 46 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index fecf892a..17eb8af3 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -90,8 +90,8 @@ ChatWindow::ChatWindow(): mAutoComplete(new ChatAutoComplete), mTmpVisible(false) { - listen(CHANNEL_CHAT); - listen(CHANNEL_NOTICES); + listen(Mana::Event::ChatChannel); + listen(Mana::Event::NoticesChannel); setWindowName("Chat"); @@ -375,14 +375,14 @@ void ChatWindow::mouseDragged(gcn::MouseEvent &event) } } -void ChatWindow::event(Channels channel, const Mana::Event &event) +void ChatWindow::event(Mana::Event::Channel channel, const Mana::Event &event) { - if (channel == CHANNEL_NOTICES) + if (channel == Mana::Event::NoticesChannel) { if (event.getType() == Mana::Event::ServerNotice) localChatTab->chatLog(event.getString("message"), BY_SERVER); } - else if (channel == CHANNEL_CHAT) + else if (channel == Mana::Event::ChatChannel) { if (event.getType() == Mana::Event::Whisper) { diff --git a/src/gui/chat.h b/src/gui/chat.h index 211e7da7..4ec2a179 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(Mana::Event::Channel channel, const Mana::Event &event); /** * Scrolls the chat window diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index 02fc2a96..09ad6207 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -113,7 +113,7 @@ void EquipmentWindow::action(const gcn::ActionEvent &event) if (event.getId() == "unequip" && mSelected > -1) { Item *item = mEquipment->getEquipment(mSelected); - item->doEvent(EVENT_DOUNEQUIP); + item->doEvent(Mana::Event::DoUnequip); setSelected(-1); } } diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 500a2d74..b8ce7989 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -57,9 +57,9 @@ class GuiConfigListener : public Mana::Listener mGui(g) {} - void event(Channels channel, const Mana::Event &event) + void event(Mana::Event::Channel channel, const Mana::Event &event) { - if (channel == CHANNEL_CONFIG) + if (channel == Mana::Event::ConfigChannel) { if (event.getType() == Mana::Event::ConfigOptionChanged && event.getString("option") == "customcursor") @@ -141,7 +141,7 @@ Gui::Gui(Graphics *graphics): // Initialize mouse cursor and listen for changes to the option setUseCustomCursor(config.getBoolValue("customcursor")); mConfigListener = new GuiConfigListener(this); - mConfigListener->listen(CHANNEL_CONFIG); + mConfigListener->listen(Mana::Event::ConfigChannel); } Gui::~Gui() diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index 39a9cf6e..7a8d5f09 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -61,7 +61,7 @@ InventoryWindow::InventoryWindow(Inventory *inventory): mFilterText(new TextField), mSplit(false) { - listen(CHANNEL_ATTRIBUTES); + listen(Mana::Event::AttributesChannel); setWindowName(isMainInventory() ? "Inventory" : "Storage"); setupWindow->registerWindowForReset(this); @@ -270,7 +270,7 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event) event.setInt("amount", item->getQuantity()); event.setInt("source", Inventory::INVENTORY); event.setInt("destination", Inventory::STORAGE); - event.trigger(CHANNEL_ITEM); + event.trigger(Mana::Event::ItemChannel); } else { @@ -279,7 +279,7 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event) event.setInt("amount", item->getQuantity()); event.setInt("source", Inventory::STORAGE); event.setInt("destination", Inventory::INVENTORY); - event.trigger(CHANNEL_ITEM); + event.trigger(Mana::Event::ItemChannel); } } } @@ -385,12 +385,12 @@ void InventoryWindow::close() { Mana::Event event(Mana::Event::DoCloseInventory); event.setInt("type", mInventory->getType()); - event.trigger(CHANNEL_ITEM); + event.trigger(Mana::Event::ItemChannel); scheduleDelete(); } } -void InventoryWindow::event(Channels channel, const Mana::Event &event) +void InventoryWindow::event(Mana::Event::Channel channel, const Mana::Event &event) { if (event.getType() == Mana::Event::UpdateAttribute) { diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h index 2ea59001..c1f6ec57 100644 --- a/src/gui/inventorywindow.h +++ b/src/gui/inventorywindow.h @@ -116,7 +116,7 @@ class InventoryWindow : public Window, bool isMainInventory() { return mInventory->isMainInventory(); } - void event(Channels channel, const Mana::Event &event); + void event(Mana::Event::Channel channel, const Mana::Event &event); private: /** diff --git a/src/gui/itemamount.cpp b/src/gui/itemamount.cpp index 7d3931bf..7782466d 100644 --- a/src/gui/itemamount.cpp +++ b/src/gui/itemamount.cpp @@ -59,7 +59,7 @@ void ItemAmountWindow::finish(Item *item, int amount, Usage usage) event.setInt("amount", amount); event.setInt("source", Inventory::INVENTORY); event.setInt("destination", Inventory::STORAGE); - event.trigger(CHANNEL_ITEM); + event.trigger(Mana::Event::ItemChannel); } break; case StoreRemove: @@ -69,7 +69,7 @@ void ItemAmountWindow::finish(Item *item, int amount, Usage usage) event.setInt("amount", amount); event.setInt("source", Inventory::STORAGE); event.setInt("destination", Inventory::INVENTORY); - event.trigger(CHANNEL_ITEM); + event.trigger(Mana::Event::ItemChannel); } break; default: diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp index 8093a893..5791b4fb 100644 --- a/src/gui/ministatus.cpp +++ b/src/gui/ministatus.cpp @@ -47,7 +47,7 @@ extern volatile int tick_time; MiniStatusWindow::MiniStatusWindow(): Popup("MiniStatus") { - listen(CHANNEL_ATTRIBUTES); + listen(Mana::Event::AttributesChannel); mHpBar = new ProgressBar(0, 100, 20, Theme::PROG_HP); StatusWindow::updateHPBar(mHpBar); @@ -119,9 +119,10 @@ void MiniStatusWindow::drawIcons(Graphics *graphics) } } -void MiniStatusWindow::event(Channels channel, const Mana::Event &event) +void MiniStatusWindow::event(Mana::Event::Channel channel, + const Mana::Event &event) { - if (channel == CHANNEL_ATTRIBUTES) + if (channel == Mana::Event::AttributesChannel) { if (event.getType() == Mana::Event::UpdateAttribute) { @@ -140,7 +141,7 @@ void MiniStatusWindow::event(Channels channel, const Mana::Event &event) } } } - else if (channel == CHANNEL_ACTORSPRITE) + else if (channel == Mana::Event::ActorSpriteChannel) { if (event.getType() == Mana::Event::UpdateStatusEffect) { diff --git a/src/gui/ministatus.h b/src/gui/ministatus.h index 9dfcaeae..88d2d88a 100644 --- a/src/gui/ministatus.h +++ b/src/gui/ministatus.h @@ -45,7 +45,7 @@ class MiniStatusWindow : public Popup, public Mana::Listener void drawIcons(Graphics *graphics); - void event(Channels channel, const Mana::Event &event); + void event(Mana::Event::Channel channel, const Mana::Event &event); void logic(); // Updates icons diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp index 799054ba..8322a735 100644 --- a/src/gui/npcdialog.cpp +++ b/src/gui/npcdialog.cpp @@ -55,7 +55,7 @@ typedef std::map<int, NpcDialog*> NpcDialogs; class NpcEventListener : public Mana::Listener { public: - void event(Channels channel, const Mana::Event &event); + void event(Mana::Event::Channel channel, const Mana::Event &event); NpcDialog *getDialog(int id, bool make = true); @@ -143,7 +143,7 @@ NpcDialog::NpcDialog(int npcId) setVisible(true); requestFocus(); - listen(CHANNEL_CONFIG); + listen(Mana::Event::ConfigChannel); PlayerInfo::setNPCInteractionCount(PlayerInfo::getNPCInteractionCount() + 1); } @@ -387,9 +387,9 @@ void NpcDialog::setVisible(bool visible) } } -void NpcDialog::event(Channels channel, const Mana::Event &event) +void NpcDialog::event(Mana::Event::Channel channel, const Mana::Event &event) { - if (channel != CHANNEL_CONFIG) + if (channel != Mana::Event::ConfigChannel) return; if (event.getType() == Mana::Event::ConfigOptionChanged && @@ -436,7 +436,7 @@ void NpcDialog::setup() npcListener = new NpcEventListener(); - npcListener->listen(CHANNEL_NPC); + npcListener->listen(Mana::Event::NpcChannel); } void NpcDialog::buildLayout() @@ -506,10 +506,10 @@ void NpcDialog::buildLayout() mScrollArea->setVerticalScrollAmount(mScrollArea->getVerticalMaxScroll()); } -void NpcEventListener::event(Channels channel, +void NpcEventListener::event(Mana::Event::Channel channel, const Mana::Event &event) { - if (channel != CHANNEL_NPC) + if (channel != Mana::Event::NpcChannel) return; if (event.getType() == Mana::Event::Message) diff --git a/src/gui/npcdialog.h b/src/gui/npcdialog.h index d0131d0e..7923cfa3 100644 --- a/src/gui/npcdialog.h +++ b/src/gui/npcdialog.h @@ -145,7 +145,7 @@ class NpcDialog : public Window, public gcn::ActionListener, void setVisible(bool visible); - void event(Channels channel, const Mana::Event &event); + void event(Mana::Event::Channel channel, const Mana::Event &event); /** * Returns the first active instance. Useful for pushing user diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index dfded635..95324e98 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -212,7 +212,7 @@ private: SkillDialog::SkillDialog(): Window(_("Skills")) { - listen(CHANNEL_ATTRIBUTES); + listen(Mana::Event::AttributesChannel); setWindowName("Skills"); setCloseButton(true); @@ -280,7 +280,7 @@ void SkillDialog::update() } } -void SkillDialog::event(Channels channel, const Mana::Event &event) +void SkillDialog::event(Mana::Event::Channel channel, const Mana::Event &event) { if (event.getType() == Mana::Event::UpdateAttribute) { diff --git a/src/gui/skilldialog.h b/src/gui/skilldialog.h index 874b4437..b6d1d4ae 100644 --- a/src/gui/skilldialog.h +++ b/src/gui/skilldialog.h @@ -49,7 +49,7 @@ class SkillDialog : public Window, public gcn::ActionListener, public Mana::List ~SkillDialog(); - void event(Channels channel, const Mana::Event &event); + void event(Mana::Event::Channel channel, const Mana::Event &event); /** * Called when receiving actions from widget. diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index a37c30ba..b124a883 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -96,7 +96,7 @@ class ChangeDisplay : public AttrDisplay, gcn::ActionListener StatusWindow::StatusWindow(): Window(player_node->getName()) { - listen(CHANNEL_ATTRIBUTES); + listen(Mana::Event::AttributesChannel); setWindowName("Status"); setupWindow->registerWindowForReset(this); @@ -217,7 +217,8 @@ StatusWindow::StatusWindow(): mLvlLabel->adjustSize(); } -void StatusWindow::event(Channels channel, const Mana::Event &event) +void StatusWindow::event(Mana::Event::Channel channel, + const Mana::Event &event) { if (event.getType() == Mana::Event::UpdateAttribute) { diff --git a/src/gui/statuswindow.h b/src/gui/statuswindow.h index 103111a7..6a08fd09 100644 --- a/src/gui/statuswindow.h +++ b/src/gui/statuswindow.h @@ -48,7 +48,7 @@ class StatusWindow : public Window, public Mana::Listener */ StatusWindow(); - void event(Channels channel, const Mana::Event &event); + void event(Mana::Event::Channel channel, const Mana::Event &event); void updateAttrs(); diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index d9693863..3ec88102 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -71,8 +71,8 @@ Viewport::Viewport(): setFocusable(true); - listen(CHANNEL_CONFIG); - listen(CHANNEL_ACTORSPRITE); + listen(Mana::Event::ConfigChannel); + listen(Mana::Event::ActorSpriteChannel); } Viewport::~Viewport() @@ -584,9 +584,9 @@ void Viewport::hideBeingPopup() mBeingPopup->setVisible(false); } -void Viewport::event(Channels channel, const Mana::Event &event) +void Viewport::event(Mana::Event::Channel channel, const Mana::Event &event) { - if (channel == CHANNEL_ACTORSPRITE + if (channel == Mana::Event::ActorSpriteChannel && event.getType() == Mana::Event::Destroyed) { ActorSprite *actor = event.getActor("source"); @@ -597,7 +597,7 @@ void Viewport::event(Channels channel, const Mana::Event &event) if (mHoverItem == actor) mHoverItem = 0; } - else if (channel == CHANNEL_CONFIG && + else if (channel == Mana::Event::ConfigChannel && event.getType() == Mana::Event::ConfigOptionChanged) { const std::string option = event.getString("option"); diff --git a/src/gui/viewport.h b/src/gui/viewport.h index f4db806b..eec09478 100644 --- a/src/gui/viewport.h +++ b/src/gui/viewport.h @@ -171,7 +171,7 @@ class Viewport : public WindowContainer, public gcn::MouseListener, void shakeScreenStop() { mShakeEffects.clear(); } - void event(Channels channel, const Mana::Event &event); + void event(Mana::Event::Channel channel, const Mana::Event &event); private: /** diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 5b6788fa..59f7934e 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -349,7 +349,7 @@ void ItemContainer::mouseReleased(gcn::MouseEvent &event) Mana::Event event(Mana::Event::DoMove); event.setItem("item", item); event.setInt("newIndex", index); - event.trigger(CHANNEL_ITEM); + event.trigger(Mana::Event::ItemChannel); } selectNone(); } @@ -421,7 +421,7 @@ void ItemContainer::keyAction() Mana::Event event(Mana::Event::DoMove); event.setItem("item", item); event.setInt("newIndex", mHighlightedIndex); - event.trigger(CHANNEL_ITEM); + event.trigger(Mana::Event::ItemChannel); setSelectedIndex(mHighlightedIndex); } // If the highlight is on an item then select it. @@ -437,7 +437,7 @@ void ItemContainer::keyAction() Mana::Event event(Mana::Event::DoMove); event.setItem("item", item); event.setInt("newIndex", mHighlightedIndex); - event.trigger(CHANNEL_ITEM); + event.trigger(Mana::Event::ItemChannel); selectNone(); } } |