diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-13 01:04:05 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-13 01:04:05 +0300 |
commit | ea0b61e18f36f28806940b00a2cddaef912c3340 (patch) | |
tree | 616205f44832d4ced4fc0b50b650eedb0fbf435c /src/gui/viewport.cpp | |
parent | 814e88e5ca69bc54837be27429dbf42dd41f7ac6 (diff) | |
download | mv-ea0b61e18f36f28806940b00a2cddaef912c3340.tar.gz mv-ea0b61e18f36f28806940b00a2cddaef912c3340.tar.bz2 mv-ea0b61e18f36f28806940b00a2cddaef912c3340.tar.xz mv-ea0b61e18f36f28806940b00a2cddaef912c3340.zip |
Move actor type into separate file.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r-- | src/gui/viewport.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 35805287b..f8f0c2ec0 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -256,7 +256,7 @@ void Viewport::draw(Graphics *graphics) const ActorSprites &actors = actorManager->getAll(); FOR_EACH (ActorSpritesIterator, it, actors) { - if ((*it)->getType() == ActorSprite::FLOOR_ITEM) + if ((*it)->getType() == ActorType::FLOOR_ITEM) continue; Being *const b = static_cast<Being*>(*it); b->drawSpeech(mPixelViewX, mPixelViewY); @@ -425,8 +425,8 @@ bool Viewport::leftMouseAction() } else { - const ActorSprite::Type type = mHoverBeing->getType(); - if (type == ActorSprite::PLAYER) + const ActorType::Type type = mHoverBeing->getType(); + if (type == ActorType::PLAYER) { validateSpeed(); if (actorManager) @@ -438,7 +438,7 @@ bool Viewport::leftMouseAction() return true; } } - else if (type == ActorSprite::MONSTER || type == ActorSprite::NPC) + else if (type == ActorType::MONSTER || type == ActorType::NPC) { if (player_node->withinAttackRange(mHoverBeing) || inputManager.isActionActive(static_cast<int>( @@ -540,7 +540,7 @@ void Viewport::mousePressed(MouseEvent &event) if (actorManager) { Being *const target = actorManager->findNearestLivingBeing( - pixelX, pixelY, 20, ActorSprite::MONSTER); + pixelX, pixelY, 20, ActorType::MONSTER); if (target) player_node->setTarget(target); @@ -897,14 +897,14 @@ void Viewport::mouseMoved(MouseEvent &event A_UNUSED) const int x = mMouseX + mPixelViewX; const int y = mMouseY + mPixelViewY; - ActorSprite::Type type = ActorSprite::UNKNOWN; + ActorType::Type type = ActorType::UNKNOWN; mHoverBeing = actorManager->findBeingByPixel(x, y, true); if (mHoverBeing) type = mHoverBeing->getType(); if (mHoverBeing - && (type == Being::PLAYER - || type == Being::NPC - || type == Being::PET)) + && (type == ActorType::PLAYER + || type == ActorType::NPC + || type == ActorType::PET)) { mTextPopup->setVisible(false); if (mShowBeingPopup) @@ -954,23 +954,23 @@ void Viewport::mouseMoved(MouseEvent &event A_UNUSED) { switch (type) { - case ActorSprite::NPC: + case ActorType::NPC: gui->setCursorType(mHoverBeing->getHoverCursor()); break; - case ActorSprite::MONSTER: + case ActorType::MONSTER: gui->setCursorType(mHoverBeing->getHoverCursor()); break; - case ActorSprite::PORTAL: + case ActorType::PORTAL: gui->setCursorType(mHoverBeing->getHoverCursor()); break; - case ActorSprite::AVATAR: - case ActorSprite::FLOOR_ITEM: - case ActorSprite::UNKNOWN: - case ActorSprite::PLAYER: - case ActorSprite::PET: + case ActorType::AVATAR: + case ActorType::FLOOR_ITEM: + case ActorType::UNKNOWN: + case ActorType::PLAYER: + case ActorType::PET: default: gui->setCursorType(Cursor::CURSOR_POINTER); break; |