void intro_tick() { if (blanktimer > 0) { ClearScreen(BLACK); if (--blanktimer == 0) game.setmode(GM_TITLE); return; } game_tick_normal(); player->y = 0; // when script ends with WAI9999, detect it and move on to title screen ScriptInstance *script = GetCurrentScriptInstance(); if ((script && script->delaytimer == 9999) || buttonjustpushed() || VJoy::ModeAware::wasTap()) { StopScripts(); blanktimer = EXIT_DELAY; } // lower time for startup if (script && script->delaytimer && script->ip == 5) { game.showmapnametime = 0; if (script->delaytimer > 20) script->delaytimer = 20; } }
void TB_SaveSelect::Run_Input() { int start; if (justpushed(DOWNKEY)) { start = fCurSel; for(;;) { fCurSel++; if (fCurSel >= fNumFiles) fCurSel = 0; if (fSaving) break; if (fHaveProfile[fCurSel]) break; if (fCurSel == start) break; } sound(SND_MENU_MOVE); fPicXOffset = -24; } if (justpushed(UPKEY)) { start = fCurSel; for(;;) { fCurSel--; if (fCurSel < 0) fCurSel = fNumFiles - 1; if (fSaving) break; if (fHaveProfile[fCurSel]) break; if (fCurSel == start) break; } sound(SND_MENU_MOVE); fPicXOffset = -24; } if (buttonjustpushed()) { // when shown in a replay, the box is shown and everything just like what was done // originally, but we won't actually overwrite any save files. if (!Replay::IsPlaying()) { if (fSaving) game_save(fCurSel); settings->last_save_slot = fCurSel; settings_save(); // record new save/load slot } SetVisible(false); // when the script hit the <SVP, it froze itself in an artifical <WAI9999 // waiting for us to complete. Now unfreeze it so can say "Game saved.", // or for loading, just end. ScriptInstance *s = GetCurrentScriptInstance(); if (s) s->delaytimer = 0; } }