|
|
|
@ -54,25 +54,67 @@ void Menu::InitializeItemLoadoutWindow(){ |
|
|
|
|
|
|
|
|
|
float buttonBorderPadding=64; |
|
|
|
|
|
|
|
|
|
itemLoadoutWindow->ADD("Loadout Item 1",MenuItemItemButton)(geom2d::rect<float>{{64,96},{48,48}},game->GetLoadoutItem(0),INVENTORY_CONSUMABLES,[](MenuFuncData data){Menu::menus.at(INVENTORY_CONSUMABLES)->I(A::LOADOUT_SLOT)=0; return true;},[](MenuFuncData data){return true;},[](MenuFuncData data){ |
|
|
|
|
itemLoadoutWindow->ADD("Loadout Item 1",MenuItemItemButton)(geom2d::rect<float>{{64,84},{48,48}},game->GetLoadoutItem(0),INVENTORY_CONSUMABLES,[](MenuFuncData data){Menu::menus.at(INVENTORY_CONSUMABLES)->I(A::LOADOUT_SLOT)=0; return true;},[](MenuFuncData data){return true;},[](MenuFuncData data){ |
|
|
|
|
Component<MenuLabel>(ITEM_LOADOUT,"Item Name Label")->SetLabel(""); |
|
|
|
|
Component<MenuLabel>(ITEM_LOADOUT,"Item Description")->SetLabel(""); |
|
|
|
|
return true; |
|
|
|
|
},"Item Name Label","Item Description")END; |
|
|
|
|
itemLoadoutWindow->ADD("Loadout Item 2",MenuItemItemButton)(geom2d::rect<float>{{itemLoadoutWindowWidth/2-24,96},{48,48}},game->GetLoadoutItem(1),INVENTORY_CONSUMABLES,[](MenuFuncData data){Menu::menus.at(INVENTORY_CONSUMABLES)->I(A::LOADOUT_SLOT)=1;return true;},[](MenuFuncData data){return true;},[](MenuFuncData data){ |
|
|
|
|
itemLoadoutWindow->ADD("Loadout Item 2",MenuItemItemButton)(geom2d::rect<float>{{itemLoadoutWindowWidth/2-24,84},{48,48}},game->GetLoadoutItem(1),INVENTORY_CONSUMABLES,[](MenuFuncData data){Menu::menus.at(INVENTORY_CONSUMABLES)->I(A::LOADOUT_SLOT)=1;return true;},[](MenuFuncData data){return true;},[](MenuFuncData data){ |
|
|
|
|
Component<MenuLabel>(ITEM_LOADOUT,"Item Name Label")->SetLabel(""); |
|
|
|
|
Component<MenuLabel>(ITEM_LOADOUT,"Item Description")->SetLabel(""); |
|
|
|
|
return true; |
|
|
|
|
},"Item Name Label","Item Description")END; |
|
|
|
|
itemLoadoutWindow->ADD("Loadout Item 3",MenuItemItemButton)(geom2d::rect<float>{{itemLoadoutWindowWidth-48-64,96},{48,48}},game->GetLoadoutItem(2),INVENTORY_CONSUMABLES,[](MenuFuncData data){Menu::menus.at(INVENTORY_CONSUMABLES)->I(A::LOADOUT_SLOT)=2;return true;},[](MenuFuncData data){return true;},[](MenuFuncData data){ |
|
|
|
|
itemLoadoutWindow->ADD("Loadout Item 3",MenuItemItemButton)(geom2d::rect<float>{{itemLoadoutWindowWidth-48-64,84},{48,48}},game->GetLoadoutItem(2),INVENTORY_CONSUMABLES,[](MenuFuncData data){Menu::menus.at(INVENTORY_CONSUMABLES)->I(A::LOADOUT_SLOT)=2;return true;},[](MenuFuncData data){return true;},[](MenuFuncData data){ |
|
|
|
|
Component<MenuLabel>(ITEM_LOADOUT,"Item Name Label")->SetLabel(""); |
|
|
|
|
Component<MenuLabel>(ITEM_LOADOUT,"Item Description")->SetLabel(""); |
|
|
|
|
return true; |
|
|
|
|
},"Item Name Label","Item Description")END; |
|
|
|
|
|
|
|
|
|
itemLoadoutWindow->ADD("Item Name Label",MenuLabel)(geom2d::rect<float>{{0,158},{itemLoadoutWindowWidth,12}},"",1,ComponentAttr::SHADOW)END; |
|
|
|
|
itemLoadoutWindow->ADD("Item Description",MenuLabel)(geom2d::rect<float>{{0,170},{itemLoadoutWindowWidth,24}},"",1,ComponentAttr::SHADOW)END; |
|
|
|
|
itemLoadoutWindow->ADD("Item Name Label",MenuLabel)(geom2d::rect<float>{{0,146},{itemLoadoutWindowWidth,12}},"",1,ComponentAttr::SHADOW)END; |
|
|
|
|
itemLoadoutWindow->ADD("Item Description",MenuLabel)(geom2d::rect<float>{{0,158},{itemLoadoutWindowWidth,24}},"",1,ComponentAttr::SHADOW)END; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
itemLoadoutWindow->ADD("Start Level Button",MenuComponent)(geom2d::rect<float>{{itemLoadoutWindowWidth/2-32,214},{64,16}},"Start",[](MenuFuncData data){State_OverworldMap::StartLevel();return true;})END; |
|
|
|
|
itemLoadoutWindow->ADD("Start Level Button",MenuComponent)(geom2d::rect<float>{{itemLoadoutWindowWidth/2+32,202},{64,16}},"Start",[](MenuFuncData data){State_OverworldMap::StartLevel();return true;})END; |
|
|
|
|
itemLoadoutWindow->ADD("Back Button",MenuComponent)(geom2d::rect<float>{{itemLoadoutWindowWidth/2-96,202},{64,16}},"Back",[](MenuFuncData data){Menu::CloseMenu();return true;})END; |
|
|
|
|
|
|
|
|
|
itemLoadoutWindow->SetupKeyboardNavigation( |
|
|
|
|
[](MenuType type,Data&returnData){ //On Open
|
|
|
|
|
returnData="Loadout Item 1"; |
|
|
|
|
}, |
|
|
|
|
{ //Button Key
|
|
|
|
|
{game->KEY_START,{"Start Stage",[](MenuType type){ |
|
|
|
|
Component<MenuComponent>(type,"Start Level Button")->Click(); |
|
|
|
|
}}}, |
|
|
|
|
{game->KEY_BACK,{"Back",[](MenuType type){ |
|
|
|
|
Component<MenuComponent>(type,"Back Button")->Click(); |
|
|
|
|
}}}, |
|
|
|
|
{game->KEY_CONFIRM,{"Select",[](MenuType type){}}}, |
|
|
|
|
} |
|
|
|
|
,{ //Button Navigation Rules
|
|
|
|
|
{"Loadout Item 1",{ |
|
|
|
|
.up="Back Button", |
|
|
|
|
.down="Back Button", |
|
|
|
|
.left="Loadout Item 3", |
|
|
|
|
.right="Loadout Item 2",}}, |
|
|
|
|
{"Loadout Item 2",{ |
|
|
|
|
.up="Start Level Button", |
|
|
|
|
.down="Start Level Button", |
|
|
|
|
.left="Loadout Item 1", |
|
|
|
|
.right="Loadout Item 3",}}, |
|
|
|
|
{"Loadout Item 3",{ |
|
|
|
|
.up="Start Level Button", |
|
|
|
|
.down="Start Level Button", |
|
|
|
|
.left="Loadout Item 2", |
|
|
|
|
.right="Loadout Item 1",}}, |
|
|
|
|
{"Start Level Button",{ |
|
|
|
|
.up="Loadout Item 3", |
|
|
|
|
.down="Loadout Item 3", |
|
|
|
|
.left="Back Button", |
|
|
|
|
.right="Back Button",}}, |
|
|
|
|
{"Back Button",{ |
|
|
|
|
.up="Loadout Item 1", |
|
|
|
|
.down="Loadout Item 1", |
|
|
|
|
.left="Start Level Button", |
|
|
|
|
.right="Start Level Button",}}, |
|
|
|
|
}); |
|
|
|
|
} |