From 7bdb50605562e47f1d6ae134881c09bd42293be5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 29 May 2015 16:19:21 +0300 Subject: Add strong typed int type BeingTypeId. --- src/gui/popups/popupmenu.cpp | 3 ++- src/gui/windows/npcdialog.cpp | 6 +++--- src/gui/windows/npcdialog.h | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/gui') diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index ee34d4ff7..59c1cc469 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -389,7 +389,8 @@ bool PopupMenu::addBeingMenu() if (!being) return false; - BeingInfo *const info = NPCDB::get(fromInt(being->getSubType(), BeingId)); + BeingInfo *const info = NPCDB::get(fromInt( + being->getSubType(), BeingTypeId)); if (!info) return false; diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index c8ccd482e..c60cbd9b4 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -205,7 +205,7 @@ void NpcDialog::postInit() if (being) { showAvatar(NPCDB::getAvatarFor(fromInt( - being->getSubType(), BeingId))); + being->getSubType(), BeingTypeId))); setCaption(being->getName()); } } @@ -862,9 +862,9 @@ void NpcDialog::restoreCamera() mCameraMode = -1; } -void NpcDialog::showAvatar(const BeingId avatarId) +void NpcDialog::showAvatar(const BeingTypeId avatarId) { - const bool needShow = (avatarId != BeingId_zero); + const bool needShow = (avatarId != BeingTypeId_zero); if (needShow) { delete mAvatarBeing; diff --git a/src/gui/windows/npcdialog.h b/src/gui/windows/npcdialog.h index 378bbd5e9..5d6786255 100644 --- a/src/gui/windows/npcdialog.h +++ b/src/gui/windows/npcdialog.h @@ -24,6 +24,7 @@ #define GUI_WINDOWS_NPCDIALOG_H #include "enums/simpletypes/beingid.h" +#include "enums/simpletypes/beingtypeid.h" #include "enums/simpletypes/visible.h" #include "gui/models/extendedlistmodel.h" @@ -197,7 +198,7 @@ class NpcDialog final : public Window, void refocus(); - void showAvatar(const BeingId avatarId); + void showAvatar(const BeingTypeId avatarId); void setAvatarDirection(const uint8_t direction); -- cgit v1.2.3-70-g09d2