From 36832f3a5378f739da7040f0711b7101dbc2af02 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Mon, 17 May 2010 21:58:00 -0600 Subject: 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 --- src/resources/monsterdb.cpp | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'src/resources/monsterdb.cpp') diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index c70cee94..da89302d 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -23,14 +23,14 @@ #include "log.h" +#include "net/net.h" + #include "resources/beinginfo.h" #include "utils/dtor.h" #include "utils/gettext.h" #include "utils/xml.h" -#include "net/net.h" - #define OLD_TMWATHENA_OFFSET 1002 namespace @@ -74,27 +74,8 @@ void MonsterDB::load() currentInfo->setName(XML::getProperty(monsterNode, "name", _("unnamed"))); - std::string targetCursor; - targetCursor = XML::getProperty(monsterNode, "targetCursor", "medium"); - if (targetCursor == "small") - { - currentInfo->setTargetCursorSize(ActorSprite::TC_SMALL); - } - else if (targetCursor == "medium") - { - currentInfo->setTargetCursorSize(ActorSprite::TC_MEDIUM); - } - else if (targetCursor == "large") - { - currentInfo->setTargetCursorSize(ActorSprite::TC_LARGE); - } - else - { - logger->log("MonsterDB: Unknown target cursor type \"%s\" for %s -" - "using medium sized one", - targetCursor.c_str(), currentInfo->getName().c_str()); - currentInfo->setTargetCursorSize(ActorSprite::TC_MEDIUM); - } + currentInfo->setTargetCursorSize(XML::getProperty(monsterNode, + "targetCursor", "medium")); SpriteDisplay display; -- cgit v1.2.3-70-g09d2