#include "Crawler.h" #include "MenuComponent.h" void Menu::InitializeTestMenu(){ Menu*testMenu=CreateMenu(TEST,CENTERED,{24*8,24*6}); MenuFunc quitWindow=[](MenuFuncData data){ data.menu.stack.clear(); }; testMenu->AddComponent("Close",NEW MenuComponent(TEST,{{24*1,24*1},{24*2,24*1}},"Close",quitWindow)); MenuFunc doNothing=[](MenuFuncData data){}; testMenu->AddComponent("Test",NEW MenuComponent(TEST,{{24*4,24*1},{24*3,24*1}},"Test",doNothing)); MenuFunc HurtPlayer=[](MenuFuncData data){ data.game->GetPlayer()->Hurt(20,data.game->GetPlayer()->OnUpperLevel(),data.game->GetPlayer()->GetZ()); }; testMenu->AddComponent("Hurt Player",NEW MenuComponent(TEST,{{24*4,24*3},{24*3,24*1}},"Hurt Player",HurtPlayer)); testMenu->AddComponent("Open SubMenu",NEW MenuComponent(TEST,{{24*2,24*4.5},{24*4,24*1}},"Open Another\n Menu",TEST_2,doNothing)); }