summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2012-04-03 13:35:18 +0200
committerErik Schilling <ablu.erikschilling@googlemail.com>2012-04-04 16:28:11 +0200
commit3a05c2d4e4f2229516182ebceea880d227b65708 (patch)
treed3a93585e55f1cac9a188ee0bb73b77a1db820d0 /src/gui
parent31010d6d3ba6600860a9f6dd925ac3d8e3f2c830 (diff)
downloadmana-client-3a05c2d4e4f2229516182ebceea880d227b65708.tar.gz
mana-client-3a05c2d4e4f2229516182ebceea880d227b65708.tar.bz2
mana-client-3a05c2d4e4f2229516182ebceea880d227b65708.tar.xz
mana-client-3a05c2d4e4f2229516182ebceea880d227b65708.zip
Synced specials to latest manaserv changes
Reviewed-by: bjorn.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/specialswindow.cpp41
1 files changed, 20 insertions, 21 deletions
diff --git a/src/gui/specialswindow.cpp b/src/gui/specialswindow.cpp
index 8097eb05..7db5952a 100644
--- a/src/gui/specialswindow.cpp
+++ b/src/gui/specialswindow.cpp
@@ -48,6 +48,8 @@
#include "utils/stringutils.h"
#include "utils/xml.h"
+#include "localplayer.h"
+
#include <string>
#define SPECIALS_WIDTH 200
@@ -106,12 +108,20 @@ void SpecialsWindow::action(const gcn::ActionEvent &event)
if (disp)
{
- /*Being *target = local_player->getTarget();
-
- if (target)
- Net::getSpecialHandler()->use(disp->mInfo->id, 1, target->getId());
- else*/
- Net::getSpecialHandler()->use(disp->mInfo->id);
+ if (disp->mInfo->targetMode == SpecialInfo::TARGET_BEING)
+ {
+ Being *target = local_player->getTarget();
+
+ if (target)
+ Net::getSpecialHandler()->use(disp->mInfo->id, 1, target->getId());
+ else
+ Net::getSpecialHandler()->use(disp->mInfo->id);
+ }
+ else
+ {
+ // TODO: Allow the player to aim at a position on the map and
+ // Use special on the map position.
+ }
}
}
else if (event.getId() == "close")
@@ -202,22 +212,11 @@ SpecialEntry::SpecialEntry(SpecialInfo *info) :
mNameLabel->setPosition(35, 0);
add(mNameLabel);
- if (info->hasLevel)
- {
- mLevelLabel = new Label(toString(info->level));
- mLevelLabel->setPosition(getWidth() - mLevelLabel->getWidth(), 0);
- add(mLevelLabel);
- }
-
-
- if (info->isActive)
- {
- mUse = new Button("Use", "use", specialsWindow);
- mUse->setPosition(getWidth() - mUse->getWidth(), 13);
- add(mUse);
- }
+ mUse = new Button("Use", "use", specialsWindow);
+ mUse->setPosition(getWidth() - mUse->getWidth(), 13);
+ add(mUse);
- if (info->hasRechargeBar)
+ if (info->rechargeable)
{
float progress = (float)info->rechargeCurrent / (float)info->rechargeNeeded;
mRechargeBar = new ProgressBar(progress, 100, 10, Theme::PROG_MP);