* 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,98 +1,98 @@
|
|||
#include "PlatformPrecomp.h"
|
||||
#include "LogMenu.h"
|
||||
#include "Entity/EntityUtils.h"
|
||||
#include "dink/dink.h"
|
||||
#include "MainMenu.h"
|
||||
|
||||
void LogEnd(Entity *pMenu)
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
RemoveFocusIfNeeded(pMenu);
|
||||
//SlideScreen(pEntClicked->GetParent(), false);
|
||||
AddFocusIfNeeded(pMenu->GetParent());
|
||||
FadeOutEntity(pMenu, true, 499);
|
||||
GetMessageManager()->CallEntityFunction(pMenu, 500, "OnDelete", NULL);
|
||||
}
|
||||
|
||||
void LogMenuOnSelect(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());
|
||||
|
||||
Entity *pMenu = GetEntityRoot()->GetEntityByName("LogMenu");
|
||||
|
||||
if (pEntClicked->GetName() == "Back")
|
||||
{
|
||||
LogEnd(pMenu);
|
||||
}
|
||||
|
||||
GetEntityRoot()->PrintTreeAsText(); //useful for Log
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LogAddScrollContent(Entity *pParent)
|
||||
{
|
||||
pParent = pParent->GetEntityByName("scroll_child");
|
||||
float x = iPhoneMapX(5);
|
||||
float y = 0;
|
||||
|
||||
|
||||
CL_Vec2f vTextBoxPos(iPhoneMapX(20),y);
|
||||
CL_Vec2f vTextBounds(iPhoneMapX(434), iPhoneMapY(200));
|
||||
string msg = GetBaseApp()->GetConsole()->GetAsSingleString();
|
||||
|
||||
CreateTextBoxEntity(pParent, "", vTextBoxPos, vTextBounds, msg, 0.7f);
|
||||
VariantList vList(pParent->GetParent());
|
||||
ResizeScrollBounds(&vList);
|
||||
}
|
||||
|
||||
|
||||
Entity * LogMenuCreate(Entity *pParentEnt)
|
||||
{
|
||||
Entity *pBG = CreateOverlayRectEntity(pParentEnt, CL_Vec2f(0,0), GetScreenSize(), MAKE_RGBA(0,0,0,140));
|
||||
|
||||
pBG->SetName("LogMenu");
|
||||
AddFocusIfNeeded(pBG, true);
|
||||
|
||||
Entity *pButtonEntity;
|
||||
|
||||
//setup a scrolling window
|
||||
|
||||
CL_Vec2f vTextAreaPos = CL_Vec2f(0,0);
|
||||
float offsetFromBottom = iPhoneMapY(30);
|
||||
|
||||
CL_Vec2f vTextAreaBounds = GetScreenSize()-CL_Vec2f(15,offsetFromBottom);
|
||||
Entity *pScroll = pBG->AddEntity(new Entity("scroll"));
|
||||
pScroll->GetVar("size2d")->Set(vTextAreaBounds);
|
||||
pScroll->AddComponent(new TouchHandlerComponent);
|
||||
|
||||
EntityComponent *pFilter = pScroll->AddComponent(new FilterInputComponent);
|
||||
|
||||
EntityComponent *pScrollComp = pScroll->AddComponent(new ScrollComponent);
|
||||
EntityComponent *pScrollBarComp = pScroll->AddComponent(new ScrollBarRenderComponent); //also let's add a visual way to see the scroller position
|
||||
pScroll->GetVar("color")->Set(MAKE_RGBA(61,155, 193, 255));
|
||||
Entity *pScrollChild = pScroll->AddEntity(new Entity("scroll_child"));
|
||||
#include "PlatformPrecomp.h"
|
||||
#include "LogMenu.h"
|
||||
#include "Entity/EntityUtils.h"
|
||||
#include "dink/dink.h"
|
||||
#include "MainMenu.h"
|
||||
|
||||
void LogEnd(Entity *pMenu)
|
||||
{
|
||||
//slide it off the screen and then kill the whole menu tree
|
||||
RemoveFocusIfNeeded(pMenu);
|
||||
//SlideScreen(pEntClicked->GetParent(), false);
|
||||
AddFocusIfNeeded(pMenu->GetParent());
|
||||
FadeOutEntity(pMenu, true, 499);
|
||||
GetMessageManager()->CallEntityFunction(pMenu, 500, "OnDelete", NULL);
|
||||
}
|
||||
|
||||
void LogMenuOnSelect(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());
|
||||
|
||||
Entity *pMenu = GetEntityRoot()->GetEntityByName("LogMenu");
|
||||
|
||||
if (pEntClicked->GetName() == "Back")
|
||||
{
|
||||
LogEnd(pMenu);
|
||||
}
|
||||
|
||||
//GetEntityRoot()->PrintTreeAsText(); //useful for Log
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LogAddScrollContent(Entity *pParent)
|
||||
{
|
||||
pParent = pParent->GetEntityByName("scroll_child");
|
||||
float x = iPhoneMapX(5);
|
||||
float y = 0;
|
||||
|
||||
|
||||
CL_Vec2f vTextBoxPos(iPhoneMapX(20),y);
|
||||
CL_Vec2f vTextBounds(iPhoneMapX(434), iPhoneMapY(200));
|
||||
string msg = GetBaseApp()->GetConsole()->GetAsSingleString();
|
||||
|
||||
CreateTextBoxEntity(pParent, "", vTextBoxPos, vTextBounds, msg, 0.7f);
|
||||
VariantList vList(pParent->GetParent());
|
||||
ResizeScrollBounds(&vList);
|
||||
}
|
||||
|
||||
|
||||
Entity * LogMenuCreate(Entity *pParentEnt)
|
||||
{
|
||||
Entity *pBG = CreateOverlayRectEntity(pParentEnt, CL_Vec2f(0,0), GetScreenSize(), MAKE_RGBA(0,0,0,140));
|
||||
|
||||
pBG->SetName("LogMenu");
|
||||
AddFocusIfNeeded(pBG, true);
|
||||
|
||||
Entity *pButtonEntity;
|
||||
|
||||
//setup a scrolling window
|
||||
|
||||
CL_Vec2f vTextAreaPos = CL_Vec2f(0,0);
|
||||
float offsetFromBottom = iPhoneMapY(30);
|
||||
|
||||
CL_Vec2f vTextAreaBounds = GetScreenSize()-CL_Vec2f(15,offsetFromBottom);
|
||||
Entity *pScroll = pBG->AddEntity(new Entity("scroll"));
|
||||
pScroll->GetVar("size2d")->Set(vTextAreaBounds);
|
||||
pScroll->AddComponent(new TouchHandlerComponent);
|
||||
|
||||
EntityComponent *pFilter = pScroll->AddComponent(new FilterInputComponent);
|
||||
|
||||
EntityComponent *pScrollComp = pScroll->AddComponent(new ScrollComponent);
|
||||
EntityComponent *pScrollBarComp = pScroll->AddComponent(new ScrollBarRenderComponent); //also let's add a visual way to see the scroller position
|
||||
pScroll->GetVar("color")->Set(MAKE_RGBA(61,155, 193, 255));
|
||||
Entity *pScrollChild = pScroll->AddEntity(new Entity("scroll_child"));
|
||||
pScrollComp->GetVar("fingerTracking")->Set(uint32(1));
|
||||
|
||||
EntityComponent *pClip = pScroll->AddComponent(new RenderClipComponent);
|
||||
pClip->GetVar("clipMode")->Set(uint32(RenderClipComponent::CLIP_MODE_BOTTOM));
|
||||
|
||||
//Entity *pOverlay = CreateOverlayEntity(pBG, "", ReplaceWithDeviceNameInFileName("interface/iphone/bg_stone_overlay.rttex"), 0, GetScreenSizeYf());
|
||||
//SetAlignmentEntity(pOverlay, ALIGNMENT_DOWN_LEFT);
|
||||
|
||||
LogAddScrollContent(pBG);
|
||||
|
||||
VariantList vList(CL_Vec2f(0.0f, 1.0f));
|
||||
pScrollComp->GetFunction("SetProgress")->sig_function(&vList); //scroll to the end
|
||||
|
||||
pButtonEntity = CreateTextButtonEntity(pBG, "Back", iPhoneMapX(35), iPhoneMapY(300), "CONTINUE", false);
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&LogMenuOnSelect);
|
||||
pButtonEntity->GetVar("alignment")->Set(uint32(ALIGNMENT_CENTER));
|
||||
AddHotKeyToButton(pButtonEntity, VIRTUAL_KEY_BACK);
|
||||
|
||||
FadeInEntity(pBG, true);
|
||||
return pBG;
|
||||
}
|
||||
|
||||
|
||||
EntityComponent *pClip = pScroll->AddComponent(new RenderClipComponent);
|
||||
pClip->GetVar("clipMode")->Set(uint32(RenderClipComponent::CLIP_MODE_BOTTOM));
|
||||
|
||||
//Entity *pOverlay = CreateOverlayEntity(pBG, "", ReplaceWithDeviceNameInFileName("interface/iphone/bg_stone_overlay.rttex"), 0, GetScreenSizeYf());
|
||||
//SetAlignmentEntity(pOverlay, ALIGNMENT_DOWN_LEFT);
|
||||
|
||||
LogAddScrollContent(pBG);
|
||||
|
||||
VariantList vList(CL_Vec2f(0.0f, 1.0f));
|
||||
pScrollComp->GetFunction("SetProgress")->sig_function(&vList); //scroll to the end
|
||||
|
||||
pButtonEntity = CreateTextButtonEntity(pBG, "Back", iPhoneMapX(35), iPhoneMapY(300), "CONTINUE", false);
|
||||
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&LogMenuOnSelect);
|
||||
pButtonEntity->GetVar("alignment")->Set(uint32(ALIGNMENT_CENTER));
|
||||
AddHotKeyToButton(pButtonEntity, VIRTUAL_KEY_BACK);
|
||||
|
||||
FadeInEntity(pBG, true);
|
||||
return pBG;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue