1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-08-12 17:29:54 +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; int ac = 0;
bool clear = false; bool clear = false;
bool abort = false;
if (core->getKeyState(KEY_DELETE) || core->getKeyState(KEY_BACKSPACE)) if (core->getKeyState(KEY_DELETE) || core->getKeyState(KEY_BACKSPACE))
{ {
clear = true; clear = true;
} }
else if(core->getKeyState(KEY_ESCAPE)) else if(core->getKeyState(KEY_ESCAPE))
{ {
// do nothing abort = true;
while(core->getKeyState(KEY_ESCAPE))
dsq->run(0.1f);
} }
else else
{ {
@ -853,16 +856,19 @@ void AquariaKeyConfig::onUpdate(float dt)
clear = true; clear = true;
} }
if(ac || clear) if(abort || ac || clear)
{ {
toggleEnterKey(0); toggleEnterKey(0);
waitingForInput = 0; waitingForInput = 0;
AquariaGuiElement::canDirMoveGlobal = true; AquariaGuiElement::canDirMoveGlobal = true;
if(clear || *k == ac) // clear key if pressed again if(!abort)
*k = 0; {
else if(clear || *k == ac) // clear key if pressed again
*k = ac; *k = 0;
else
*k = ac;
}
} }
} }
break; break;

View file

@ -297,6 +297,12 @@ static void ensureDefaultActions(ActionSet& as)
as.addActionInput("Look"); as.addActionInput("Look");
as.addActionInput("ToggleHelp"); as.addActionInput("ToggleHelp");
as.addActionInput("Screenshot"); 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) static void readInt(XMLElement *xml, const char *elem, const char *att, int *toChange)