From 918c69d15b253fd3cfa1fb8bfc2b8c8bea5d18bf Mon Sep 17 00:00:00 2001 From: fgenesis Date: Wed, 11 Jul 2012 22:00:14 +0200 Subject: [PATCH] Some simplifications in ingredient name handling, by Henrik Holst --- Aquaria/Continuity.cpp | 6 ++---- Aquaria/RecipeMenuEntry.cpp | 10 +--------- files/data/ingredientnames.txt | 2 +- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/Aquaria/Continuity.cpp b/Aquaria/Continuity.cpp index 8f62e72..8902916 100644 --- a/Aquaria/Continuity.cpp +++ b/Aquaria/Continuity.cpp @@ -3263,14 +3263,12 @@ void Continuity::reset() if(dsq->mod.isActive()) { //load mod ingredients - fname = localisePath(dsq->mod.getPath() + "ingredients.txt", dsq->mod.getPath()); - loadIngredientData(fname); + loadIngredientData(dsq->mod.getPath() + "ingredients.txt"); } //load ingredients for the main game if(ingredientData.empty() && recipes.empty()) { - fname = localisePath("data/ingredients.txt"); - loadIngredientData(fname); + loadIngredientData("data/ingredients.txt"); } loadPetData(); diff --git a/Aquaria/RecipeMenuEntry.cpp b/Aquaria/RecipeMenuEntry.cpp index 476da9d..b3efa88 100644 --- a/Aquaria/RecipeMenuEntry.cpp +++ b/Aquaria/RecipeMenuEntry.cpp @@ -129,15 +129,7 @@ RecipeMenuEntry::RecipeMenuEntry(Recipe *recipe) : RenderObject(), recipe(recipe text->scale = Vector(0.8, 0.8); text->position = Vector(100*c, 0); //-20 - std::string typeName = recipe->types[i].typeName; - - size_t loc = typeName.find("Type"); - if (loc != std::string::npos) - { - typeName = typeName.substr(0, loc) + typeName.substr(loc+4, typeName.size()); - } - - typeName = dsq->continuity.getIngredientDisplayName(typeName); + std::string typeName = dsq->continuity.getIngredientDisplayName(recipe->types[i].typeName); if (recipe->types[i].type != IT_ANYTHING) typeName = dsq->continuity.stringBank.get(2031) + "\n" + typeName; diff --git a/files/data/ingredientnames.txt b/files/data/ingredientnames.txt index 7c81811..0a95a37 100644 --- a/files/data/ingredientnames.txt +++ b/files/data/ingredientnames.txt @@ -38,7 +38,7 @@ Mushroom Mushroom Oil Oil Part Part Perogi Perogi -PerogiType Perogi Type +PerogiType Perogi PlantBulb Plant Bulb PlantLeaf Plant Leaf PlumpPerogi Plump Perogi