summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-17 13:40:14 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-17 13:40:14 +0300
commit2cb9f5c3d47077a459fabf15800b1c45cfdacb3a (patch)
treead6eba1142495acd31dc8a50b56988a26350f2d5 /src/gui/widgets
parent829cd57e021ea85cffdbd3f3a7b18da835e00b7c (diff)
downloadmv-2cb9f5c3d47077a459fabf15800b1c45cfdacb3a.tar.gz
mv-2cb9f5c3d47077a459fabf15800b1c45cfdacb3a.tar.bz2
mv-2cb9f5c3d47077a459fabf15800b1c45cfdacb3a.tar.xz
mv-2cb9f5c3d47077a459fabf15800b1c45cfdacb3a.zip
Remove proxy methods used for access popup menu.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/avatarlistbox.cpp26
-rw-r--r--src/gui/widgets/dropshortcutcontainer.cpp9
-rw-r--r--src/gui/widgets/itemlinkhandler.cpp9
-rw-r--r--src/gui/widgets/itemshortcutcontainer.cpp7
-rw-r--r--src/gui/widgets/shoplistbox.cpp9
-rw-r--r--src/gui/widgets/spellshortcutcontainer.cpp9
-rw-r--r--src/gui/widgets/textfield.cpp12
-rw-r--r--src/gui/widgets/window.cpp8
8 files changed, 69 insertions, 20 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp
index 4968393b2..21689311a 100644
--- a/src/gui/widgets/avatarlistbox.cpp
+++ b/src/gui/widgets/avatarlistbox.cpp
@@ -34,6 +34,8 @@
#include "gui/fonts/font.h"
+#include "gui/popups/popupmenu.h"
+
#include "gui/models/avatarlistmodel.h"
#include "gui/windows/chatwindow.h"
@@ -392,9 +394,17 @@ void AvatarListBox::mousePressed(MouseEvent &event)
const Being *const being = actorManager->findBeingByName(
avatar->getName(), ActorType::PLAYER);
if (being)
- popupManager->showPopup(being);
+ {
+ popupMenu->showPopup(viewport->getMouseX(),
+ viewport->getMouseY(),
+ being);
+ }
else
- popupManager->showPlayerPopup(avatar->getName());
+ {
+ popupMenu->showPlayerPopup(viewport->getMouseX(),
+ viewport->getMouseY(),
+ avatar->getName());
+ }
}
break;
}
@@ -408,7 +418,9 @@ void AvatarListBox::mousePressed(MouseEvent &event)
else
name = model->getAvatarAt(selected)->getName();
- popupManager->showAttackMonsterPopup(name,
+ popupMenu->showAttackMonsterPopup(viewport->getMouseX(),
+ viewport->getMouseY(),
+ name,
static_cast<ActorType::Type>(model->getAvatarAt(
selected)->getType()));
break;
@@ -422,7 +434,9 @@ void AvatarListBox::mousePressed(MouseEvent &event)
else
name = model->getAvatarAt(selected)->getName();
- popupManager->showPickupItemPopup(name);
+ popupMenu->showPickupItemPopup(viewport->getMouseX(),
+ viewport->getMouseY(),
+ name);
break;
}
case MapItemType::HOME:
@@ -446,7 +460,9 @@ void AvatarListBox::mousePressed(MouseEvent &event)
{
MapItem *const mapItem = map->findPortalXY(
ava->getX(), ava->getY());
- popupManager->showPopup(mapItem);
+ popupMenu->showPopup(viewport->getMouseX(),
+ viewport->getMouseY(),
+ mapItem);
}
break;
}
diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp
index b57c98273..8fe3a8b2b 100644
--- a/src/gui/widgets/dropshortcutcontainer.cpp
+++ b/src/gui/widgets/dropshortcutcontainer.cpp
@@ -34,6 +34,7 @@
#include "gui/fonts/font.h"
#include "gui/popups/itempopup.h"
+#include "gui/popups/popupmenu.h"
#include "gui/windows/inventorywindow.h"
@@ -215,8 +216,12 @@ void DropShortcutContainer::mousePressed(MouseEvent &event)
Item *const item = inv->findItem(dropShortcut->getItem(index),
dropShortcut->getItemColor(index));
- if (popupManager)
- popupManager->showDropPopup(item);
+ if (popupMenu)
+ {
+ popupMenu->showDropPopup(viewport->getMouseX(),
+ viewport->getMouseY(),
+ item);
+ }
}
}
diff --git a/src/gui/widgets/itemlinkhandler.cpp b/src/gui/widgets/itemlinkhandler.cpp
index 2217b051f..f63991f8d 100644
--- a/src/gui/widgets/itemlinkhandler.cpp
+++ b/src/gui/widgets/itemlinkhandler.cpp
@@ -26,6 +26,7 @@
#include "gui/viewport.h"
#include "gui/popups/itempopup.h"
+#include "gui/popups/popupmenu.h"
#include "gui/windows/confirmdialog.h"
#include "gui/windows/helpwindow.h"
@@ -79,8 +80,12 @@ void ItemLinkHandler::handleLink(const std::string &link, MouseEvent *event)
}
else if (button == MouseButton::RIGHT)
{
- if (popupManager)
- popupManager->showLinkPopup(url);
+ if (popupMenu)
+ {
+ popupMenu->showLinkPopup(viewport->getMouseX(),
+ viewport->getMouseY(),
+ url);
+ }
}
}
else if (!link.empty() && link[0] == '?')
diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp
index 2d8deeba9..84b7bc249 100644
--- a/src/gui/widgets/itemshortcutcontainer.cpp
+++ b/src/gui/widgets/itemshortcutcontainer.cpp
@@ -39,6 +39,7 @@
#include "gui/fonts/font.h"
#include "gui/popups/itempopup.h"
+#include "gui/popups/popupmenu.h"
#include "gui/popups/spellpopup.h"
#include "gui/windows/inventorywindow.h"
@@ -334,9 +335,11 @@ void ItemShortcutContainer::mousePressed(MouseEvent &event)
else if (event.getButton() == MouseButton::RIGHT)
{
event.consume();
- if (popupManager && selShortcut)
+ if (popupMenu && selShortcut && viewport)
{
- popupManager->showItemPopup(selShortcut->getItem(index),
+ popupMenu->showItemPopup(viewport->getMouseX(),
+ viewport->getMouseY(),
+ selShortcut->getItem(index),
selShortcut->getItemColor(index));
}
}
diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp
index 019fd3e63..8efc5241f 100644
--- a/src/gui/widgets/shoplistbox.cpp
+++ b/src/gui/widgets/shoplistbox.cpp
@@ -33,6 +33,7 @@
#include "gui/fonts/font.h"
#include "gui/popups/itempopup.h"
+#include "gui/popups/popupmenu.h"
#include "gui/models/shopitems.h"
@@ -234,8 +235,12 @@ void ShopListBox::mouseReleased(MouseEvent& event)
return;
Item *const item = mShopItems->at(mSelected);
- if (popupManager)
- popupManager->showItemPopup(item);
+ if (popupMenu && viewport)
+ {
+ popupMenu->showItemPopup(viewport->getMouseX(),
+ viewport->getMouseY(),
+ item);
+ }
}
}
diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp
index 8960725d5..164513d73 100644
--- a/src/gui/widgets/spellshortcutcontainer.cpp
+++ b/src/gui/widgets/spellshortcutcontainer.cpp
@@ -32,6 +32,7 @@
#include "gui/fonts/font.h"
+#include "gui/popups/popupmenu.h"
#include "gui/popups/spellpopup.h"
#include "gui/windows/shortcutwindow.h"
@@ -260,8 +261,12 @@ void SpellShortcutContainer::mouseReleased(MouseEvent &event)
if (itemId >= 0)
spell = spellManager->getSpell(itemId);
- if (spell && popupManager)
- popupManager->showSpellPopup(spell);
+ if (spell && popupMenu)
+ {
+ popupMenu->showSpellPopup(viewport->getMouseX(),
+ viewport->getMouseY(),
+ spell);
+ }
}
}
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index adb455432..0810b9395 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -70,14 +70,16 @@
#include "input/inputmanager.h"
#include "gui/gui.h"
-#include "gui/popupmanager.h"
#include "gui/skin.h"
+#include "gui/viewport.h"
#ifdef ANDROID
#include "gui/windowmanager.h"
#endif
#include "gui/fonts/font.h"
+#include "gui/popups/popupmenu.h"
+
#include "resources/image.h"
#include "resources/imagerect.h"
@@ -703,8 +705,12 @@ void TextField::mousePressed(MouseEvent &event)
event.consume();
if (event.getButton() == MouseButton::RIGHT)
{
- if (popupManager)
- popupManager->showTextFieldPopup(this);
+ if (popupMenu)
+ {
+ popupMenu->showTextFieldPopup(viewport->getMouseX(),
+ viewport->getMouseY(),
+ this);
+ }
}
else if (event.getButton() == MouseButton::LEFT)
{
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 2078c4cef..7a85d5352 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -80,6 +80,8 @@
#include "gui/fonts/font.h"
+#include "gui/popups/popupmenu.h"
+
#include "gui/windows/setupwindow.h"
#include "gui/widgets/containerplacer.h"
@@ -764,10 +766,12 @@ void Window::mousePressed(MouseEvent &event)
}
else if (button == MouseButton::RIGHT)
{
- if (popupManager)
+ if (popupMenu)
{
event.consume();
- popupManager->showWindowPopup(this);
+ popupMenu->showWindowPopup(this,
+ viewport->getMouseX(),
+ viewport->getMouseY());
}
}
}