* (Windows) Added support for -game <dmod directory> parm to load a DMOD from anywhere on your HD. It also sets
the active DMOD dir to the DMODs parent directory for that session. Automatic state autosave, save/continue and quicksave/quickload work as expected by saving data to its directory * (bugfix) Save states now properly load even if the DMOD directory has been cut and pasted to a new place * (bugfix) Full state saves now properly setup backgrounds with correct vision modifications instead of assuming it was 0 - Due to minor changes in the save state stuff, I've versioned it so the game will refuse to load old versions (as always, this doesn't affect the normal save files, just the full state saves HD does) * (DinkC) fill_screen works better and colors 0 and 255 are no longer sometimes reversed * (bugfix) M can now be used to turn off the map, previously it only worked to turn it on * (bugfix) Status bar no longer incorrectly draws over full screen bitmaps (like the map in Mystery Island) and is properly reconstructed in full save states git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1484 353e56fe-9613-0410-8469-b96ad8e6f29c
This commit is contained in:
parent
ba5fb5abbf
commit
04f68e8125
11 changed files with 415 additions and 163 deletions
|
@ -224,7 +224,7 @@ if (IsDesktop())
|
|||
"\n`wAuto Save:`` Your game is automatically saved every five minutes to save slot 10 as long as you have more than 30% health.\n"\
|
||||
|
||||
"\n`wQuick save/load:`` In addition to the full auto state save whenever you exit the game, and the normal save system, you can use `wQuick Save/Load`` from the pause menu. It's very useful to beat a tough boss. Each add-on you install will also remember its own unique save states as well.\n"\
|
||||
"\n`wTo use an existing DMOD directory:`` Start the game with a command line parm of `w-dmodpath <dmod dir path>`` to use it instead of the default dmod directory.\n"\
|
||||
"\n`wTo use an existing DMOD directory:`` Start the game with a command line parm of `w-dmodpath <dmod dir path>`` to use it instead of the default dmod directory. `w-game <dmod path>`` is also supported to jump right into a dmod.\n"\
|
||||
"";
|
||||
|
||||
} else if (GetEmulatedPlatformID() == PLATFORM_ID_ANDROID)
|
||||
|
|
|
@ -101,6 +101,7 @@ void DMODMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sen
|
|||
PopUpCreate(pMenu, "This add-on appears to be missing or damaged. Delete and re-install.", "", "cancel", "Continue", "", "", true);
|
||||
return;
|
||||
}
|
||||
|
||||
InitDinkPaths(GetBaseAppPath(), "dink", dmoddir);
|
||||
|
||||
pMenu = GetEntityRoot()->GetEntityByName("DMODMenu");
|
||||
|
@ -254,7 +255,7 @@ void AddDMODBar(Entity *pParent, float &x, float &y, string title, string descri
|
|||
//processing the icon image might be slow, lets do it a bit later, sequencing the timing by using the y, which should be going up
|
||||
pBG->GetFunction("SetupExtra")->sig_function.connect(&DMODSetupExtra);
|
||||
VariantList vList(pBG);
|
||||
GetMessageManager()->CallEntityFunction(pBG, 800+count*200, "SetupExtra", &vList);
|
||||
GetMessageManager()->CallEntityFunction(pBG, 300+count*50, "SetupExtra", &vList);
|
||||
|
||||
//the delete icon part
|
||||
bool bCanDelete = true;
|
||||
|
@ -315,6 +316,7 @@ if (bCanDelete)
|
|||
//add animation effect
|
||||
ZoomToPositionFromThisOffsetEntity(pBG, CL_Vec2f(GetScreenSizeXf(), 0), 500, INTERPOLATE_EASE_TO, 10);
|
||||
}
|
||||
|
||||
void GetParsedDMODInfo(string dmodPath, string &nameOut, float versionOut, string ©right, string &dmodwebsite, string &description)
|
||||
{
|
||||
|
||||
|
|
|
@ -367,9 +367,6 @@ void OnGameProcessHWKey(VariantList *pVList)
|
|||
{
|
||||
if (pVList->Get(0).GetFloat() != MESSAGE_TYPE_GUI_CHAR) return;
|
||||
|
||||
if (DinkCanRunScriptNow())
|
||||
{
|
||||
|
||||
char c = toupper(char(pVList->Get(2).GetUINT32()));
|
||||
|
||||
if (c > 28 && c < 255)
|
||||
|
@ -386,10 +383,13 @@ void OnGameProcessHWKey(VariantList *pVList)
|
|||
break;
|
||||
|
||||
default:
|
||||
DinkLoadPlayerScript(string("key-"+toString(int(c))));
|
||||
if (DinkCanRunScriptNow())
|
||||
{
|
||||
DinkLoadPlayerScript(string("key-" + toString(int(c))));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//LogMsg("Got a %c (%d)", char(pVList->Get(2).GetUINT32()), pVList->Get(2).GetUINT32());
|
||||
}
|
||||
|
||||
|
@ -1324,6 +1324,7 @@ void GameLoadPiece(VariantList *pVList)
|
|||
if (!bSuccess)
|
||||
{
|
||||
RemoveFile(stateToLoad, false);
|
||||
WriteLastPathSaved("");
|
||||
Entity *pMenu = DinkQuitGame();
|
||||
PopUpCreate(pMenu, "Error loading save state. Probably an older version, sorry.", "", "cancel", "Continue", "", "", true);
|
||||
return;
|
||||
|
|
|
@ -19,6 +19,7 @@ bool g_bMainMenuFirstTime = true;
|
|||
bool g_bDidVersionCheck = false;
|
||||
|
||||
Entity * VersionShowScoreMessage(Entity *pMenu, string msg);
|
||||
void GetParsedDMODInfo(string dmodPath, string &nameOut, float versionOut, string ©right, string &dmodwebsite, string &description);
|
||||
|
||||
void ReloadMainMenu(VariantList *pVList)
|
||||
{
|
||||
|
@ -41,6 +42,7 @@ void OnVersionDownloadError(VariantList *pVList)
|
|||
|
||||
//kill current menu
|
||||
GetMessageManager()->CallEntityFunction(pMenu, 1000, "OnDelete", NULL);
|
||||
pMenu->SetName("MainMenuDelete");
|
||||
|
||||
//reload the main menu in a bit
|
||||
|
||||
|
@ -108,6 +110,7 @@ void OnVersionDownloadHTTPFinish(VariantList *pVList)
|
|||
|
||||
//kill current menu
|
||||
GetMessageManager()->CallEntityFunction(pMenu, 1000, "OnDelete", NULL);
|
||||
pMenu->SetName("MainMenuDelete");
|
||||
|
||||
//reload the main menu in a bit
|
||||
|
||||
|
@ -131,6 +134,7 @@ void MainMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sen
|
|||
//slide it off the screen and then kill the whole menu tree
|
||||
SlideScreen(pEntClicked->GetParent(), false);
|
||||
GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL);
|
||||
|
||||
GameCreate(pEntClicked->GetParent()->GetParent(), 0, "");
|
||||
GetApp()->GetVar("showViewHint")->Set(uint32(0)); //so this won't be shown here
|
||||
|
||||
|
@ -234,6 +238,7 @@ void MainOnStartLoading(VariantList *pVList)
|
|||
DisableAllButtonsEntity(pBG);
|
||||
SlideScreen(pBG, false);
|
||||
GetMessageManager()->CallEntityFunction(pBG, 500, "OnDelete", NULL);
|
||||
pBG->SetName("MainMenuDelete");
|
||||
|
||||
string fName = GetNextDMODToInstall();
|
||||
if (!fName.empty())
|
||||
|
@ -246,6 +251,82 @@ void MainOnStartLoading(VariantList *pVList)
|
|||
}
|
||||
|
||||
|
||||
void MainMenuDMODMenuOnSessionNew(VariantList *pVList)
|
||||
{
|
||||
Entity *pMenu = pVList->Get(0).GetEntity();
|
||||
|
||||
DisableAllButtonsEntity(pMenu);
|
||||
SlideScreen(pMenu, false);
|
||||
GetMessageManager()->CallEntityFunction(pMenu, 500, "OnDelete", NULL);
|
||||
pMenu->SetName("MainMenuDelete");
|
||||
|
||||
GameCreate(pMenu->GetParent(), 0, "");
|
||||
}
|
||||
|
||||
void MainMenuDMODMenuOnSessionContinue(VariantList *pVList)
|
||||
{
|
||||
Entity *pMenu = pVList->Get(0).GetEntity();
|
||||
|
||||
DisableAllButtonsEntity(pMenu);
|
||||
SlideScreen(pMenu, false);
|
||||
GetMessageManager()->CallEntityFunction(pMenu, 500, "OnDelete", NULL);
|
||||
pMenu->SetName("MainMenuDelete");
|
||||
|
||||
GameCreate(pMenu->GetParent(), 0, g_dglo.m_savePath + "continue_state.dat");
|
||||
}
|
||||
|
||||
void MainMenuDMODCancel(VariantList *pVList)
|
||||
{
|
||||
Entity *pMenu = pVList->Get(0).GetEntity();
|
||||
|
||||
DisableAllButtonsEntity(pMenu);
|
||||
SlideScreen(pMenu, false);
|
||||
GetMessageManager()->CallEntityFunction(pMenu, 500, "OnDelete", NULL);
|
||||
pMenu->SetName("MainMenuDelete");
|
||||
//reload the main menu
|
||||
MainMenuCreate(pMenu->GetParent());
|
||||
}
|
||||
|
||||
void MainOnStartLoadingDMOD(VariantList *pVList)
|
||||
{
|
||||
Entity *pBG = pVList->m_variant[0].GetEntity();
|
||||
|
||||
string fileName = pVList->m_variant[1].GetString();
|
||||
|
||||
|
||||
//first check to see if it's a valid dmod
|
||||
string dmoddir = pBG->GetVar("start_full_dmod_dir")->GetString();
|
||||
|
||||
if (!FileExists(dmoddir + "/dmod.diz"))
|
||||
{
|
||||
//don't look valid..
|
||||
PopUpCreate(pBG, "The DMOD at "+dmoddir+" appears to be missing or damaged. Ignoring it.", "", "CancelDMODLoad", "Continue", "", "", true);
|
||||
return;
|
||||
}
|
||||
|
||||
string dmodName, dmodCopyright, dmodwebsite, description;
|
||||
float version = 0;
|
||||
GetParsedDMODInfo(dmoddir, dmodName, version, dmodCopyright, dmodwebsite, description);
|
||||
|
||||
InitDinkPaths(GetBaseAppPath(), "dink", dmoddir);
|
||||
|
||||
//next, see if there is a save-on-quit save state existing for this dmod
|
||||
if (FileExists(g_dglo.m_savePath + "/continue_state.dat"))
|
||||
{
|
||||
PopUpCreate(pBG, "Continue your last session in "+ dmodName+"?", "", "CancelDMODLoad", "Cancel", "SessionContinue", "Continue", true, "SessionNew", "New Game");
|
||||
return;
|
||||
}
|
||||
|
||||
DisableAllButtonsEntity(pBG);
|
||||
SlideScreen(pBG, false);
|
||||
GetMessageManager()->CallEntityFunction(pBG, 500, "OnDelete", NULL);
|
||||
pBG->SetName("MainMenuDelete");
|
||||
|
||||
GameCreate(pBG->GetParent(), 0, "", "Loading "+dmodName);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void ImportSaveFileIfApplicable(string fName)
|
||||
{
|
||||
if (GetFileExtension(fName) != "dat") return;
|
||||
|
@ -305,6 +386,8 @@ void CheckForImportedSavedGames()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MainMenuContinueLast(VariantList *pVList)
|
||||
{
|
||||
Entity *pBG = pVList->Get(0).GetEntity();
|
||||
|
@ -321,12 +404,13 @@ void MainMenuContinueLastNewStyle(VariantList *pVList)
|
|||
{
|
||||
Entity *pBG = pVList->Get(0).GetEntity();
|
||||
|
||||
//ClearCommandLineParms();
|
||||
pBG->GetFunction("OnStartLoading")->sig_function.connect(&MainOnStartLoading);
|
||||
VariantList vList(pBG, ReadLastPathSaved()+string("continue_state.dat"));
|
||||
GetMessageManager()->CallEntityFunction(pBG, 1000, "OnStartLoading", &vList);
|
||||
g_bMainMenuFirstTime = false;
|
||||
WriteLastPathSaved("");
|
||||
LogMsg("Contining");
|
||||
//WriteLastPathSaved("");
|
||||
LogMsg("Continuing");
|
||||
}
|
||||
|
||||
void MainMenuCancelLast(VariantList *pVList)
|
||||
|
@ -338,6 +422,7 @@ void MainMenuCancelLast(VariantList *pVList)
|
|||
|
||||
//kill current menu
|
||||
GetMessageManager()->CallEntityFunction(pMenu, 0, "OnDelete", NULL);
|
||||
pMenu->SetName("MainMenuDelete");
|
||||
|
||||
//reload the main menu
|
||||
MainMenuCreate(pMenu->GetParent());
|
||||
|
@ -452,8 +537,7 @@ Entity * MainMenuCreate( Entity *pParentEnt, bool bFadeIn )
|
|||
vAboutButPt = CL_Vec2f(512, 454);
|
||||
vOptionsButPt = CL_Vec2f(716, 455);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef RT_IS_BETA
|
||||
Entity *pText = CreateTextLabelEntity(pBG, "text", GetScreenSizeXf()/2, GetScreenSizeYf()-20,
|
||||
|
@ -486,8 +570,36 @@ Entity * MainMenuCreate( Entity *pParentEnt, bool bFadeIn )
|
|||
SetTouchPaddingEntity(pButtonEntity, CL_Rectf(0, 0, 0, -10)); //no padding, it overlaps other buttons..
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect);
|
||||
FadeInEntity(pButtonEntity, false, 300, 1000);
|
||||
|
||||
|
||||
static bool bOneTimeDMODLoaded = false;
|
||||
|
||||
if (!bOneTimeDMODLoaded)
|
||||
{
|
||||
bOneTimeDMODLoaded = true;
|
||||
string dmodfilename;
|
||||
string dmodDir = GetDMODRootPath(&dmodfilename);
|
||||
|
||||
if (dmodfilename != "")
|
||||
{
|
||||
//jump start a DMOD load
|
||||
pBG->GetFunction("OnStartLoadingDMOD")->sig_function.connect(&MainOnStartLoadingDMOD);
|
||||
pBG->GetVar("start_full_dmod_dir")->Set(dmodDir + dmodfilename);
|
||||
pBG->GetVar("start_dmod_dir")->Set(dmodfilename);
|
||||
|
||||
VariantList vList(pBG, string(""));
|
||||
GetMessageManager()->CallEntityFunction(pBG, 1000, "OnStartLoadingDMOD", &vList);
|
||||
|
||||
pBG->GetFunction("SessionNew")->sig_function.connect(&MainMenuDMODMenuOnSessionNew);
|
||||
pBG->GetFunction("SessionContinue")->sig_function.connect(&MainMenuDMODMenuOnSessionContinue);
|
||||
pBG->GetFunction("CancelDMODLoad")->sig_function.connect(&MainMenuDMODCancel);
|
||||
|
||||
return pBG;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ( ! GetNextDMODToInstall().empty())
|
||||
{
|
||||
pBG->GetFunction("OnStartLoading")->sig_function.connect(&MainOnStartLoading);
|
||||
|
@ -501,13 +613,17 @@ Entity * MainMenuCreate( Entity *pParentEnt, bool bFadeIn )
|
|||
{
|
||||
PopUpCreate(pBG, "Continue your last session?", "", "CancelLast", "Cancel", "ContinueLast", "Continue", true);
|
||||
return pBG;
|
||||
} else if (!ReadLastPathSaved().empty())
|
||||
{
|
||||
PopUpCreate(pBG, "Continue your last session?", "", "CancelLast", "Cancel", "ContinueLastNewStyle", "Continue", true);
|
||||
return pBG;
|
||||
} else
|
||||
};
|
||||
|
||||
if (!ReadLastPathSaved().empty())
|
||||
{
|
||||
|
||||
string lastDMOD = ReadLastPathSaved();
|
||||
|
||||
PopUpCreate(pBG, "Continue your last session?", "", "CancelLast", "Cancel", "ContinueLastNewStyle", "Continue", true);
|
||||
return pBG;
|
||||
}
|
||||
|
||||
if (g_bMainMenuFirstTime)
|
||||
{
|
||||
#ifdef RT_MOGA_ENABLED
|
||||
|
@ -555,9 +671,8 @@ Entity * MainMenuCreate( Entity *pParentEnt, bool bFadeIn )
|
|||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect);
|
||||
SetTouchPaddingEntity(pButtonEntity, CL_Rectf(0,0,0,0));
|
||||
FadeInEntity(pButtonEntity, false, 500, 1500);
|
||||
|
||||
DestroyUnusedTextures();
|
||||
}
|
||||
|
||||
|
||||
//pButtonEntity = CreateTextButtonEntity(pBG, "Debug", x, y, "Debug and MP3 Music"); y += ySpacer;
|
||||
//pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue