summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-05-02 14:43:40 -0600
committerJared Adams <jaxad0127@gmail.com>2010-05-06 22:21:57 -0600
commit9baedc27191c82bbf1fedee2a7e738bc5b267c0e (patch)
treef0986c6839d1e79b402d5d4ec36e4994741955ea /src/gui
parent844e9a7a72faca6a212e788a3adc45e17f41dca6 (diff)
downloadmana-9baedc27191c82bbf1fedee2a7e738bc5b267c0e.tar.gz
mana-9baedc27191c82bbf1fedee2a7e738bc5b267c0e.tar.bz2
mana-9baedc27191c82bbf1fedee2a7e738bc5b267c0e.tar.xz
mana-9baedc27191c82bbf1fedee2a7e738bc5b267c0e.zip
Add support for floor item sprites
This commit adds a sprite hierarchy (Sprite->ImageSprite,AnimatedSprite,CompundSprite; CompoundSprite,Actor->ActorSprite;ActorSprite->Being,FloorItem) to collect common functionailty into new base classes which will make other Mantis tickets easier to do. Also allows monsters to use particle effects. Reviewed-by: Bertram
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/popupmenu.cpp9
-rw-r--r--src/gui/widgets/playerbox.cpp4
2 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index 520b4005..77e919a9 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -182,11 +182,11 @@ void PopupMenu::showPopup(int x, int y, Being *being)
void PopupMenu::showPopup(int x, int y, FloorItem *floorItem)
{
mFloorItem = floorItem;
- mItem = floorItem->getItem();
+ ItemInfo info = floorItem->getInfo();
mBrowserBox->clearRows();
// Floor item can be picked up (single option, candidate for removal)
- std::string name = ItemDB::get(mFloorItem->getItemId()).getName();
+ std::string name = info.getName();
mBrowserBox->addRow(strprintf("@@pickup|%s@@", strprintf(_("Pick up %s"),
name.c_str()).c_str()));
mBrowserBox->addRow(strprintf("@@chat|%s@@", _("Add to chat")));
@@ -283,7 +283,10 @@ void PopupMenu::handleLink(const std::string &link)
else if (link == "chat")
{
- chatWindow->addItemText(mItem->getInfo().getName());
+ if (mItem)
+ chatWindow->addItemText(mItem->getInfo().getName());
+ else if (mFloorItem)
+ chatWindow->addItemText(mFloorItem->getInfo().getName());
}
else if (link == "split")
diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp
index 57cbec6f..a953f474 100644
--- a/src/gui/widgets/playerbox.cpp
+++ b/src/gui/widgets/playerbox.cpp
@@ -86,8 +86,8 @@ void PlayerBox::draw(gcn::Graphics *graphics)
{
// Draw character
const int bs = getFrameSize();
- const int x = getWidth() / 2 + bs;
- const int y = getHeight() - bs;
+ const int x = getWidth() / 2 + bs - 16;
+ const int y = getHeight() - bs - 32;
mPlayer->drawSpriteAt(static_cast<Graphics*>(graphics), x, y);
}