1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-08-10 08:09:53 +00:00

Fix possible fatal error, and jostick not accepting esc

This commit is contained in:
fgenesis 2016-07-17 03:05:26 +02:00
parent 4ee2abda06
commit 411f8950e5
2 changed files with 18 additions and 6 deletions

View file

@ -814,13 +814,16 @@ void AquariaKeyConfig::onUpdate(float dt)
{
int ac = 0;
bool clear = false;
bool abort = false;
if (core->getKeyState(KEY_DELETE) || core->getKeyState(KEY_BACKSPACE))
{
clear = true;
}
else if(core->getKeyState(KEY_ESCAPE))
{
// do nothing
abort = true;
while(core->getKeyState(KEY_ESCAPE))
dsq->run(0.1f);
}
else
{
@ -853,16 +856,19 @@ void AquariaKeyConfig::onUpdate(float dt)
clear = true;
}
if(ac || clear)
if(abort || ac || clear)
{
toggleEnterKey(0);
waitingForInput = 0;
AquariaGuiElement::canDirMoveGlobal = true;
if(clear || *k == ac) // clear key if pressed again
*k = 0;
else
*k = ac;
if(!abort)
{
if(clear || *k == ac) // clear key if pressed again
*k = 0;
else
*k = ac;
}
}
}
break;

View file

@ -297,6 +297,12 @@ static void ensureDefaultActions(ActionSet& as)
as.addActionInput("Look");
as.addActionInput("ToggleHelp");
as.addActionInput("Screenshot");
for(int i = 1; i <= 10; ++i)
{
std::ostringstream os;
os << "SongSlot" << i;
as.addActionInput(os.str());
}
}
static void readInt(XMLElement *xml, const char *elem, const char *att, int *toChange)