summaryrefslogtreecommitdiff
path: root/src/resources/monsterdb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/monsterdb.cpp')
-rw-r--r--src/resources/monsterdb.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp
index ed4acd38..cee9eea5 100644
--- a/src/resources/monsterdb.cpp
+++ b/src/resources/monsterdb.cpp
@@ -1,32 +1,31 @@
/*
* The Mana World
- * Copyright 2004 The Mana World Development Team
+ * Copyright (C) 2004 The Mana World Development Team
*
* This file is part of The Mana World.
*
- * The Mana World is free software; you can redistribute it and/or modify
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* any later version.
*
- * The Mana World is distributed in the hope that it will be useful,
+ * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with The Mana World; if not, write to the Free Software
+ * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "monsterdb.h"
-
-#include "resourcemanager.h"
-#include "spritedef.h"
+#include "monsterinfo.h"
#include "../log.h"
#include "../utils/dtor.h"
+#include "../utils/gettext.h"
#include "../utils/xml.h"
namespace
@@ -36,18 +35,17 @@ namespace
bool mLoaded = false;
}
-void
-MonsterDB::load()
+void MonsterDB::load()
{
if (mLoaded)
return;
mUnknown.addSprite("error.xml");
- mUnknown.setName("unnamed");
+ mUnknown.setName(_("unnamed"));
logger->log("Initializing monster database...");
- XML::Document doc("monsters.xml");
+ XML::Document doc(_("monsters.xml"));
xmlNodePtr rootNode = doc.rootNode();
if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "monsters"))
@@ -59,11 +57,13 @@ MonsterDB::load()
for_each_xml_child_node(monsterNode, rootNode)
{
if (!xmlStrEqual(monsterNode->name, BAD_CAST "monster"))
+ {
continue;
+ }
- MonsterInfo *currentInfo = new MonsterInfo();
+ MonsterInfo *currentInfo = new MonsterInfo;
- currentInfo->setName(XML::getProperty(monsterNode, "name", "unnamed"));
+ currentInfo->setName(XML::getProperty(monsterNode, "name", _("unnamed")));
std::string targetCursor;
targetCursor = XML::getProperty(monsterNode, "targetCursor", "medium");
@@ -81,8 +81,8 @@ MonsterDB::load()
}
else
{
- logger->log("MonsterDB: Unknown target cursor type \"%s\" for %s "
- "- using medium sized one",
+ logger->log("MonsterDB: Unknown target cursor type \"%s\" for %s -"
+ "using medium sized one",
targetCursor.c_str(), currentInfo->getName().c_str());
currentInfo->setTargetCursorSize(Being::TC_MEDIUM);
}
@@ -92,7 +92,8 @@ MonsterDB::load()
{
if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite"))
{
- currentInfo->addSprite((const char*) spriteNode->xmlChildrenNode->content);
+ currentInfo->addSprite(
+ (const char*) spriteNode->xmlChildrenNode->content);
}
else if (xmlStrEqual(spriteNode->name, BAD_CAST "sound"))
{