diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-17 21:05:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-17 21:05:17 +0300 |
commit | d119e4425f418afe1198839a57e7b186d717d587 (patch) | |
tree | 32f67704ac02e373161607946ca130cc5397535a /src/gui/widgets | |
parent | c7f654988a90f377bea6cf04492c6577246a0549 (diff) | |
download | manaverse-d119e4425f418afe1198839a57e7b186d717d587.tar.gz manaverse-d119e4425f418afe1198839a57e7b186d717d587.tar.bz2 manaverse-d119e4425f418afe1198839a57e7b186d717d587.tar.xz manaverse-d119e4425f418afe1198839a57e7b186d717d587.zip |
Remove getters for mouse position and use direct variables.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/avatarlistbox.cpp | 20 | ||||
-rw-r--r-- | src/gui/widgets/dropshortcutcontainer.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/emoteshortcutcontainer.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/itemcontainer.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/itemlinkhandler.cpp | 8 | ||||
-rw-r--r-- | src/gui/widgets/itemshortcutcontainer.cpp | 8 | ||||
-rw-r--r-- | src/gui/widgets/shoplistbox.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/skilllistbox.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/spellshortcutcontainer.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/tabs/debugwindowtabs.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/textfield.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/window.cpp | 4 |
12 files changed, 36 insertions, 36 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 21689311a..909f01618 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -395,14 +395,14 @@ void AvatarListBox::mousePressed(MouseEvent &event) avatar->getName(), ActorType::PLAYER); if (being) { - popupMenu->showPopup(viewport->getMouseX(), - viewport->getMouseY(), + popupMenu->showPopup(viewport->mMouseX, + viewport->mMouseY, being); } else { - popupMenu->showPlayerPopup(viewport->getMouseX(), - viewport->getMouseY(), + popupMenu->showPlayerPopup(viewport->mMouseX, + viewport->mMouseY, avatar->getName()); } } @@ -418,8 +418,8 @@ void AvatarListBox::mousePressed(MouseEvent &event) else name = model->getAvatarAt(selected)->getName(); - popupMenu->showAttackMonsterPopup(viewport->getMouseX(), - viewport->getMouseY(), + popupMenu->showAttackMonsterPopup(viewport->mMouseX, + viewport->mMouseY, name, static_cast<ActorType::Type>(model->getAvatarAt( selected)->getType())); @@ -434,8 +434,8 @@ void AvatarListBox::mousePressed(MouseEvent &event) else name = model->getAvatarAt(selected)->getName(); - popupMenu->showPickupItemPopup(viewport->getMouseX(), - viewport->getMouseY(), + popupMenu->showPickupItemPopup(viewport->mMouseX, + viewport->mMouseY, name); break; } @@ -460,8 +460,8 @@ void AvatarListBox::mousePressed(MouseEvent &event) { MapItem *const mapItem = map->findPortalXY( ava->getX(), ava->getY()); - popupMenu->showPopup(viewport->getMouseX(), - viewport->getMouseY(), + popupMenu->showPopup(viewport->mMouseX, + viewport->mMouseY, mapItem); } break; diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp index 9d423f8ac..6d3d259b0 100644 --- a/src/gui/widgets/dropshortcutcontainer.cpp +++ b/src/gui/widgets/dropshortcutcontainer.cpp @@ -214,8 +214,8 @@ void DropShortcutContainer::mousePressed(MouseEvent &event) if (popupMenu) { - popupMenu->showDropPopup(viewport->getMouseX(), - viewport->getMouseY(), + popupMenu->showDropPopup(viewport->mMouseX, + viewport->mMouseY, item); } } @@ -278,7 +278,7 @@ void DropShortcutContainer::mouseMoved(MouseEvent &event) if (item && viewport) { itemPopup->setItem(item); - itemPopup->position(viewport->getMouseX(), viewport->getMouseY()); + itemPopup->position(viewport->mMouseX, viewport->mMouseY); } else { diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp index a1fee31a2..c07482e1b 100644 --- a/src/gui/widgets/emoteshortcutcontainer.cpp +++ b/src/gui/widgets/emoteshortcutcontainer.cpp @@ -199,7 +199,7 @@ void EmoteShortcutContainer::mouseMoved(MouseEvent &event) if (static_cast<size_t>(index) < mEmoteImg.size() && mEmoteImg[index]) { const EmoteSprite *const sprite = mEmoteImg[index]; - textPopup->show(viewport->getMouseX(), viewport->getMouseY(), + textPopup->show(viewport->mMouseX, viewport->mMouseY, strprintf("%s, %d", sprite->name.c_str(), sprite->id)); } } diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 27c640df5..37e0c0ffd 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -607,7 +607,7 @@ void ItemContainer::mouseMoved(MouseEvent &event) if (item && viewport) { itemPopup->setItem(item); - itemPopup->position(viewport->getMouseX(), viewport->getMouseY()); + itemPopup->position(viewport->mMouseX, viewport->mMouseY); } else { diff --git a/src/gui/widgets/itemlinkhandler.cpp b/src/gui/widgets/itemlinkhandler.cpp index 433639944..589f8f6d1 100644 --- a/src/gui/widgets/itemlinkhandler.cpp +++ b/src/gui/widgets/itemlinkhandler.cpp @@ -79,8 +79,8 @@ void ItemLinkHandler::handleLink(const std::string &link, MouseEvent *event) { if (popupMenu) { - popupMenu->showLinkPopup(viewport->getMouseX(), - viewport->getMouseY(), + popupMenu->showLinkPopup(viewport->mMouseX, + viewport->mMouseY, url); } } @@ -128,8 +128,8 @@ void ItemLinkHandler::handleLink(const std::string &link, MouseEvent *event) } else if (viewport) { - itemPopup->position(viewport->getMouseX(), - viewport->getMouseY()); + itemPopup->position(viewport->mMouseX, + viewport->mMouseY); } } } diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index f92fef323..df86c45ae 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -330,8 +330,8 @@ void ItemShortcutContainer::mousePressed(MouseEvent &event) event.consume(); if (popupMenu && selShortcut && viewport) { - popupMenu->showItemPopup(viewport->getMouseX(), - viewport->getMouseY(), + popupMenu->showItemPopup(viewport->mMouseX, + viewport->mMouseY, selShortcut->getItem(index), selShortcut->getItemColor(index)); } @@ -409,7 +409,7 @@ void ItemShortcutContainer::mouseMoved(MouseEvent &event) if (item && viewport) { itemPopup->setItem(item); - itemPopup->position(viewport->getMouseX(), viewport->getMouseY()); + itemPopup->position(viewport->mMouseX, viewport->mMouseY); } else { @@ -423,7 +423,7 @@ void ItemShortcutContainer::mouseMoved(MouseEvent &event) if (spell && viewport) { spellPopup->setItem(spell); - spellPopup->view(viewport->getMouseX(), viewport->getMouseY()); + spellPopup->view(viewport->mMouseX, viewport->mMouseY); } else { diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index 728e1dc29..a2161d96d 100644 --- a/src/gui/widgets/shoplistbox.cpp +++ b/src/gui/widgets/shoplistbox.cpp @@ -211,7 +211,7 @@ void ShopListBox::mouseMoved(MouseEvent &event) if (item) { itemPopup->setItem(item); - itemPopup->position(viewport->getMouseX(), viewport->getMouseY()); + itemPopup->position(viewport->mMouseX, viewport->mMouseY); } else { @@ -233,8 +233,8 @@ void ShopListBox::mouseReleased(MouseEvent& event) Item *const item = mShopItems->at(mSelected); if (popupMenu && viewport) { - popupMenu->showItemPopup(viewport->getMouseX(), - viewport->getMouseY(), + popupMenu->showItemPopup(viewport->mMouseX, + viewport->mMouseY, item); } } diff --git a/src/gui/widgets/skilllistbox.h b/src/gui/widgets/skilllistbox.h index c932fc95b..a3b6be059 100644 --- a/src/gui/widgets/skilllistbox.h +++ b/src/gui/widgets/skilllistbox.h @@ -168,7 +168,7 @@ class SkillListBox final : public ListBox if (!skill) return; - mPopup->show(viewport->getMouseX(), viewport->getMouseY(), + mPopup->show(viewport->mMouseX, viewport->mMouseY, skill->data->dispName, skill->data->description); } diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index 1ddf17981..0257cea08 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -259,8 +259,8 @@ void SpellShortcutContainer::mouseReleased(MouseEvent &event) if (spell && popupMenu) { - popupMenu->showSpellPopup(viewport->getMouseX(), - viewport->getMouseY(), + popupMenu->showSpellPopup(viewport->mMouseX, + viewport->mMouseY, spell); } } @@ -283,7 +283,7 @@ void SpellShortcutContainer::mouseMoved(MouseEvent &event) if (spell && !spell->isEmpty()) { spellPopup->setItem(spell); - spellPopup->view(viewport->getMouseX(), viewport->getMouseY()); + spellPopup->view(viewport->mMouseX, viewport->mMouseY); } else { diff --git a/src/gui/widgets/tabs/debugwindowtabs.cpp b/src/gui/widgets/tabs/debugwindowtabs.cpp index b50baac78..8e625ac70 100644 --- a/src/gui/widgets/tabs/debugwindowtabs.cpp +++ b/src/gui/widgets/tabs/debugwindowtabs.cpp @@ -176,9 +176,9 @@ void MapDebugTab::logic() if (map && viewport) { // Get the current mouse position - const int mouseTileX = (viewport->getMouseX() + viewport->getCameraX()) + const int mouseTileX = (viewport->mMouseX + viewport->getCameraX()) / map->getTileWidth(); - const int mouseTileY = (viewport->getMouseY() + viewport->getCameraY()) + const int mouseTileY = (viewport->mMouseY + viewport->getCameraY()) / map->getTileHeight(); mTileMouseLabel->setCaption(strprintf("%s (%d, %d)", // TRANSLATORS: debug window label diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index 0810b9395..e47f1905f 100644 --- a/src/gui/widgets/textfield.cpp +++ b/src/gui/widgets/textfield.cpp @@ -707,8 +707,8 @@ void TextField::mousePressed(MouseEvent &event) { if (popupMenu) { - popupMenu->showTextFieldPopup(viewport->getMouseX(), - viewport->getMouseY(), + popupMenu->showTextFieldPopup(viewport->mMouseX, + viewport->mMouseY, this); } } diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 7a85d5352..f8622bb20 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -770,8 +770,8 @@ void Window::mousePressed(MouseEvent &event) { event.consume(); popupMenu->showWindowPopup(this, - viewport->getMouseX(), - viewport->getMouseY()); + viewport->mMouseX, + viewport->mMouseY); } } } |