mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
Abstract returning-to-editor code to Game::returntoeditor()
This way I can easily move it around without moving around a bunch of lines of code.
This commit is contained in:
parent
915100b370
commit
51971fa84c
3 changed files with 32 additions and 21 deletions
|
@ -7381,3 +7381,30 @@ void Game::returntolab()
|
|||
|
||||
music.play(11);
|
||||
}
|
||||
|
||||
#if !defined(NO_CUSTOM_LEVELS)
|
||||
void Game::returntoeditor()
|
||||
{
|
||||
game.gamestate = EDITORMODE;
|
||||
|
||||
graphics.textboxremove();
|
||||
game.hascontrol = true;
|
||||
game.advancetext = false;
|
||||
game.completestop = false;
|
||||
game.state = 0;
|
||||
graphics.showcutscenebars = false;
|
||||
graphics.fademode = 0;
|
||||
|
||||
graphics.backgrounddrawn=false;
|
||||
music.fadeout();
|
||||
//If warpdir() is used during playtesting, we need to set it back after!
|
||||
for (int j = 0; j < ed.maxheight; j++)
|
||||
{
|
||||
for (int i = 0; i < ed.maxwidth; i++)
|
||||
{
|
||||
ed.level[i+(j*ed.maxwidth)].warpdir=ed.kludgewarpdir[i+(j*ed.maxwidth)];
|
||||
}
|
||||
}
|
||||
map.scrolldir = 0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -385,6 +385,10 @@ public:
|
|||
int fadetomenudelay;
|
||||
bool fadetolab;
|
||||
int fadetolabdelay;
|
||||
|
||||
#if !defined(NO_CUSTOM_LEVELS)
|
||||
void returntoeditor();
|
||||
#endif
|
||||
};
|
||||
|
||||
extern Game game;
|
||||
|
|
|
@ -1537,27 +1537,7 @@ void gameinput()
|
|||
game.activeactivity = -1;
|
||||
}
|
||||
}else{
|
||||
game.gamestate = EDITORMODE;
|
||||
|
||||
graphics.textboxremove();
|
||||
game.hascontrol = true;
|
||||
game.advancetext = false;
|
||||
game.completestop = false;
|
||||
game.state = 0;
|
||||
graphics.showcutscenebars = false;
|
||||
graphics.fademode = 0;
|
||||
|
||||
graphics.backgrounddrawn=false;
|
||||
music.fadeout();
|
||||
//If warpdir() is used during playtesting, we need to set it back after!
|
||||
for (int j = 0; j < ed.maxheight; j++)
|
||||
{
|
||||
for (int i = 0; i < ed.maxwidth; i++)
|
||||
{
|
||||
ed.level[i+(j*ed.maxwidth)].warpdir=ed.kludgewarpdir[i+(j*ed.maxwidth)];
|
||||
}
|
||||
}
|
||||
map.scrolldir = 0;
|
||||
game.returntoeditor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue