DinkSmallwoodHD/source/GUI/ParticleTestMenu.cpp
seth d4f66a5d2e Initial commit of Dink Smallwood HD source. See the "Programmer readme.txt" for information on how to set it up.
git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1469 353e56fe-9613-0410-8469-b96ad8e6f29c
2017-09-12 04:57:47 +00:00

39 lines
1.3 KiB
C++

#include "ParticleTestMenu.h"
#include "Entity/EntityUtils.h"
#include "MainMenu.h"
#include "Component/ParticleTestComponent.h"
void ParticleTestOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sent from
{
Entity *pEntClicked = pVList->m_variant[1].GetEntity();
LogMsg("Clicked %s entity at %s", pEntClicked->GetName().c_str(),pVList->m_variant[1].Print().c_str());
if (pEntClicked->GetName() == "Back")
{
SlideScreen(pEntClicked->GetParent(), false);
GetMessageManager()->CallEntityFunction(pEntClicked->GetParent(), 500, "OnDelete", NULL);
MainMenuCreate(pEntClicked->GetParent()->GetParent());
}
GetEntityRoot()->PrintTreeAsText(); //useful for debugging
}
Entity * ParticleTestCreate(Entity *pParentEnt)
{
Entity *pBG = CreateOverlayEntity(pParentEnt, "ParticleTest", "interface/generic_bg.rttex", 0,0);
AddFocusIfNeeded(pBG);
Entity *pParticleEnt = pBG->AddEntity(new Entity(new ParticleTestComponent));
Entity *pButtonEntity;
pButtonEntity = CreateTextButtonEntity(pBG, "Back", 240, 290, "Back");
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&ParticleTestOnSelect);
pButtonEntity->GetVar("alignment")->Set(uint32(ALIGNMENT_CENTER));
SlideScreen(pBG, true);
return pBG;
}