From 9f1994182d4225f630a93ae06b01927c4f7a9a37 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 29 May 2015 20:33:10 +0300 Subject: Convert ActorType enum into strong typed enum. --- src/gui/popups/beingpopup.cpp | 2 +- src/gui/popups/popupmenu.cpp | 2 +- src/gui/popups/popupmenu.h | 2 +- src/gui/viewport.cpp | 4 ++-- src/gui/widgets/avatarlistbox.cpp | 3 +-- 5 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src/gui') diff --git a/src/gui/popups/beingpopup.cpp b/src/gui/popups/beingpopup.cpp index 167767e74..8cacafefb 100644 --- a/src/gui/popups/beingpopup.cpp +++ b/src/gui/popups/beingpopup.cpp @@ -157,7 +157,7 @@ void BeingPopup::show(const int x, const int y, Being *const b) label7->setCaption(""); #ifdef EATHENA_SUPPORT - const ActorType::Type type = b->getType(); + const ActorTypeT type = b->getType(); if (type == ActorType::Pet) { PetInfo *const info = PlayerInfo::getPet(); diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 59c1cc469..6c348a8e5 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -1070,7 +1070,7 @@ void PopupMenu::handleLink(const std::string &link, else { dialog->setText(Being::loadComment(mNick, - static_cast(mType))); + static_cast(mType))); } dialog->setActionEventId("ok"); dialog->addActionListener(&mPlayerListener); diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h index e1f9b3ba7..d963591bc 100644 --- a/src/gui/popups/popupmenu.h +++ b/src/gui/popups/popupmenu.h @@ -216,7 +216,7 @@ class PopupMenu final : public Popup, public LinkHandler Button *mButton; std::string mNick; TextField *mTextField; - ActorType::Type mType; + ActorTypeT mType; int mX; int mY; diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index e0ffd732f..2beed89d0 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -437,7 +437,7 @@ bool Viewport::leftMouseAction() } else { - const ActorType::Type type = mHoverBeing->getType(); + const ActorTypeT type = mHoverBeing->getType(); if (type == ActorType::Player) { validateSpeed(); @@ -778,7 +778,7 @@ void Viewport::mouseMoved(MouseEvent &event) const int x = mMouseX + mPixelViewX; const int y = mMouseY + mPixelViewY; - ActorType::Type type = ActorType::Unknown; + ActorTypeT type = ActorType::Unknown; mHoverBeing = actorManager->findBeingByPixel(x, y, AllPlayers_true); if (mHoverBeing) type = mHoverBeing->getType(); diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 7bbaf5196..a3c29a68a 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -660,8 +660,7 @@ void AvatarListBox::mousePressed(MouseEvent &event) popupMenu->showAttackMonsterPopup(viewport->mMouseX, viewport->mMouseY, name, - static_cast(model->getAvatarAt( - selected)->getType())); + model->getAvatarAt(selected)->getType()); break; } case MapItemType::PICKUP: -- cgit v1.2.3-70-g09d2