1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-07-03 22:44:32 +00:00

don't delete all tiles when closing map load name prompt without actually loading a map

This commit is contained in:
fgenesis 2024-01-11 22:57:25 +01:00
parent b63d27b7b5
commit 5dccefffc0
2 changed files with 17 additions and 10 deletions

View file

@ -1846,7 +1846,7 @@ void SceneEditor::rotateElement2()
placer->rotation.z += 360;
}
void SceneEditor::loadSceneByName()
bool SceneEditor::loadSceneByName()
{
std::string s = dsq->getUserInputString("Enter Name of Map to Load");
if (!s.empty())
@ -1854,7 +1854,9 @@ void SceneEditor::loadSceneByName()
game->noSceneTransitionFadeout = true;
game->fullTilesetReload = true;
game->transitionToScene(s);
return true;
}
return false;
}
void SceneEditor::reloadScene()
@ -1869,15 +1871,19 @@ void SceneEditor::reloadScene()
void SceneEditor::loadScene()
{
bool reload;
if (core->getShiftState())
{
loadSceneByName();
reload = loadSceneByName();
}
else
{
reloadScene();
reload = true;
}
if(reload)
{
// HACK: reload stuff when (re-) loading a map this way
particleManager->loadParticleBank(dsq->particleBank1, dsq->particleBank2);
Shot::loadShotBank(dsq->shotBank1, dsq->shotBank2);
@ -1886,6 +1892,7 @@ void SceneEditor::loadScene()
dsq->continuity.loadSongBank();
dsq->loadStringBank();
}
}
void SceneEditor::saveScene()
{

View file

@ -217,7 +217,7 @@ protected:
void addMainMenuItem(const std::string &label, int bid);
void loadSceneByName();
bool loadSceneByName();
void reloadScene();
void mouseButtonLeft();