Compare commits
2 Commits
c52a274a7a
...
775ac4c40c
Author | SHA1 | Date |
---|---|---|
Misa | 775ac4c40c | |
Misa | 0eddd2d015 |
|
@ -117,6 +117,8 @@ void Game::init(void)
|
||||||
musicmutebutton = 0;
|
musicmutebutton = 0;
|
||||||
|
|
||||||
glitchrunkludge = false;
|
glitchrunkludge = false;
|
||||||
|
gamestate = TITLEMODE;
|
||||||
|
prevgamestate = TITLEMODE;
|
||||||
hascontrol = true;
|
hascontrol = true;
|
||||||
jumpheld = false;
|
jumpheld = false;
|
||||||
advancetext = false;
|
advancetext = false;
|
||||||
|
@ -7146,3 +7148,25 @@ void Game::unlockAchievement(const char *name) {
|
||||||
if (!map.custommode) NETWORK_unlockAchievement(name);
|
if (!map.custommode) NETWORK_unlockAchievement(name);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Game::mapmenuchange(const int newgamestate)
|
||||||
|
{
|
||||||
|
prevgamestate = gamestate;
|
||||||
|
gamestate = newgamestate;
|
||||||
|
graphics.resumegamemode = false;
|
||||||
|
mapheld = true;
|
||||||
|
|
||||||
|
if (prevgamestate == GAMEMODE)
|
||||||
|
{
|
||||||
|
graphics.menuoffset = 240;
|
||||||
|
if (map.extrarow)
|
||||||
|
{
|
||||||
|
graphics.menuoffset -= 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
graphics.menuoffset = 0;
|
||||||
|
}
|
||||||
|
graphics.oldmenuoffset = graphics.menuoffset;
|
||||||
|
}
|
||||||
|
|
|
@ -206,6 +206,7 @@ public:
|
||||||
bool glitchrunkludge;
|
bool glitchrunkludge;
|
||||||
|
|
||||||
int gamestate;
|
int gamestate;
|
||||||
|
int prevgamestate; //only used sometimes
|
||||||
bool hascontrol, jumpheld;
|
bool hascontrol, jumpheld;
|
||||||
int jumppressed;
|
int jumppressed;
|
||||||
int gravitycontrol;
|
int gravitycontrol;
|
||||||
|
@ -218,6 +219,7 @@ public:
|
||||||
int tapleft, tapright;
|
int tapleft, tapright;
|
||||||
|
|
||||||
//Menu interaction stuff
|
//Menu interaction stuff
|
||||||
|
void mapmenuchange(const int newgamestate);
|
||||||
bool mapheld;
|
bool mapheld;
|
||||||
int menupage;
|
int menupage;
|
||||||
int lastsaved;
|
int lastsaved;
|
||||||
|
|
|
@ -1769,7 +1769,16 @@ void gameinput()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!game.press_map) game.mapheld = false;
|
if (!game.press_map
|
||||||
|
//Extra conditionals as a kludge fix so if you open the quit menu during
|
||||||
|
//the script command gamemode(teleporter) and close it with Esc, it won't
|
||||||
|
//immediately open again
|
||||||
|
//We really need a better input system soon...
|
||||||
|
&& !key.isDown(27)
|
||||||
|
&& !key.isDown(game.controllerButton_esc))
|
||||||
|
{
|
||||||
|
game.mapheld = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (game.intimetrial && graphics.fademode == 1 && game.quickrestartkludge)
|
if (game.intimetrial && graphics.fademode == 1 && game.quickrestartkludge)
|
||||||
{
|
{
|
||||||
|
@ -1846,18 +1855,7 @@ void gameinput()
|
||||||
else if (game.companion == 0)
|
else if (game.companion == 0)
|
||||||
{
|
{
|
||||||
//Alright, normal teleporting
|
//Alright, normal teleporting
|
||||||
game.gamestate = TELEPORTERMODE;
|
game.mapmenuchange(TELEPORTERMODE);
|
||||||
graphics.menuoffset = 240; //actually this should count the roomname
|
|
||||||
graphics.oldmenuoffset = 240;
|
|
||||||
if (map.extrarow)
|
|
||||||
{
|
|
||||||
graphics.menuoffset -= 10;
|
|
||||||
graphics.oldmenuoffset -= 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
BlitSurfaceStandard(graphics.menubuffer,NULL,graphics.backBuffer, NULL);
|
|
||||||
|
|
||||||
graphics.resumegamemode = false;
|
|
||||||
|
|
||||||
game.useteleporter = true;
|
game.useteleporter = true;
|
||||||
game.initteleportermode();
|
game.initteleportermode();
|
||||||
|
@ -2010,19 +2008,10 @@ void gameinput()
|
||||||
//quitting the super gravitron
|
//quitting the super gravitron
|
||||||
game.mapheld = true;
|
game.mapheld = true;
|
||||||
//Quit menu, same conditions as in game menu
|
//Quit menu, same conditions as in game menu
|
||||||
game.gamestate = MAPMODE;
|
game.mapmenuchange(MAPMODE);
|
||||||
game.gamesaved = false;
|
game.gamesaved = false;
|
||||||
game.gamesavefailed = false;
|
game.gamesavefailed = false;
|
||||||
graphics.resumegamemode = false;
|
|
||||||
game.menupage = 20; // The Map Page
|
game.menupage = 20; // The Map Page
|
||||||
BlitSurfaceStandard(graphics.menubuffer,NULL,graphics.backBuffer, NULL);
|
|
||||||
graphics.menuoffset = 240; //actually this should count the roomname
|
|
||||||
graphics.oldmenuoffset = 240;
|
|
||||||
if (map.extrarow)
|
|
||||||
{
|
|
||||||
graphics.menuoffset -= 10;
|
|
||||||
graphics.oldmenuoffset -= 10;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (game.intimetrial && graphics.fademode == 0)
|
else if (game.intimetrial && graphics.fademode == 0)
|
||||||
{
|
{
|
||||||
|
@ -2039,12 +2028,11 @@ void gameinput()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Normal map screen, do transition later
|
//Normal map screen, do transition later
|
||||||
game.gamestate = MAPMODE;
|
game.mapmenuchange(MAPMODE);
|
||||||
map.cursordelay = 0;
|
map.cursordelay = 0;
|
||||||
map.cursorstate = 0;
|
map.cursorstate = 0;
|
||||||
game.gamesaved = false;
|
game.gamesaved = false;
|
||||||
game.gamesavefailed = false;
|
game.gamesavefailed = false;
|
||||||
graphics.resumegamemode = false;
|
|
||||||
if (script.running)
|
if (script.running)
|
||||||
{
|
{
|
||||||
game.menupage = 3; // Only allow saving
|
game.menupage = 3; // Only allow saving
|
||||||
|
@ -2053,34 +2041,18 @@ void gameinput()
|
||||||
{
|
{
|
||||||
game.menupage = 0; // The Map Page
|
game.menupage = 0; // The Map Page
|
||||||
}
|
}
|
||||||
BlitSurfaceStandard(graphics.menubuffer,NULL,graphics.backBuffer, NULL);
|
|
||||||
graphics.menuoffset = 240; //actually this should count the roomname
|
|
||||||
graphics.oldmenuoffset = 240;
|
|
||||||
if (map.extrarow)
|
|
||||||
{
|
|
||||||
graphics.menuoffset -= 10;
|
|
||||||
graphics.oldmenuoffset -= 10;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((key.isDown(27) || key.isDown(game.controllerButton_esc)) && (!map.custommode || map.custommodeforreal))
|
if (!game.mapheld
|
||||||
|
&& (key.isDown(27) || key.isDown(game.controllerButton_esc))
|
||||||
|
&& (!map.custommode || map.custommodeforreal))
|
||||||
{
|
{
|
||||||
game.mapheld = true;
|
game.mapheld = true;
|
||||||
//Quit menu, same conditions as in game menu
|
//Quit menu, same conditions as in game menu
|
||||||
game.gamestate = MAPMODE;
|
game.mapmenuchange(MAPMODE);
|
||||||
game.gamesaved = false;
|
game.gamesaved = false;
|
||||||
game.gamesavefailed = false;
|
game.gamesavefailed = false;
|
||||||
graphics.resumegamemode = false;
|
|
||||||
game.menupage = 30; // Pause screen
|
game.menupage = 30; // Pause screen
|
||||||
|
|
||||||
BlitSurfaceStandard(graphics.menubuffer,NULL,graphics.backBuffer, NULL);
|
|
||||||
graphics.menuoffset = 240; //actually this should count the roomname
|
|
||||||
graphics.oldmenuoffset = 240;
|
|
||||||
if (map.extrarow)
|
|
||||||
{
|
|
||||||
graphics.menuoffset -= 10;
|
|
||||||
graphics.oldmenuoffset -= 10;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game.deathseq == -1 && (key.isDown(SDLK_r) || key.isDown(game.controllerButton_restart)) && !game.nodeathmode)// && map.custommode) //Have fun glitchrunners!
|
if (game.deathseq == -1 && (key.isDown(SDLK_r) || key.isDown(game.controllerButton_restart)) && !game.nodeathmode)// && map.custommode) //Have fun glitchrunners!
|
||||||
|
|
|
@ -197,14 +197,27 @@ void maprenderfixed()
|
||||||
graphics.oldmenuoffset = graphics.menuoffset;
|
graphics.oldmenuoffset = graphics.menuoffset;
|
||||||
if (graphics.resumegamemode)
|
if (graphics.resumegamemode)
|
||||||
{
|
{
|
||||||
graphics.menuoffset += 25;
|
if (game.prevgamestate == GAMEMODE
|
||||||
int threshold = map.extrarow ? 230 : 240;
|
//Failsafe: if the script command gamemode(teleporter) got ran and the
|
||||||
if (graphics.menuoffset >= threshold)
|
//cutscene stopped without doing gamemode(game), then we need to go
|
||||||
|
//back to GAMEMODE, not game.prevgamestate (TELEPORTERMODE)
|
||||||
|
|| !script.running)
|
||||||
|
{
|
||||||
|
graphics.menuoffset += 25;
|
||||||
|
int threshold = map.extrarow ? 230 : 240;
|
||||||
|
if (graphics.menuoffset >= threshold)
|
||||||
|
{
|
||||||
|
graphics.menuoffset = threshold;
|
||||||
|
//go back to gamemode!
|
||||||
|
game.mapheld = true;
|
||||||
|
game.gamestate = GAMEMODE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
graphics.menuoffset = threshold;
|
|
||||||
//go back to gamemode!
|
|
||||||
game.mapheld = true;
|
game.mapheld = true;
|
||||||
game.gamestate = GAMEMODE;
|
game.gamestate = game.prevgamestate;
|
||||||
|
graphics.resumegamemode = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (graphics.menuoffset > 0)
|
else if (graphics.menuoffset > 0)
|
||||||
|
|
|
@ -1322,23 +1322,14 @@ void scriptclass::run()
|
||||||
{
|
{
|
||||||
if (words[1] == "teleporter")
|
if (words[1] == "teleporter")
|
||||||
{
|
{
|
||||||
//TODO this draw the teleporter screen. This is a problem. :(
|
game.mapmenuchange(TELEPORTERMODE);
|
||||||
game.gamestate = TELEPORTERMODE;
|
|
||||||
graphics.menuoffset = 240; //actually this should count the roomname
|
|
||||||
graphics.oldmenuoffset = 240;
|
|
||||||
if (map.extrarow)
|
|
||||||
{
|
|
||||||
graphics.menuoffset -= 10;
|
|
||||||
graphics.oldmenuoffset -= 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
graphics.resumegamemode = false;
|
|
||||||
|
|
||||||
game.useteleporter = false; //good heavens don't actually use it
|
game.useteleporter = false; //good heavens don't actually use it
|
||||||
}
|
}
|
||||||
else if (words[1] == "game")
|
else if (words[1] == "game")
|
||||||
{
|
{
|
||||||
graphics.resumegamemode = true;
|
graphics.resumegamemode = true;
|
||||||
|
game.prevgamestate = GAMEMODE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (words[0] == "ifexplored")
|
else if (words[0] == "ifexplored")
|
||||||
|
|
Loading…
Reference in New Issue