Implement menu navigation for the new overworld button in the Level Complete window. Release Build 7889.

mac-build
sigonasr2 9 months ago
parent 2bf1c74460
commit f7dad50ff5
  1. 55
      Adventures in Lestoria/LevelCompleteWindow.cpp
  2. 2
      Adventures in Lestoria/Version.h
  3. BIN
      x64/Release/Adventures in Lestoria.exe

@ -160,7 +160,10 @@ void Menu::InitializeLevelCompleteWindow(){
return "";
}}},
{game->KEY_SCROLL,{"View Items",[](MenuType type){}}},
{game->KEY_START,{"Continue",[](MenuType type){
{game->KEY_SELECT,{"Go to Overworld",[](MenuType type){
Component<MenuComponent>(type,"Overworld Button")->Click();
}}},
{game->KEY_START,{"Go to Camp",[](MenuType type){
Component<MenuComponent>(type,"Next Button")->Click();
}}},
}
@ -211,7 +214,7 @@ void Menu::InitializeLevelCompleteWindow(){
}
}
DefaultBehavior{ //When nothing is found...
returnData="Next Button";
returnData="Overworld Button";
}
},
.down=[](MenuType type,Data&returnData){
@ -263,7 +266,7 @@ void Menu::InitializeLevelCompleteWindow(){
}
}
DefaultBehavior{ //When nothing is found...
returnData="Next Button";
returnData="Overworld Button";
}
},
.left=[](MenuType type,Data&returnData){
@ -299,11 +302,11 @@ void Menu::InitializeLevelCompleteWindow(){
DetectInventory(InventoryScrollableWindowComponent,type,"Monster Loot Window")
{ //This means we have to wrap around. We have access to itemsList if we needed to point to a specific item in the inventory.
//By returning here, you are processing returnData yourself. Otherwise manipulate newRowIndex to point to an item in the itemsList when wrapping.
returnData="Next Button";
returnData="Overworld Button";
return;
}
DefaultBehavior{ //When nothing is found...
returnData="Next Button";
returnData="Overworld Button";
}
},
.right=[](MenuType type,Data&returnData){
@ -342,11 +345,11 @@ void Menu::InitializeLevelCompleteWindow(){
DetectInventory(InventoryScrollableWindowComponent,type,"Monster Loot Window")
{ //This means we have to wrap around. We have access to itemsList if we needed to point to a specific item in the inventory.
//By returning here, you are processing returnData yourself. Otherwise manipulate newRowIndex to point to an item in the itemsList when wrapping.
returnData="Next Button";
returnData="Overworld Button";
return;
}
DefaultBehavior{ //When nothing is found...
returnData="Next Button";
returnData="Overworld Button";
}
},}},
{"Stage Loot Window",{
@ -533,7 +536,7 @@ void Menu::InitializeLevelCompleteWindow(){
returnData="Next Button";
}
},}},
{"Next Button",{
{"Overworld Button",{
.up=[](MenuType type,Data&returnData){
auto monsterLoot=Component<InventoryScrollableWindowComponent>(type,"Monster Loot Window");
auto stageLoot=Component<InventoryScrollableWindowComponent>(type,"Stage Loot Window");
@ -548,6 +551,42 @@ void Menu::InitializeLevelCompleteWindow(){
returnData="Next Button";
}
},
.down=[](MenuType type,Data&returnData){
returnData="Next Button";
},
.left=[](MenuType type,Data&returnData){
auto monsterLoot=Component<InventoryScrollableWindowComponent>(type,"Monster Loot Window");
auto stageLoot=Component<InventoryScrollableWindowComponent>(type,"Stage Loot Window");
if(monsterLoot->GetComponents().size()>0){
int invWidth=monsterLoot->GetInventoryWidth();
returnData=monsterLoot->GetComponents()[std::clamp(invWidth-1,0,int(monsterLoot->GetComponents().size()-1))];
}else
if(stageLoot->GetComponents().size()>0){
int invWidth=stageLoot->GetInventoryWidth();
returnData=stageLoot->GetComponents()[std::clamp(invWidth-1,0,int(stageLoot->GetComponents().size()-1))];
}else{
returnData="Next Button";
}
},
.right=[](MenuType type,Data&returnData){
auto monsterLoot=Component<InventoryScrollableWindowComponent>(type,"Monster Loot Window");
auto stageLoot=Component<InventoryScrollableWindowComponent>(type,"Stage Loot Window");
if(monsterLoot->GetComponents().size()>0){
returnData=monsterLoot->GetComponents()[0];
}else
if(stageLoot->GetComponents().size()>0){
returnData=stageLoot->GetComponents()[0];
}else{
returnData="Next Button";
}
},}},
{"Next Button",{
.up=[](MenuType type,Data&returnData){
returnData="Overworld Button";
},
.down=[](MenuType type,Data&returnData){
returnData="Overworld Button";
},
.left=[](MenuType type,Data&returnData){
auto monsterLoot=Component<InventoryScrollableWindowComponent>(type,"Monster Loot Window");
auto stageLoot=Component<InventoryScrollableWindowComponent>(type,"Stage Loot Window");

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0
#define VERSION_MINOR 4
#define VERSION_PATCH 4
#define VERSION_BUILD 7887
#define VERSION_BUILD 7889
#define stringify(a) stringify_(a)
#define stringify_(a) #a

Loading…
Cancel
Save