1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-15 14:09:06 +00:00

Little SceneEditor on-sreen text enhancement, regarding (auto-)save

This commit is contained in:
fgenesis 2012-09-02 02:29:12 +02:00
parent 3bdb0d6bc6
commit 5d41c93c5b
3 changed files with 25 additions and 12 deletions

View file

@ -4183,7 +4183,9 @@ bool Game::loadSceneXML(std::string scene)
{
//errorLog("Could not find [" + fn + "]");
//msg("Could not find map [" + fn + "]");
debugLog("Could not find map [" + fn + "]");
std::string s = "Could not find map [" + fn + "]";
debugLog(s);
dsq->screenMessage(s);
return false;
}
TiXmlDocument doc;
@ -5401,10 +5403,10 @@ bool Game::loadScene(std::string scene)
*/
}
void Game::saveScene(std::string scene)
bool Game::saveScene(std::string scene)
{
if (!this->saveFile)
return;
return false;
std::string fn = getSceneFilename(scene);
@ -5464,7 +5466,7 @@ void Game::saveScene(std::string scene)
saveFile->InsertEndChild(level);
*/
std::ostringstream obs, obsBinary;
std::ostringstream obs;
int i = 0;
for (i = 0; i < obsRows.size(); i++)
{
@ -5596,7 +5598,13 @@ void Game::saveScene(std::string scene)
}
*/
saveFile.SaveFile(fn);
bool result = saveFile.SaveFile(fn);
if (result)
debugLog("Successfully saved map: " + fn);
else
debugLog("Failed to save map: " + fn);
return result;
}
void Game::warpToArea(WarpArea *area)

View file

@ -693,7 +693,7 @@ public:
ElementTemplate *getElementTemplateByIdx(int idx);
void saveScene(std::string scene);
bool saveScene(std::string scene);
typedef std::vector<WarpArea> WarpAreas;
WarpAreas warpAreas;

View file

@ -2593,12 +2593,15 @@ void SceneEditor::loadScene()
particleManager->loadParticleBank(dsq->particleBank1, dsq->particleBank2);
Shot::loadShotBank(dsq->shotBank1, dsq->shotBank2);
dsq->game->loadEntityTypeList();
dsq->loadElementEffects();
}
void SceneEditor::saveScene()
{
if(dsq->game->saveScene(dsq->game->sceneName))
dsq->screenMessage(dsq->game->sceneName + " Saved!");
dsq->game->saveScene(dsq->game->sceneName);
else
dsq->screenMessage(dsq->game->sceneName + " FAILED to save!");
}
void SceneEditor::deleteSelectedElement()
@ -3482,10 +3485,12 @@ void SceneEditor::update(float dt)
autoSaveTimer = 0;
std::ostringstream os;
os << "auto/AUTO_" << autoSaveFile << "_" << dsq->game->sceneName;
if(dsq->game->saveScene(os.str()))
{
std::string m = "Map AutoSaved to " + os.str();
dsq->game->saveScene(os.str());
dsq->debugLog(m);
dsq->screenMessage(m);
}
autoSaveFile++;
if (autoSaveFile > vars->autoSaveFiles)