mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-10-10 08:23:22 +00:00
Slightly more sensible error/msgbox handling
This commit is contained in:
parent
7faee73f14
commit
26d056d924
15 changed files with 48 additions and 83 deletions
|
@ -569,8 +569,7 @@ void AquariaKeyConfig::onUpdate(float dt)
|
|||
|
||||
if (!ai)
|
||||
{
|
||||
errorLog("Could not find actionInput: " + actionInputName);
|
||||
exit(-1);
|
||||
exit_error("Could not find actionInput: " + actionInputName);
|
||||
}
|
||||
switch(inputSetType)
|
||||
{
|
||||
|
@ -589,14 +588,6 @@ void AquariaKeyConfig::onUpdate(float dt)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if (k == 0)
|
||||
{
|
||||
errorLog("AquariaKeyConfig::onUpdate");
|
||||
exit(-1);
|
||||
}
|
||||
*/
|
||||
|
||||
int *value = 0;
|
||||
|
||||
if (inputSetType == INPUTSET_OTHER)
|
||||
|
|
|
@ -2659,7 +2659,7 @@ void Continuity::loadFile(int slot)
|
|||
if (startData->Attribute("mod"))
|
||||
{
|
||||
#ifdef AQUARIA_DEMO
|
||||
exit(-1);
|
||||
exit_error("The demo version does not support loading savegames from mods, sorry.");
|
||||
#else
|
||||
dsq->mod.load(startData->Attribute("mod"));
|
||||
#endif
|
||||
|
|
|
@ -922,12 +922,14 @@ This build is not yet final, and as such there are a couple things lacking. They
|
|||
// steam gets inited in here
|
||||
Core::init();
|
||||
|
||||
// steam callbacks are inited here
|
||||
dsq->continuity.init();
|
||||
dsq->continuity.stringBank.load();
|
||||
|
||||
vars = &v;
|
||||
v.load();
|
||||
|
||||
// steam callbacks are inited here
|
||||
dsq->continuity.init();
|
||||
|
||||
// do copy stuff
|
||||
#ifdef BBGE_BUILD_UNIX
|
||||
std::string fn;
|
||||
|
@ -997,8 +999,7 @@ This build is not yet final, and as such there are a couple things lacking. They
|
|||
{
|
||||
std::ostringstream os;
|
||||
os << "Aspect ratio for resolution [" << user.video.resx << ", " << user.video.resy << "] not supported.";
|
||||
errorLog(os.str());
|
||||
exit(0);
|
||||
exit_error(os.str());
|
||||
}
|
||||
|
||||
setFilter(dsq_filter);
|
||||
|
@ -1041,7 +1042,7 @@ This build is not yet final, and as such there are a couple things lacking. They
|
|||
if (!createWindow(user.video.resx, user.video.resy, user.video.bits, user.video.full, "Aquaria"))
|
||||
#endif
|
||||
{
|
||||
msg("Failed to create window");
|
||||
exit_error("Failed to create window");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -2432,8 +2432,7 @@ void Game::loadEntityTypeList()
|
|||
std::string line;
|
||||
if(!in)
|
||||
{
|
||||
core->messageBox(dsq->continuity.stringBank.get(2008), dsq->continuity.stringBank.get(2016));
|
||||
exit(1);
|
||||
exit_error(dsq->continuity.stringBank.get(2008).c_str());
|
||||
}
|
||||
while (std::getline(in, line))
|
||||
{
|
||||
|
@ -5213,7 +5212,7 @@ bool Game::loadScene(std::string scene)
|
|||
}
|
||||
if (i == allowedMaps.size())
|
||||
{
|
||||
exit(-1);
|
||||
exit_error("Demo version refuses to load this map, sorry.");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -27,8 +27,7 @@ void GameplayVariables::load()
|
|||
InStream inFile("data/variables.txt");
|
||||
if(!inFile)
|
||||
{
|
||||
core->messageBox(dsq->continuity.stringBank.get(2008), dsq->continuity.stringBank.get(2017));
|
||||
exit(1);
|
||||
exit_error(dsq->continuity.stringBank.get(2017));
|
||||
}
|
||||
std::string s;
|
||||
inFile >> s >> maxSlowSwimSpeed;
|
||||
|
|
|
@ -713,8 +713,8 @@ luaFunc(indexWarnInstance)
|
|||
|
||||
luaFunc(panicHandler)
|
||||
{
|
||||
errorLog(luaFormatStackInfo(L) + ": Lua PANIC: " + getString(L, -1));
|
||||
exit(1);
|
||||
std::string err = luaFormatStackInfo(L) + ": Lua PANIC: " + getString(L, -1);
|
||||
exit_error(err);
|
||||
}
|
||||
|
||||
static bool findFile_helper(const char *rawname, std::string &fname)
|
||||
|
|
|
@ -41,6 +41,9 @@ void StringBank::load()
|
|||
fname = localisePath(dsq->mod.getPath() + "stringbank.txt", dsq->mod.getPath());
|
||||
_load(fname);
|
||||
}
|
||||
|
||||
if(stringMap.empty())
|
||||
exit_error("Failed to load data/stringbank.txt");
|
||||
}
|
||||
|
||||
void StringBank::_load(const std::string &file)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue