summaryrefslogtreecommitdiff
path: root/src/actorsprite.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-08-02 02:32:18 -0600
committerJared Adams <jaxad0127@gmail.com>2010-08-02 02:48:03 -0600
commit42f6993e0deacc857302f48004031dd45b739874 (patch)
treef8a25e94b32257c1364864824fcf61c83b834d6d /src/actorsprite.cpp
parent6a0e5f20c9faf7623a465daa4a8b350d3a52e5e6 (diff)
downloadmana-client-42f6993e0deacc857302f48004031dd45b739874.tar.gz
mana-client-42f6993e0deacc857302f48004031dd45b739874.tar.bz2
mana-client-42f6993e0deacc857302f48004031dd45b739874.tar.xz
mana-client-42f6993e0deacc857302f48004031dd45b739874.zip
Remove non-GUI references to MiniStatusWindow
Reviewed-by: Freeyorp
Diffstat (limited to 'src/actorsprite.cpp')
-rw-r--r--src/actorsprite.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/actorsprite.cpp b/src/actorsprite.cpp
index 6a1dcbc7..3d0e7d54 100644
--- a/src/actorsprite.cpp
+++ b/src/actorsprite.cpp
@@ -23,6 +23,7 @@
#include "client.h"
#include "effectmanager.h"
+#include "eventmanager.h"
#include "imagesprite.h"
#include "localplayer.h"
#include "log.h"
@@ -53,9 +54,7 @@ ActorSprite::ActorSprite(int id):
mChildParticleEffects(&mStatusParticleEffects, false),
mMustResetParticles(false),
mUsedTargetCursor(NULL)
-{
- //
-}
+{}
ActorSprite::~ActorSprite()
{
@@ -261,12 +260,28 @@ void ActorSprite::internalTriggerEffect(int effectId, bool sfx, bool gfx)
void ActorSprite::updateStunMode(int oldMode, int newMode)
{
+ if (this == player_node)
+ {
+ Mana::Event event("Stun");
+ event.setInt("oldMode", oldMode);
+ event.setInt("newMode", newMode);
+ Mana::EventManager::trigger("ActorSprite", event);
+ }
+
handleStatusEffect(StatusEffect::getStatusEffect(oldMode, false), -1);
handleStatusEffect(StatusEffect::getStatusEffect(newMode, true), -1);
}
void ActorSprite::updateStatusEffect(int index, bool newStatus)
{
+ if (this == player_node)
+ {
+ Mana::Event event("UpdateStatusEffect");
+ event.setInt("index", index);
+ event.setBool("newStatus", newStatus);
+ Mana::EventManager::trigger("ActorSprite", event);
+ }
+
handleStatusEffect(StatusEffect::getStatusEffect(index, newStatus), index);
}