diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-05-17 21:58:00 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-05-17 22:00:17 -0600 |
commit | 36832f3a5378f739da7040f0711b7101dbc2af02 (patch) | |
tree | d53ccf51b07a1189465fd0d700ac95555515d4c6 /src/resources/beinginfo.cpp | |
parent | 3b4e7795c9ab3036988a1a7dfe6f5ed2ad12199d (diff) | |
download | mana-36832f3a5378f739da7040f0711b7101dbc2af02.tar.gz mana-36832f3a5378f739da7040f0711b7101dbc2af02.tar.bz2 mana-36832f3a5378f739da7040f0711b7101dbc2af02.tar.xz mana-36832f3a5378f739da7040f0711b7101dbc2af02.zip |
Add support for different target cursor sizes for NPCs
Moves the parsing logic for the size strings into BeingInfo to
share the code.
Reviewed-by: Freeyorp
Diffstat (limited to 'src/resources/beinginfo.cpp')
-rw-r--r-- | src/resources/beinginfo.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/resources/beinginfo.cpp b/src/resources/beinginfo.cpp index 30b4f86f..66addde9 100644 --- a/src/resources/beinginfo.cpp +++ b/src/resources/beinginfo.cpp @@ -21,6 +21,8 @@ #include "resources/beinginfo.h" +#include "log.h" + #include "utils/dtor.h" #include "utils/gettext.h" @@ -51,6 +53,22 @@ void BeingInfo::setDisplay(SpriteDisplay display) mDisplay = display; } +void BeingInfo::setTargetCursorSize(const std::string &size) +{ + if (size == "small") + setTargetCursorSize(ActorSprite::TC_SMALL); + else if (size == "medium") + setTargetCursorSize(ActorSprite::TC_MEDIUM); + else if (size == "large") + setTargetCursorSize(ActorSprite::TC_LARGE); + else + { + logger->log("Unknown target cursor type \"%s\" for %s - using medium " + "sized one", size.c_str(), getName().c_str()); + setTargetCursorSize(ActorSprite::TC_MEDIUM); + } +} + void BeingInfo::addSound(SoundEvent event, const std::string &filename) { if (mSounds.find(event) == mSounds.end()) |