summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-25 01:13:56 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-25 01:18:02 +0300
commit1e4aa6a5e7476bea736b89fe5d7094b6a68705e5 (patch)
treee1f4bda6bcdf5497ae3e7a6b96afc1af563ee7f7 /src/gui/viewport.cpp
parentefcee136d7ab46a73286f1ac016d6e3b6a3faed4 (diff)
downloadplus-1e4aa6a5e7476bea736b89fe5d7094b6a68705e5.tar.gz
plus-1e4aa6a5e7476bea736b89fe5d7094b6a68705e5.tar.bz2
plus-1e4aa6a5e7476bea736b89fe5d7094b6a68705e5.tar.xz
plus-1e4aa6a5e7476bea736b89fe5d7094b6a68705e5.zip
Add support for different hover/pickup cursors for monsters, npc, items, etc.
In monsters.xml new monster attribute: hoverCursor - default value "attack". In npcs.xml new npc attribute: hoverCursor - default value "talk". In items.xml new item attribute: pickupCursor - default value "pickup". Warps using "up" cursor for now.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 42e6473ee..e7d7ab85d 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -788,6 +788,7 @@ void Viewport::mouseMoved(gcn::MouseEvent &event A_UNUSED)
if (mTextPopup->isVisible())
mTextPopup->setVisible(false);
}
+ gui->setCursorType(Cursor::CURSOR_UP);
return;
}
}
@@ -801,31 +802,34 @@ void Viewport::mouseMoved(gcn::MouseEvent &event A_UNUSED)
{
// NPCs
case ActorSprite::NPC:
- gui->setCursorType(Gui::CURSOR_TALK);
+ gui->setCursorType(mHoverBeing->getHoverCursor());
break;
// Monsters
case ActorSprite::MONSTER:
- gui->setCursorType(Gui::CURSOR_FIGHT);
+ gui->setCursorType(mHoverBeing->getHoverCursor());
break;
+ case ActorSprite::PORTAL:
+ gui->setCursorType(mHoverBeing->getHoverCursor());
+ break;
+
+ case ActorSprite::FLOOR_ITEM:
case ActorSprite::UNKNOWN:
case ActorSprite::PLAYER:
- case ActorSprite::FLOOR_ITEM:
- case ActorSprite::PORTAL:
default:
- gui->setCursorType(Gui::CURSOR_POINTER);
+ gui->setCursorType(Cursor::CURSOR_POINTER);
break;
}
}
// Item mouseover
else if (mHoverItem)
{
- gui->setCursorType(Gui::CURSOR_PICKUP);
+ gui->setCursorType(mHoverItem->getHoverCursor());
}
else
{
- gui->setCursorType(Gui::CURSOR_POINTER);
+ gui->setCursorType(Cursor::CURSOR_POINTER);
}
}