mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-07-03 22:44:32 +00:00
If Aquaria is playing a mod, try to load the file "data/ingredients.txt"
in the mod first, then load the main ingredients file if nothing has been loaded (Original patch by Yogoda)
This commit is contained in:
parent
7039f1d2cc
commit
54199272e8
2 changed files with 18 additions and 4 deletions
|
@ -895,7 +895,7 @@ void Continuity::clearIngredientData()
|
||||||
ingredientData.clear();
|
ingredientData.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Continuity::loadIngredientData()
|
void Continuity::loadIngredientData(const std::string &file)
|
||||||
{
|
{
|
||||||
std::string line, name, gfx, type, effects;
|
std::string line, name, gfx, type, effects;
|
||||||
|
|
||||||
|
@ -916,7 +916,7 @@ void Continuity::loadIngredientData()
|
||||||
clearIngredientData();
|
clearIngredientData();
|
||||||
recipes.clear();
|
recipes.clear();
|
||||||
|
|
||||||
std::ifstream in("data/ingredients.txt");
|
std::ifstream in(file.c_str());
|
||||||
|
|
||||||
bool recipes = false;
|
bool recipes = false;
|
||||||
while (std::getline(in, line))
|
while (std::getline(in, line))
|
||||||
|
@ -3218,7 +3218,21 @@ void Continuity::reset()
|
||||||
|
|
||||||
foodSortType = 0;
|
foodSortType = 0;
|
||||||
|
|
||||||
loadIngredientData();
|
//load ingredients
|
||||||
|
|
||||||
|
ingredientDescriptions.clear();
|
||||||
|
ingredientData.clear();
|
||||||
|
recipes.clear();
|
||||||
|
|
||||||
|
if(dsq->mod.isActive())
|
||||||
|
{
|
||||||
|
//load mod ingredients
|
||||||
|
loadIngredientData(dsq->mod.getPath() + "data/ingredients.txt");
|
||||||
|
}
|
||||||
|
|
||||||
|
//load ingredients for the main game
|
||||||
|
if(ingredientData.empty() && recipes.empty())
|
||||||
|
loadIngredientData("data/ingredients.txt");
|
||||||
|
|
||||||
loadPetData();
|
loadPetData();
|
||||||
|
|
||||||
|
|
|
@ -1083,7 +1083,7 @@ public:
|
||||||
|
|
||||||
void applyIngredientEffects(IngredientData *data);
|
void applyIngredientEffects(IngredientData *data);
|
||||||
|
|
||||||
void loadIngredientData();
|
void loadIngredientData(const std::string &file);
|
||||||
bool hasIngredients() const { return !ingredients.empty(); }
|
bool hasIngredients() const { return !ingredients.empty(); }
|
||||||
IngredientDatas::size_type ingredientCount() const { return ingredients.size(); }
|
IngredientDatas::size_type ingredientCount() const { return ingredients.size(); }
|
||||||
IngredientType getIngredientTypeFromName(const std::string &name) const;
|
IngredientType getIngredientTypeFromName(const std::string &name) const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue