* Versioned to 1.91
* (html5) -s PRECISE_F32=2 was added to the compile, fixes "drunk midi". However, it hurts performance. This will be removed after FMOD fixes their stuff (see http://www.fmod.org/questions/question/midi-sounds-drunk-in-html5/ ) * (html5) Enabled Proton's persistent support for dink/dmod installs and saves git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1621 353e56fe-9613-0410-8469-b96ad8e6f29c
This commit is contained in:
parent
3957c689c2
commit
2367dc5e3e
14 changed files with 18113 additions and 18046 deletions
|
@ -497,6 +497,9 @@ void BrowseOnPostIntroTransition(VariantList *pVList)
|
|||
|
||||
Entity * BrowseMenuCreate( Entity *pParentEnt )
|
||||
{
|
||||
|
||||
SyncPersistentData();
|
||||
|
||||
//GetMessageManager()->SendGame(MESSAGE_TYPE_PLAY_MUSIC, "audio/title.mp3", 200);
|
||||
GetBaseApp()->ClearError();
|
||||
|
||||
|
|
|
@ -243,6 +243,8 @@ void OnDMODUnpackFinish(VariantList *pVList)
|
|||
pMenu->GetVar("dmoddir")->Set(GetDMODRootPath()+ pVList->m_variant[0].GetComponent()->GetVar("firstDirCreated")->GetString());
|
||||
|
||||
}
|
||||
|
||||
SyncPersistentData();
|
||||
}
|
||||
|
||||
void OnDMODInstallHTTPFinish(VariantList *pVList)
|
||||
|
@ -257,6 +259,7 @@ void OnDMODInstallHTTPFinish(VariantList *pVList)
|
|||
EntityComponent *pUnpack = pMenu->AddComponent(new UnpackArchiveComponent);
|
||||
pUnpack->GetVar("sourceFileName")->Set(pMenu->GetVar("tempFileName")->GetString());
|
||||
bool bDeleteOnFinish = pMenu->GetVar("deleteOnFinish")->GetUINT32();
|
||||
pUnpack->GetVar("limitToSingleSubdir")->Set(uint32(1));
|
||||
|
||||
pUnpack->GetVar("deleteSourceOnFinish")->Set(uint32(bDeleteOnFinish));
|
||||
|
||||
|
@ -390,6 +393,7 @@ Entity * DMODInstallMenuCreate(Entity *pParentEnt, string dmodURL, string instal
|
|||
//don't download, we already have the file
|
||||
pBG->GetVar("tempFileName")->Set(sourceFileName);
|
||||
pBG->GetVar("originalFileName")->Set(GetFileNameFromString(sourceFileName));
|
||||
pBG->GetVar("limitToSingleSubdir")->Set(uint32(1));
|
||||
|
||||
EntityComponent *pCrapComp = pBG->AddComponent(new EntityComponent("CRAP")); //I don't need this, but the function want a component and gets the parent for the menu, so fine
|
||||
pBG->GetVar("exitto")->Set("main");
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
#ifdef PLATFORM_HTML5
|
||||
#include "html5/SharedJSLIB.h";
|
||||
int GetTouchesReceived();
|
||||
#endif
|
||||
|
||||
bool g_bMainMenuFirstTime = true;
|
||||
|
@ -517,13 +516,10 @@ void CheckForNewVersion(Entity *pMenu)
|
|||
pComp->GetFunction("OnError")->sig_function.connect(&OnVersionDownloadError);
|
||||
pComp->GetFunction("OnFinish")->sig_function.connect(&OnVersionDownloadHTTPFinish);
|
||||
|
||||
|
||||
//pComp->GetFunction("Init")->sig_function(&v);
|
||||
GetMessageManager()->CallComponentFunction(pComp,100, "Init", &v); //call it in a bit
|
||||
|
||||
|
||||
|
||||
|
||||
Entity *pEnt = VersionShowScoreMessage(pMenu, "`wChecking for updates..");
|
||||
EntityComponent *pTyper = pEnt->AddComponent(new TyperComponent);
|
||||
pTyper->GetVar("text")->Set("...................");
|
||||
|
@ -532,6 +528,40 @@ void CheckForNewVersion(Entity *pMenu)
|
|||
|
||||
}
|
||||
|
||||
|
||||
void OnSyncUpdate(VariantList *pVList)
|
||||
{
|
||||
|
||||
if (IsStillLoadingPersistentData()) return;
|
||||
|
||||
if (g_bDidVersionCheck) return;
|
||||
|
||||
g_bDidVersionCheck = true;
|
||||
GetBaseApp()->GetEntityRoot()->PrintTreeAsText();
|
||||
//Entity *pMenu = pVList->m_variant[0].GetComponent()->GetParent();
|
||||
Entity *pMenu = GetBaseApp()->GetEntityRoot()->GetEntityByName("MainMenu");
|
||||
|
||||
|
||||
//kill current menu
|
||||
GetMessageManager()->CallEntityFunction(pMenu, 200, "OnDelete", NULL);
|
||||
pMenu->SetName("MainMenuDelete");
|
||||
|
||||
//reload the main menu in a bit
|
||||
|
||||
VariantList vList(pMenu->GetParent());
|
||||
GetMessageManager()->CallStaticFunction(ReloadMainMenu, 200, &vList, TIMER_SYSTEM);
|
||||
}
|
||||
|
||||
void WaitForSync(Entity *pMenu)
|
||||
{
|
||||
Entity *pEnt = VersionShowScoreMessage(pMenu, "`wFinding saved data...");
|
||||
EntityComponent *pTyper = pEnt->AddComponent(new TyperComponent);
|
||||
pTyper->GetVar("text")->Set("...................");
|
||||
pTyper->GetVar("speedMS")->Set(uint32(200));
|
||||
pEnt->GetFunction("OnUpdate")->sig_function.connect(&OnSyncUpdate);
|
||||
|
||||
}
|
||||
|
||||
Entity * MainMenuCreate( Entity *pParentEnt, bool bFadeIn )
|
||||
{
|
||||
CheckForImportedSavedGames();
|
||||
|
@ -609,6 +639,8 @@ Entity * MainMenuCreate( Entity *pParentEnt, bool bFadeIn )
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
if (!g_bDidVersionCheck && IsDesktop())
|
||||
{
|
||||
g_bDidVersionCheck = true;
|
||||
|
@ -617,6 +649,15 @@ Entity * MainMenuCreate( Entity *pParentEnt, bool bFadeIn )
|
|||
}
|
||||
|
||||
|
||||
#ifdef PLATFORM_HTML5
|
||||
if (!g_bDidVersionCheck && IsStillLoadingPersistentData() )
|
||||
{
|
||||
WaitForSync(pBG);
|
||||
return pBG;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Entity *pEntDinkLogo = CreateOverlayEntity(pBG, "dinklogo", ReplaceWithDeviceNameInFileName("interface/iphone/logo_dink.rttex"), 0, 0);
|
||||
|
||||
pButtonEntity = CreateOverlayEntity(pBG, "flameAnim", ReplaceWithDeviceNameInFileName("interface/iphone/bkgd_anim_fire.rttex"), 0, fireAnimY);
|
||||
|
|
|
@ -255,6 +255,7 @@ void OptionsMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity
|
|||
ZoomToPositionEntity(pMenu, CL_Vec2f(GetScreenSizeXf(),0), 500); //slide up
|
||||
KillEntity(pMenu, 500);
|
||||
AddFocusIfNeeded(pMenu->GetParent(), true, 500);
|
||||
SyncPersistentData();
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "sound_1")
|
||||
|
|
|
@ -51,6 +51,7 @@ Entity * DinkQuitGame()
|
|||
}
|
||||
|
||||
PlayMenuMusic();
|
||||
|
||||
return pFinalMenu;
|
||||
}
|
||||
|
||||
|
@ -101,6 +102,9 @@ void PauseEnd(Entity *pMenu)
|
|||
FadeOutEntity(pMenu, true, 499);
|
||||
GetMessageManager()->CallEntityFunction(pMenu, 500, "OnDelete", NULL);
|
||||
GetBaseApp()->SetGameTickPause(false);
|
||||
|
||||
SyncPersistentData();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -225,6 +229,8 @@ void PauseMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity se
|
|||
RemoveFile(fName, false);
|
||||
GetAudioManager()->Play("audio/buzzer2.wav");
|
||||
PopUpCreate(pMenu, "Error loading save state. Probably an older version, sorry.", "", "cancel", "Continue", "", "", true);
|
||||
SyncPersistentData();
|
||||
|
||||
} else
|
||||
{
|
||||
LoadStateWithExtra();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue