Skip to content

Commit

Permalink
Merge pull request #1004 from myk002/battlecfg
Browse files Browse the repository at this point in the history
separate battle configs for each master
  • Loading branch information
Warboy1982 committed May 7, 2015
2 parents 74e8187 + 909f068 commit 2873de4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/Menu/NewBattleState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ void NewBattleState::init()
* Loads new battle data from a YAML file.
* @param filename YAML filename.
*/
void NewBattleState::load(const std::string &filename)
void NewBattleState::load()
{
std::string s = Options::getConfigFolder() + filename + ".cfg";
std::string s = Options::getConfigFolder() + "battle-" + Options::getActiveMaster() + ".cfg";
if (!CrossPlatform::fileExists(s))
{
initSave();
Expand Down Expand Up @@ -347,13 +347,13 @@ void NewBattleState::load(const std::string &filename)
* Saves new battle data to a YAML file.
* @param filename YAML filename.
*/
void NewBattleState::save(const std::string &filename)
void NewBattleState::save()
{
std::string s = Options::getConfigFolder() + filename + ".cfg";
std::string s = Options::getConfigFolder() + "battle-" + Options::getActiveMaster() + ".cfg";
std::ofstream sav(s.c_str());
if (!sav)
{
Log(LOG_WARNING) << "Failed to save " << filename << ".cfg";
Log(LOG_WARNING) << "Failed to save " << s;
return;
}
YAML::Emitter out;
Expand Down
4 changes: 2 additions & 2 deletions src/Menu/NewBattleState.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ class NewBattleState : public State
/// Resets state.
void init();
/// Loads New Battle settings.
void load(const std::string &filename = "battle");
void load();
/// Saves New Battle settings.
void save(const std::string &filename = "battle");
void save();
/// Initializes a blank savegame.
void initSave();
/// Handler for clicking the OK button.
Expand Down

0 comments on commit 2873de4

Please sign in to comment.