* 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,108 +1,124 @@
|
|||
#include "PlatformPrecomp.h"
|
||||
#include "DebugMenu.h"
|
||||
#include "Entity/EntityUtils.h"
|
||||
#include "dink/dink.h"
|
||||
#include "LogMenu.h"
|
||||
|
||||
void DebugMenuOnSelect(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() == "FPS")
|
||||
{
|
||||
GetBaseApp()->SetFPSVisible(!GetBaseApp()->GetFPSVisible());
|
||||
}
|
||||
|
||||
|
||||
if (pEntClicked->GetName() == "music_on")
|
||||
{
|
||||
GetAudioManager()->Play("audio/intro.ogg", true, true);
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "music_off")
|
||||
{
|
||||
GetAudioManager()->StopMusic();
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "log")
|
||||
{
|
||||
RemoveFocusIfNeeded(pEntClicked->GetParent());
|
||||
SlideScreen(pEntClicked->GetParent(), false);
|
||||
LogMenuCreate(pEntClicked->GetParent()->GetParent());
|
||||
GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL);
|
||||
}
|
||||
|
||||
|
||||
if (pEntClicked->GetName() == "Back")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
RemoveFocusIfNeeded(pEntClicked->GetParent());
|
||||
SlideScreen(pEntClicked->GetParent(), false);
|
||||
AddFocusIfNeeded(pEntClicked->GetParent()->GetParent());
|
||||
GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL);
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "AddStrength")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
DinkModStrength(1);
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "AddDefense")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
DinkModDefense(1);
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "AddMagic")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
DinkModMagic(1);
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "AddLife")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
DinkModLifeMax(10);
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "FillLife")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
DinkFillLife();
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "AddGold")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
DinkModGold(100);
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "empty_cache")
|
||||
{
|
||||
DinkUnloadGraphicsCache();
|
||||
LogMsg("Cache emptied");
|
||||
}
|
||||
if (pEntClicked->GetName() == "AddBow")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
DinkAddBow();
|
||||
}
|
||||
|
||||
|
||||
GetEntityRoot()->PrintTreeAsText(); //useful for debugging
|
||||
}
|
||||
|
||||
|
||||
Entity * DebugMenuCreate(Entity *pParentEnt)
|
||||
{
|
||||
//Entity *pBG = CreateOverlayEntity(pParentEnt, "DebugMenu", "interface/generic_bg.rttex", 0,0);
|
||||
|
||||
Entity *pBG = CreateOverlayRectEntity(pParentEnt, CL_Vec2f(0,0), GetScreenSize(), MAKE_RGBA(0,0,0,140));
|
||||
|
||||
AddFocusIfNeeded(pBG);
|
||||
#include "Entity/EntityUtils.h"
|
||||
#include "dink/dink.h"
|
||||
#include "LogMenu.h"
|
||||
#include "GameMenu.h"
|
||||
|
||||
void DebugMenuOnSelect(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() == "FPS")
|
||||
{
|
||||
GetBaseApp()->SetFPSVisible(!GetBaseApp()->GetFPSVisible());
|
||||
}
|
||||
|
||||
|
||||
if (pEntClicked->GetName() == "music_on")
|
||||
{
|
||||
GetAudioManager()->Play("audio/intro.ogg", true, true);
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "music_off")
|
||||
{
|
||||
GetAudioManager()->StopMusic();
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "log")
|
||||
{
|
||||
RemoveFocusIfNeeded(pEntClicked->GetParent());
|
||||
SlideScreen(pEntClicked->GetParent(), false);
|
||||
LogMenuCreate(pEntClicked->GetParent()->GetParent());
|
||||
GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL);
|
||||
}
|
||||
|
||||
|
||||
if (pEntClicked->GetName() == "Back")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
RemoveFocusIfNeeded(pEntClicked->GetParent());
|
||||
SlideScreen(pEntClicked->GetParent(), false);
|
||||
AddFocusIfNeeded(pEntClicked->GetParent()->GetParent());
|
||||
GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL);
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "AddStrength")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
DinkModStrength(1);
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "AddDefense")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
DinkModDefense(1);
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "AddMagic")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
DinkModMagic(1);
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "AddLife")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
DinkModLifeMax(10);
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "FillLife")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
DinkFillLife();
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "AddGold")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
DinkModGold(100);
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "ghost_walk")
|
||||
{
|
||||
GetApp()->SetGhostMode(!GetApp()->GetGhostMode());
|
||||
if (GetApp()->GetGhostMode())
|
||||
{
|
||||
ShowQuickMessage("Ghost walk enabled - can walk through hardness and screenlocks");
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowQuickMessage("Ghost walk disabled");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "empty_cache")
|
||||
{
|
||||
DinkUnloadGraphicsCache();
|
||||
LogMsg("Cache emptied");
|
||||
}
|
||||
|
||||
if (pEntClicked->GetName() == "AddBow")
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
DinkAddBow();
|
||||
}
|
||||
|
||||
|
||||
//GetEntityRoot()->PrintTreeAsText(); //useful for debugging
|
||||
}
|
||||
|
||||
|
||||
Entity * DebugMenuCreate(Entity *pParentEnt)
|
||||
{
|
||||
//Entity *pBG = CreateOverlayEntity(pParentEnt, "DebugMenu", "interface/generic_bg.rttex", 0,0);
|
||||
|
||||
Entity *pBG = CreateOverlayRectEntity(pParentEnt, CL_Vec2f(0,0), GetScreenSize(), MAKE_RGBA(0,0,0,140));
|
||||
|
||||
AddFocusIfNeeded(pBG);
|
||||
|
||||
Entity *pButtonEntity;
|
||||
float x = iPhoneMapX(30);
|
||||
|
@ -110,54 +126,57 @@ Entity * DebugMenuCreate(Entity *pParentEnt)
|
|||
float ySpacer = iPhoneMapY(40);
|
||||
|
||||
pButtonEntity = CreateTextButtonEntity(pBG, "FPS", x, y, "Toggle FPS Display"); y += ySpacer;
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
//pButtonEntity->GetVar("alignment")->Set(uint32(ALIGNMENT_CENTER));
|
||||
|
||||
if (GetApp()->GetCheatsEnabled())
|
||||
{
|
||||
|
||||
if (GetApp()->GetCheatsEnabled())
|
||||
{
|
||||
pButtonEntity = CreateTextButtonEntity(pBG, "empty_cache", x, y, "Empty graphic cache"); y += ySpacer;
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
|
||||
}
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
|
||||
pButtonEntity = CreateTextButtonEntity(pBG, "ghost_walk", x, y, "Ghost walk toggle"); y += ySpacer;
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
|
||||
}
|
||||
pButtonEntity = CreateTextButtonEntity(pBG, "log", x, y, "View log"); y += ySpacer;
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
|
||||
pButtonEntity = CreateTextButtonEntity(pBG, "Back", x, y, "Back"); y += ySpacer;
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
//pButtonEntity->GetVar("alignment")->Set(uint32(ALIGNMENT_CENTER));
|
||||
AddHotKeyToButton(pButtonEntity, VIRTUAL_KEY_BACK);
|
||||
|
||||
|
||||
if (GetApp()->GetCheatsEnabled())
|
||||
if (GetApp()->GetCheatsEnabled())
|
||||
{
|
||||
//buttons on right
|
||||
x = iPhoneMapX(200);
|
||||
y = iPhoneMapY(30);
|
||||
|
||||
pButtonEntity = CreateTextButtonEntity(pBG, "AddStrength", x, y, "Increase Strength"); y += ySpacer;
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
|
||||
pButtonEntity = CreateTextButtonEntity(pBG, "AddDefense", x, y, "Increase Defense"); y += ySpacer;
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
|
||||
pButtonEntity = CreateTextButtonEntity(pBG, "AddMagic", x, y, "Increase Magic"); y += ySpacer;
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
|
||||
pButtonEntity = CreateTextButtonEntity(pBG, "AddLife", x, y, "Increase Life"); y += ySpacer;
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
|
||||
pButtonEntity = CreateTextButtonEntity(pBG, "FillLife", x, y, "Refill Life"); y += ySpacer;
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
|
||||
pButtonEntity = CreateTextButtonEntity(pBG, "AddGold", x, y, "Add 100 Gold"); y += ySpacer;
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
|
||||
pButtonEntity = CreateTextButtonEntity(pBG, "AddBow", x, y, "Add Bow"); y += ySpacer;
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
|
||||
}
|
||||
SlideScreen(pBG, true, 500);
|
||||
|
||||
|
||||
return pBG;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return pBG;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue