* Changed "FPS lock:" to "Lock to 30 FPS:" in options, makes it more clear it's actually bad to use and not vsync
* (Windows) Handles alt-tab and clicking on a different monitor while in native fullscreen modes better * Added "Ghost walk toggle" to in-game cheat menu. Allows you to walk through solid objects and screenlocks * (DinkC) Added support for Dan's load_tile() command * Some junk removed from the debug log git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1482 353e56fe-9613-0410-8469-b96ad8e6f29c
This commit is contained in:
parent
e0717ae8d1
commit
ba5fb5abbf
18 changed files with 665 additions and 603 deletions
|
@ -1,62 +1,62 @@
|
|||
#include "PlatformPrecomp.h"
|
||||
#include "LoadMenu.h"
|
||||
#include "Entity/EntityUtils.h"
|
||||
#include "MainMenu.h"
|
||||
#include "dink/dink.h"
|
||||
#include "GameMenu.h"
|
||||
|
||||
#define C_SAVE_GAME_COUNT 10
|
||||
|
||||
void LoadMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sent from
|
||||
{
|
||||
Entity *pEntClicked = pVList->m_variant[1].GetEntity();
|
||||
|
||||
LogMsg("Clicked %s entity", pEntClicked->GetName().c_str());
|
||||
|
||||
if (pEntClicked->GetName() == "Back")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
SlideScreen(pEntClicked->GetParent(), false);
|
||||
GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL);
|
||||
MainMenuCreate(pEntClicked->GetParent()->GetParent());
|
||||
//LoadMenuCreate(GetParent()
|
||||
}
|
||||
|
||||
int num = atol(pEntClicked->GetName().c_str());
|
||||
|
||||
if (num > 0)
|
||||
{
|
||||
//let's load this sucka
|
||||
#include "Entity/EntityUtils.h"
|
||||
#include "MainMenu.h"
|
||||
#include "dink/dink.h"
|
||||
#include "GameMenu.h"
|
||||
|
||||
#define C_SAVE_GAME_COUNT 10
|
||||
|
||||
void LoadMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sent from
|
||||
{
|
||||
Entity *pEntClicked = pVList->m_variant[1].GetEntity();
|
||||
|
||||
LogMsg("Clicked %s entity", pEntClicked->GetName().c_str());
|
||||
|
||||
if (pEntClicked->GetName() == "Back")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
SlideScreen(pEntClicked->GetParent(), false);
|
||||
GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL);
|
||||
MainMenuCreate(pEntClicked->GetParent()->GetParent());
|
||||
//LoadMenuCreate(GetParent()
|
||||
}
|
||||
|
||||
int num = atol(pEntClicked->GetName().c_str());
|
||||
|
||||
if (num > 0)
|
||||
{
|
||||
//let's load this sucka
|
||||
DisableAllButtonsEntity(pEntClicked->GetParent());
|
||||
SlideScreen(pEntClicked->GetParent(), false);
|
||||
GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL);
|
||||
|
||||
GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL);
|
||||
|
||||
if (num == 10)
|
||||
{
|
||||
string fName = GetSavePath()+"dink/"+"autosave.dat";
|
||||
GameCreate(pEntClicked->GetParent()->GetParent(), 0, fName);
|
||||
GameCreate(pEntClicked->GetParent()->GetParent(), 0, fName);
|
||||
|
||||
} else
|
||||
{
|
||||
GameCreate(pEntClicked->GetParent()->GetParent(), num, "");
|
||||
}
|
||||
|
||||
}
|
||||
GetEntityRoot()->PrintTreeAsText(); //useful for Loading
|
||||
}
|
||||
|
||||
void SetupLoadButton(Entity *pParent, int x, float *pY, int gameID)
|
||||
{
|
||||
gameID++; //it's 1 based, not 0 based
|
||||
|
||||
const float ySpacer = 46;
|
||||
if (gameID > 5) x += 200;
|
||||
|
||||
char stTemp[256];
|
||||
char stFormatted[256];
|
||||
string clickKey = ""; //none
|
||||
int gameTime;
|
||||
|
||||
} else
|
||||
{
|
||||
GameCreate(pEntClicked->GetParent()->GetParent(), num, "");
|
||||
}
|
||||
|
||||
}
|
||||
//GetEntityRoot()->PrintTreeAsText(); //useful for Loading
|
||||
}
|
||||
|
||||
void SetupLoadButton(Entity *pParent, int x, float *pY, int gameID)
|
||||
{
|
||||
gameID++; //it's 1 based, not 0 based
|
||||
|
||||
const float ySpacer = 46;
|
||||
if (gameID > 5) x += 200;
|
||||
|
||||
char stTemp[256];
|
||||
char stFormatted[256];
|
||||
string clickKey = ""; //none
|
||||
int gameTime;
|
||||
|
||||
if (gameID == 10)
|
||||
{
|
||||
string autoSave = DinkGetSavePath() + "autosave.dat";
|
||||
|
@ -82,27 +82,27 @@ void SetupLoadButton(Entity *pParent, int x, float *pY, int gameID)
|
|||
sprintf(stFormatted, "Auto Save - %d:%02d - %s", (gameTime / 60), gameTime - ((gameTime / 60) * 60), description.c_str());
|
||||
clickKey = toString(gameID);
|
||||
}
|
||||
} else
|
||||
|
||||
if (load_game_small(gameID, stTemp, &gameTime))
|
||||
{
|
||||
} else
|
||||
|
||||
if (load_game_small(gameID, stTemp, &gameTime))
|
||||
{
|
||||
sprintf(stFormatted, "Slot %d - %d:%02d - %s", gameID, (gameTime / 60), gameTime - ((gameTime / 60) * 60) , stTemp);
|
||||
clickKey = toString(gameID);
|
||||
} else
|
||||
{
|
||||
sprintf(stFormatted, "Slot %d - Empty", gameID);
|
||||
}
|
||||
|
||||
string butText = stFormatted;
|
||||
} else
|
||||
{
|
||||
sprintf(stFormatted, "Slot %d - Empty", gameID);
|
||||
}
|
||||
|
||||
string butText = stFormatted;
|
||||
Entity * pButtonEntity = CreateTextButtonEntity(pParent, clickKey, iPhoneMapX(x), iPhoneMapY(*pY), butText, false); *pY += ySpacer;
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&LoadMenuOnSelect);
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&LoadMenuOnSelect);
|
||||
//pButtonEntity->GetVar("alignment")->Set(uint32(ALIGNMENT_CENTER));
|
||||
}
|
||||
|
||||
Entity * LoadMenuCreate(Entity *pParentEnt)
|
||||
{
|
||||
Entity *pBG = CreateOverlayEntity(pParentEnt, "LoadMenu", ReplaceWithDeviceNameInFileName("interface/iphone/bkgd_stone.rttex"), 0,0);
|
||||
AddFocusIfNeeded(pBG, true);
|
||||
}
|
||||
|
||||
Entity * LoadMenuCreate(Entity *pParentEnt)
|
||||
{
|
||||
Entity *pBG = CreateOverlayEntity(pParentEnt, "LoadMenu", ReplaceWithDeviceNameInFileName("interface/iphone/bkgd_stone.rttex"), 0,0);
|
||||
AddFocusIfNeeded(pBG, true);
|
||||
|
||||
Entity *pButtonEntity;
|
||||
float x = 80;
|
||||
|
@ -116,12 +116,12 @@ Entity * LoadMenuCreate(Entity *pParentEnt)
|
|||
|
||||
SetupLoadButton(pBG, x, &y, i);
|
||||
}
|
||||
|
||||
|
||||
pButtonEntity = CreateTextButtonEntity(pBG, "Back", iPhoneMapX(x), iPhoneMapY(y), "Back"); y += ySpacer;
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&LoadMenuOnSelect);
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&LoadMenuOnSelect);
|
||||
//pButtonEntity->GetVar("alignment")->Set(uint32(ALIGNMENT_CENTER));
|
||||
|
||||
SlideScreen(pBG, true, 500);
|
||||
return pBG;
|
||||
}
|
||||
|
||||
return pBG;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue