From 03c74387d37cefcc18e59db203d17d78cda40e8e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 18 May 2014 16:27:04 +0300 Subject: Move mousebutton into separate file. --- src/gui/windows/chatwindow.cpp | 4 ++-- src/gui/windows/equipmentwindow.cpp | 4 ++-- src/gui/windows/inventorywindow.cpp | 12 ++++++------ src/gui/windows/minimap.cpp | 4 ++-- src/gui/windows/ministatuswindow.cpp | 2 +- src/gui/windows/npcdialog.cpp | 2 +- src/gui/windows/outfitwindow.cpp | 6 +++--- src/gui/windows/serverdialog.cpp | 2 +- src/gui/windows/shortcutwindow.cpp | 2 +- src/gui/windows/whoisonline.cpp | 4 ++-- 10 files changed, 21 insertions(+), 21 deletions(-) (limited to 'src/gui/windows') diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 423aa556a..262700fc6 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -653,7 +653,7 @@ void ChatWindow::mousePressed(MouseEvent &event) if (event.isConsumed()) return; - if (event.getButton() == MouseEvent::RIGHT) + if (event.getButton() == MouseButton::RIGHT) { if (viewport) { @@ -683,7 +683,7 @@ void ChatWindow::mousePressed(MouseEvent &event) if (event.isConsumed()) return; - if (event.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseButton::LEFT) { const ChatTab *const tab = getFocused(); if (tab) diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index 25cb5f629..0a18cd20f 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -306,7 +306,7 @@ void EquipmentWindow::mousePressed(MouseEvent& event) const int x = event.getX(); const int y = event.getY(); - if (event.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseButton::LEFT) { if (mForing) { @@ -342,7 +342,7 @@ void EquipmentWindow::mousePressed(MouseEvent& event) return; } } - else if (event.getButton() == MouseEvent::RIGHT) + else if (event.getButton() == MouseButton::RIGHT) { if (Item *const item = getItem(x, y)) { diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index 14226ee38..ee920f8a1 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -451,7 +451,7 @@ void InventoryWindow::mouseClicked(MouseEvent &event) && inputManager.isActionActive(static_cast( Input::KEY_STOP_ATTACK))); - if (!mod && !mod2 && event.getButton() == MouseEvent::RIGHT) + if (!mod && !mod2 && event.getButton() == MouseButton::RIGHT) { Item *const item = mItems->getSelectedItem(); @@ -471,8 +471,8 @@ void InventoryWindow::mouseClicked(MouseEvent &event) if (!mInventory) return; - if (event.getButton() == MouseEvent::LEFT - || event.getButton() == MouseEvent::RIGHT) + if (event.getButton() == MouseButton::LEFT + || event.getButton() == MouseButton::RIGHT) { Item *const item = mItems->getSelectedItem(); @@ -483,7 +483,7 @@ void InventoryWindow::mouseClicked(MouseEvent &event) { if (mInventory->isMainInventory()) { - if (event.getButton() == MouseEvent::RIGHT) + if (event.getButton() == MouseButton::RIGHT) { ItemAmountWindow::showWindow(ItemAmountWindow::StoreAdd, inventoryWindow, item); @@ -497,7 +497,7 @@ void InventoryWindow::mouseClicked(MouseEvent &event) } else { - if (event.getButton() == MouseEvent::RIGHT) + if (event.getButton() == MouseButton::RIGHT) { ItemAmountWindow::showWindow(ItemAmountWindow::StoreRemove, inventoryWindow, item); @@ -514,7 +514,7 @@ void InventoryWindow::mouseClicked(MouseEvent &event) { if (PlayerInfo::isItemProtected(item->getId())) return; - if (event.getButton() == MouseEvent::RIGHT) + if (event.getButton() == MouseButton::RIGHT) { ItemAmountWindow::showWindow(ItemAmountWindow::TradeAdd, tradeWindow, item); diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp index 8acbfc5a0..3607d9584 100644 --- a/src/gui/windows/minimap.cpp +++ b/src/gui/windows/minimap.cpp @@ -439,7 +439,7 @@ void Minimap::mouseReleased(MouseEvent &event) if (!player_node || !viewport) return; - if (event.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseButton::LEFT) { int x = event.getX(); int y = event.getY(); @@ -447,7 +447,7 @@ void Minimap::mouseReleased(MouseEvent &event) player_node->navigateTo(x, y); } - else if (event.getButton() == MouseEvent::RIGHT) + else if (event.getButton() == MouseButton::RIGHT) { int x = event.getX(); int y = event.getY(); diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index d9e6e5479..4417ff2fc 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -445,7 +445,7 @@ void MiniStatusWindow::mousePressed(MouseEvent &event) if (!viewport) return; - if (event.getButton() == MouseEvent::RIGHT) + if (event.getButton() == MouseButton::RIGHT) { const ProgressBar *const bar = dynamic_cast( event.getSource()); diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index a2ac10073..47ad71f32 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -947,7 +947,7 @@ void NpcDialog::clearDialogs() void NpcDialog::mousePressed(MouseEvent &event) { Window::mousePressed(event); - if (event.getButton() == MouseEvent::RIGHT + if (event.getButton() == MouseButton::RIGHT && event.getSource() == mTextBox) { event.consume(); diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp index 7748ae256..fb2b4a4e7 100644 --- a/src/gui/windows/outfitwindow.cpp +++ b/src/gui/windows/outfitwindow.cpp @@ -369,7 +369,7 @@ void OutfitWindow::draw(Graphics *graphics) void OutfitWindow::mouseDragged(MouseEvent &event) { - if (event.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseButton::LEFT) { if (dragDrop.isEmpty() && mItemClicked) { @@ -415,7 +415,7 @@ void OutfitWindow::mousePressed(MouseEvent &event) const int index = getIndexFromGrid(event.getX(), event.getY()); if (index == -1) { - if (event.getButton() == MouseEvent::RIGHT && viewport) + if (event.getButton() == MouseButton::RIGHT && viewport) { viewport->showOutfitsPopup(); event.consume(); @@ -449,7 +449,7 @@ void OutfitWindow::mousePressed(MouseEvent &event) void OutfitWindow::mouseReleased(MouseEvent &event) { - if (event.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseButton::LEFT) { if (mCurrentOutfit < 0 || mCurrentOutfit >= static_cast(OUTFITS_COUNT)) diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index 25dfff02e..74906dc25 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -359,7 +359,7 @@ void ServerDialog::valueChanged(const SelectionEvent &) void ServerDialog::mouseClicked(MouseEvent &event) { - if (event.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseButton::LEFT) { event.consume(); if (event.getClickCount() == 2 && diff --git a/src/gui/windows/shortcutwindow.cpp b/src/gui/windows/shortcutwindow.cpp index cac23c361..20fcdd0a0 100644 --- a/src/gui/windows/shortcutwindow.cpp +++ b/src/gui/windows/shortcutwindow.cpp @@ -188,7 +188,7 @@ void ShortcutWindow::mousePressed(MouseEvent &event) if (event.isConsumed()) return; - if (event.getButton() == MouseEvent::LEFT) + if (event.getButton() == MouseButton::LEFT) { mDragOffsetX = event.getX(); mDragOffsetY = event.getY(); diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index 797ba68fe..312eeb129 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -168,7 +168,7 @@ WhoIsOnline::~WhoIsOnline() void WhoIsOnline::handleLink(const std::string& link, MouseEvent *event) { - if (!event || event->getButton() == MouseEvent::LEFT) + if (!event || event->getButton() == MouseButton::LEFT) { if (chatWindow) { @@ -184,7 +184,7 @@ void WhoIsOnline::handleLink(const std::string& link, MouseEvent *event) } } } - else if (event->getButton() == MouseEvent::RIGHT) + else if (event->getButton() == MouseButton::RIGHT) { if (player_node && link == player_node->getName()) return; -- cgit v1.2.3-70-g09d2