* Save data import/export added! Quick states automatically load the correct dmod if needed, but aren't able to auto-download them if they aren't installed. (it will give a clear message though) The filename of the uploaded quicksave doesn't matter.

* Saving and loading normal save file isn't as smooth, the dmod data simply isn't in the file, unlike quicksave data.  It just adds the exact file uploaded, so having the correct filename matters.  (it will strip out the " (1)" at the end though if needed, chrome adds that if a file already exists during a download)
* Added Dan's fixed fire graphic on the main menu (ipad size), fixes an animation problem I never noticed before!
* Fixed the click to open URL issues (they have to be done on a mouse down, not a mouse up, to get around browser security)
* Cleaned up the About screen a bit, made dink network URL first, removed the rtsoft forum URL.  Added "and includes additional contributions from Dan Walma." to the HD credits part
* Updated FMOD, was able to remove the PRECISE_F32=2 which should improve performance a bit
* FPS now locked at 60 fps
* Some fixes for playing on mobile, not done

git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1630 353e56fe-9613-0410-8469-b96ad8e6f29c
This commit is contained in:
seth 2018-06-14 12:16:49 +00:00
parent 7b8c9cb79a
commit c648a1d1fb
13 changed files with 280 additions and 83 deletions

View file

@ -192,7 +192,7 @@ void AboutMenuAddScrollContent(Entity *pParent)
string msg =
GetAppName()+string("`$ ")+GetApp()->GetVersionString()+" Build "+toString(GetApp()->GetBuild())+"``\nCopyright (c) 1997-2017 Robinson Technologies\n"\
GetAppName()+string("`$ ")+GetApp()->GetVersionString()+" Build "+toString(GetApp()->GetBuild())+"``\nCopyright (c) 1997-2018 Robinson Technologies\n"\
"\nDink Script Version: `$1.10``\n\n"\
;
@ -315,40 +315,39 @@ msg += \
//some special links:
Entity *pButton;
pButton = CreateTextButtonEntity(pParent, "email", iPhoneMapX(x), y, "Have a suggestion, bug report, or need help? Tap here to email us", true);
pButton->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&AboutMenuOnSelect);
y += pButton->GetVar("size2d")->GetVector2().y;
y += ySpacer;
if (GetApp()->CanDownloadDMODS())
{
pButton = CreateTextButtonEntity(pParent, "dinknetwork", iPhoneMapX(x), y, "Visit the Dink Network (Dink files, forums and more)", true);
pButton->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&AboutMenuOnSelect);
y += pButton->GetVar("size2d")->GetVector2().y;
y += ySpacer;
}
pButton = CreateTextButtonEntity(pParent, "list", iPhoneMapX(x), y, "Subscribe to the RTsoft Newsletter", true);
pButton->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&AboutMenuOnSelect);
y += pButton->GetVar("size2d")->GetVector2().y;
y += ySpacer;
//
// pButton = CreateTextButtonEntity(pParent, "email", iPhoneMapX(x), y, "Have a suggestion, bug report, or need help? Tap here to email us", true);
// pButton->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&AboutMenuOnSelect);
// y += pButton->GetVar("size2d")->GetVector2().y;
// y += ySpacer;
//
// pButton = CreateTextButtonEntity(pParent, "list", iPhoneMapX(x), y, "Subscribe to the RTsoft Newsletter", true);
// pButton->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&AboutMenuOnSelect);
// y += pButton->GetVar("size2d")->GetVector2().y;
// y += ySpacer;
pButton = CreateTextButtonEntity(pParent, "twitter", iPhoneMapX(x), y, "Click here for the RTsoft twitter page", true);
pButton->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&AboutMenuOnSelect);
y += pButton->GetVar("size2d")->GetVector2().y;
y += ySpacer;
pButton = CreateTextButtonEntity(pParent, "forums", iPhoneMapX(x), y, "Visit the official RTsoft Dink Forums", true);
pButton->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&AboutMenuOnSelect);
y += pButton->GetVar("size2d")->GetVector2().y;
y += ySpacer;
//
// pButton = CreateTextButtonEntity(pParent, "forums", iPhoneMapX(x), y, "Visit the official RTsoft forums", true);
// pButton->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&AboutMenuOnSelect);
// y += pButton->GetVar("size2d")->GetVector2().y;
// y += ySpacer;
if (GetApp()->CanDownloadDMODS())
{
pButton = CreateTextButtonEntity(pParent, "dinknetwork", iPhoneMapX(x), y, "Want to download/make DMODs? Tap here to visit the Dink Network", true);
pButton->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&AboutMenuOnSelect);
y += pButton->GetVar("size2d")->GetVector2().y;
y += ySpacer;
}
"\nFound a bug or have a question? Email us at `wsupport@rtsoft.com``.\n"\
"\nCheck out our other wacky games:\n";
vTextBoxPos = CL_Vec2f(iPhoneMapX(x),y);
msg = "\nIf you like Dink, please check out our other games:\n";
pEnt = CreateTextBoxEntity(pParent, "", vTextBoxPos, vTextBounds, msg);
@ -373,9 +372,9 @@ msg += \
{
string adText = "`wDink Smallwood HD for iOS```8 - Love Dink? Then get it on your iPhone and iPad!";
if (GetEmulatedPlatformID() == PLATFORM_ID_WINDOWS)
if (GetEmulatedPlatformID() == PLATFORM_ID_WINDOWS || GetEmulatedPlatformID() == PLATFORM_ID_HTML5)
{
adText = "`wDink Smallwood HD for mobile```8 - Love Dink? Then get it for your iPhone, iPad, or Android device!";
adText = "`wDink Smallwood HD for mobile```8 - Dink also has free native mobile versions available!";
}
AddBlurb(pParent, x, y, "dink_ad", adText);
y += iPhoneMapY(blurbSpacingY);
@ -393,9 +392,9 @@ msg += \
vTextBoxPos = CL_Vec2f(iPhoneMapX(x),y);
msg = "`8`$Dink Smallwood HD`` was created by `wSeth A. Robinson`` (code) and `wJustin Martin`` (graphics).\n\n"\
msg = "`8`$Dink Smallwood HD`` was created by `wSeth A. Robinson`` (code), `wJustin Martin`` (graphics) and includes additional contributions from Dan Walma.\n\n"\
"`8The original `$Dink Smallwood`` was created by `wSeth A. Robinson`` (engine/scripting/music), `wJustin Martin`` (graphics), `wGreg Smith`` (scripting/music), and `wShawn Teal``. It also featured music by `wJoel Bakker`` and `wMitch Brink``."\
"\n\nSpecial thanks to `wDan Walma`` and the `wdinksmallwood.net`` community for their `$Dink`` improvements."\
"\n\nSpecial thanks to `wDan Walma`` and the `wdinksmallwood.net`` community for their `$Dink`` creations and support over the years!"\
"\n\n"\
"This product is less buggy thanks to:\n\n`w"\
"Shawn Teal\n"\

View file

@ -69,12 +69,12 @@ Entity * EnterURLMenuCreate(Entity *pParentEnt)
pButtonEntity->GetVar("scale2d")->Set(CL_Vec2f(0.6f, 0.6f));
vTextAreaPos.y += iPhoneMapY(25);
string msg = "Enter a URL to a .dmod file to download and install. (example: http://rtsoft.com/NewQuest.dmod )";
string msg = "Enter a URL to a .dmod file to download and install. (example: https://rtsoft.com/NewQuest.dmod )";
switch (GetEmulatedPlatformID())
{
case PLATFORM_ID_WINDOWS:
msg = "Enter a URL to a .dmod file to download and install. (example: http://rtsoft.com/NewQuest.dmod ) Use Ctrl-V to paste from the clipboard.";
msg = "Enter a URL to a .dmod file to download and install. (example: https://rtsoft.com/NewQuest.dmod ) Use Ctrl-V to paste from the clipboard.";
break;
}

View file

@ -616,6 +616,15 @@ void BuildControls(float fadeTimeMS)
float trans = 0.0f;
Entity *pButtonEntity;
#ifdef PLATFORM_HTML5
if (GetTouchesReceived() > 0)
{
//using a touch screen, go into that mode
GetApp()->SetUsingTouchScreen(true);
}
#endif
if (GetApp()->GetUsingTouchScreen())
{
if (g_dglo.GetActiveView() != DinkGlobals::VIEW_ZOOMED && IsDrawingDinkStatusBar())

View file

@ -229,6 +229,37 @@ void PauseMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity se
}
if (pEntClicked->GetName() == "ExportNormalSave")
{
if (g_lastSaveSlotFileSaved.empty())
{
PopUpCreate(pMenu, "You haven't used a save machine recently. Go use one and come back!", "", "cancel", "Continue", "", "", true);
return;
}
string fileName = GetFileNameFromString(g_lastSaveSlotFileSaved);
#ifdef PLATFORM_HTML5
HTMLDownloadFileFromFileSystem(g_lastSaveSlotFileSaved, fileName);
#else
#endif
UpdatePauseButtons(pMenu);
PauseEnd(pMenu);
PopUpCreate(pMenu->GetParent(), "Started download of last save slot saved. (" + fileName + ")", "", "cancel", "Continue", "", "", true);
}
if (pEntClicked->GetName() == "ImportNormalSave")
{
#ifdef PLATFORM_HTML5
HTMLUploadFileToFileSystem();
#else
GetMessageManager()->SendGUIStringEx(MESSAGE_TYPE_HTML5_GOT_UPLOAD, 0, 0, 0, "purpoise_quicksave.dat", 0);
#endif
PauseEnd(pMenu);
}
if (pEntClicked->GetName() == "ExportQuickSave")
{
//SaveStateWithExtra(false);
@ -243,6 +274,10 @@ void PauseMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity se
#ifdef PLATFORM_HTML5
HTMLDownloadFileFromFileSystem(DinkGetSavePath() + "quicksave.dat", prepend + "_quicksave.dat");
#else
//Fake message for debugging
#endif
PauseEnd(pMenu);
ShowQuickMessage("Download started");
@ -255,6 +290,9 @@ void PauseMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity se
#ifdef PLATFORM_HTML5
HTMLUploadFileToFileSystem();
// HTMLDownloadFileFromFileSystem(DinkGetSavePath() + "quicksave.dat", g_dglo.m_dmodGameDir + "_quicksave.dat");
#else
GetMessageManager()->SendGUIStringEx(MESSAGE_TYPE_HTML5_GOT_UPLOAD, 0, 0, 0, "purpoise_quicksave.dat", 0);
#endif
PauseEnd(pMenu);
@ -420,9 +458,9 @@ Entity * PauseMenuCreate(Entity *pParentEnt)
pButton->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&PauseMenuOnSelect);
//next button
// pButton = CreateTextButtonEntity(pBG, "ExportNormalSave", vEntPos.x, (vEntPos.y + vEntSize.y / 2) + spacer+spacer, "(Export last save slot save)", true);
// SetAlignmentEntity(pButton, ALIGNMENT_DOWN_CENTER);
// pButton->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&PauseMenuOnSelect);
pButton = CreateTextButtonEntity(pBG, "ExportNormalSave", vEntPos.x, (vEntPos.y + vEntSize.y / 2) + spacer+spacer, "(Export save slot to file)", true);
SetAlignmentEntity(pButton, ALIGNMENT_DOWN_CENTER);
pButton->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&PauseMenuOnSelect);
}
@ -445,11 +483,13 @@ Entity * PauseMenuCreate(Entity *pParentEnt)
pButton->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&PauseMenuOnSelect);
SetButtonStyleEntity(pButton, Button2DComponent::BUTTON_STYLE_CLICK_ON_TOUCH); //to get around HTML5 rules on uploading, required because it's only
//allowed when initiated by a user click
//
// //next button
// pButton = CreateTextButtonEntity(pBG, "ImportNormalSave", vEntPos.x, (vEntPos.y + vEntSize.y / 2) + spacer + spacer, "(Import save slot file)", true);
// SetAlignmentEntity(pButton, ALIGNMENT_DOWN_CENTER);
// pButton->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&PauseMenuOnSelect);
//next button
pButton = CreateTextButtonEntity(pBG, "ImportNormalSave", vEntPos.x, (vEntPos.y + vEntSize.y / 2) + spacer + spacer, "(Import save slot file)", true);
SetAlignmentEntity(pButton, ALIGNMENT_DOWN_CENTER);
pButton->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&PauseMenuOnSelect);
SetButtonStyleEntity(pButton, Button2DComponent::BUTTON_STYLE_CLICK_ON_TOUCH); //to get around HTML5 rules on uploading, required because it's only
//allowed when initiated by a user click
}

View file

@ -7,4 +7,5 @@ Entity * PauseMenuCreate(Entity *pParentEnt);
Entity * DinkQuitGame(); //kills dink and loads the appropriate last menu and returns a pointer to it
void PlayMenuMusic();
Entity * DinkRestartGame();
Entity * DinkQuitGame();
#endif // PauseMenu_h__

View file

@ -213,6 +213,11 @@ void PopUpCreate(Entity *pEnt, string msg, string url, string button1Action, str
pLabel->GetVar("alignment")->Set(uint32(ALIGNMENT_CENTER));
pLabel->GetFunction("OnButtonSelected")->sig_function.connect(&PopUpMenuOnSelect);
pLabel->GetVar("url")->Set(url); //just in case we want to know this later, store it in the button itself
if (!url.empty())
{
SetButtonStyleEntity(pLabel, Button2DComponent::BUTTON_STYLE_CLICK_ON_TOUCH); //to get around HTML5 rules on uploading, required because it's only
}
FadeInEntity(pButton, true, 300, 250);
if (button2Label.empty())
{
@ -228,6 +233,11 @@ void PopUpCreate(Entity *pEnt, string msg, string url, string button1Action, str
pLabel->GetVar("alignment")->Set(uint32(ALIGNMENT_CENTER));
pLabel->GetFunction("OnButtonSelected")->sig_function.connect(&PopUpMenuOnSelect);
pLabel->GetVar("url")->Set(url); //just in case we want to know this later, store it in the button itself
if (!url.empty())
{
SetButtonStyleEntity(pLabel, Button2DComponent::BUTTON_STYLE_CLICK_ON_TOUCH); //to get around HTML5 rules on uploading, required because it's only
}
FadeInEntity(pButton, true, 300, 350);
if (button3Label.empty())
@ -246,6 +256,11 @@ void PopUpCreate(Entity *pEnt, string msg, string url, string button1Action, str
pLabel->GetVar("alignment")->Set(uint32(ALIGNMENT_CENTER));
pLabel->GetFunction("OnButtonSelected")->sig_function.connect(&PopUpMenuOnSelect);
pLabel->GetVar("url")->Set(url); //just in case we want to know this later, store it in the button itself
if (!url.empty())
{
SetButtonStyleEntity(pLabel, Button2DComponent::BUTTON_STYLE_CLICK_ON_TOUCH); //to get around HTML5 rules on uploading, required because it's only
}
FadeInEntity(pButton, true, 300, 450);
}
}