1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-08-12 17:29:54 +00:00

Make script="x" setting in songs.xml accept other values than boolean.

The value 2 is now used to indicate that both script and internal handler
should be called.
This commit is contained in:
fgenesis 2013-04-22 02:42:53 +02:00
parent ad10db82ad
commit 65b1983c61
3 changed files with 7 additions and 15 deletions

View file

@ -1392,6 +1392,10 @@ void Continuity::castSong(int num)
effect->setPositionSnapTo(&dsq->game->avatar->position); effect->setPositionSnapTo(&dsq->game->avatar->position);
dsq->game->addRenderObject(effect, LR_PARTICLES); dsq->game->addRenderObject(effect, LR_PARTICLES);
// song->script == 0: internal handler only
// song->script == 1: script handler only
// song->script == 2: both
if (song->script) if (song->script)
{ {
if (dsq->mod.isActive()) if (dsq->mod.isActive())
@ -1399,7 +1403,8 @@ void Continuity::castSong(int num)
else else
dsq->runScriptNum("songs.lua", "castSong", num); dsq->runScriptNum("songs.lua", "castSong", num);
} }
else
if (song->script != 1)
{ {
switch((SongType)num) switch((SongType)num)
{ {

View file

@ -312,7 +312,7 @@ struct Song
Song() { index=0; script=0; } Song() { index=0; script=0; }
int index; int index;
SongNotes notes; SongNotes notes;
bool script; int script;
}; };
const int MAX_FLAGS = 1024; const int MAX_FLAGS = 1024;

View file

@ -6851,24 +6851,11 @@ void Game::bindInput()
#ifdef AQUARIA_BUILD_SCENEEDITOR #ifdef AQUARIA_BUILD_SCENEEDITOR
if (dsq->canOpenEditor()) if (dsq->canOpenEditor())
{ {
//addAction(MakeFunctionEvent(Game, toggleSceneEditor), KEY_TAB, 0);
addAction(ACTION_TOGGLESCENEEDITOR, KEY_TAB); addAction(ACTION_TOGGLESCENEEDITOR, KEY_TAB);
} }
#endif #endif
/*
if (dsq->user.demo.warpKeys)
{
addAction(MakeFunctionEvent(Game, warpKey1), KEY_1, 1);
addAction(MakeFunctionEvent(Game, warpKey2), KEY_2, 1);
addAction(MakeFunctionEvent(Game, warpKey3), KEY_3, 1);
addAction(MakeFunctionEvent(Game, warpKey4), KEY_4, 1);
}
*/
dsq->user.control.actionSet.importAction(this, "PrimaryAction", ACTION_PRIMARY); dsq->user.control.actionSet.importAction(this, "PrimaryAction", ACTION_PRIMARY);
dsq->user.control.actionSet.importAction(this, "Escape", ACTION_ESC); dsq->user.control.actionSet.importAction(this, "Escape", ACTION_ESC);