Added wrapping menu macro functionality. Implemented controller compatibility for level complete window. Added right alignment for menu labels. Added ProgressBar component. Added XP-related functions for callbacks to other components in-game. Fix giant normalized vector issue with Wolf AI script. Release Build 7041.
Component<MenuLabel>(CHARACTER_MENU,"Level Class Display")->SetLabel(std::format("Lv{} {}",game->GetPlayer()->Level(),game->GetPlayer()->GetClassName()));
characterMenuWindow->ADD("Level Class Display",MenuLabel)(geom2d::rect<float>{vf2d{126.f,windowSize.y-28},{118.f,8.f}},std::format("Lv{} {}",game->GetPlayer()->Level(),game->GetPlayer()->GetClassName()),1.f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END;
intnewRowIndex=selectedButton.lock()->inventoryIndex-invWidth;/*Moving up moves the cursor up an entire row.*/ \
intnewRowIndex=selectedButton.lock()->inventoryIndex-invWidth;/*Moving up moves the cursor up an entire row.*/ \
if(newRowIndex<0){
if(newRowIndex<0){
#define DefaultBehavior \
#define DefaultBehavior \
return; \
} \
} \
if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
/*Select the component that matches this new number.*/ \
/*Select the component that matches this new number.*/ \
intnewRowIndex=selectedButton.lock()->inventoryIndex-invWidth;/*Moving up moves the cursor up an entire row.*/ \
if(newRowIndex<0){
#define DefaultBehavior \
} \
if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
/*Select the component that matches this new number.*/ \
if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
intnewRowIndex=selectedButton.lock()->inventoryIndex+invWidth;/*Moving down moves the cursor down an entire row.*/ \
if(newRowIndex>=itemsList.size()){ \
intcurrentRow=newRowIndex/invWidth; \
/*The logic here is, if we clamp this row index to the last possible index and we're still on the same row, it means there is at least an item on this row. So we go to that instead.*/ \
if(currentRow!=newRow)//This means we are on a different row, so the row we went down on didn't have any items. Simply drop down to the OK Button.
#define DefaultBehavior \
} \
if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
/*Select the component that matches this new number.*/ \
if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
/*Select the component that matches this new number.*/ \
if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
/*Select the component that matches this new number.*/ \
if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
intnewRowIndex=selectedButton.lock()->inventoryIndex-invWidth;/*Moving up moves the cursor up an entire row.*/ \
if(newRowIndex<0){
if(newRowIndex<0){
//This means we have to wrap around.
#define DefaultBehavior \
returnData="OK Button";
} \
if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
/*Select the component that matches this new number.*/ \
if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex));
//Select the component that matches this new number.
if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex));
returnData=*component;
}
}
DefaultBehavior{//When nothing is found...
returnData="Next Button";
}
},
.down=[](MenuTypetype,Data&returnData){
#pragma region Inventory Wrapping Handling Down Macros
//Make sure before using this you have #define SUBCLASS with the children class for this inventory scrollable window component!
intnewRowIndex=selectedButton.lock()->inventoryIndex+invWidth;/*Moving down moves the cursor down an entire row.*/ \
if(newRowIndex>=itemsList.size()){ \
intcurrentRow=newRowIndex/invWidth; \
/*The logic here is, if we clamp this row index to the last possible index and we're still on the same row, it means there is at least an item on this row. So we go to that instead.*/ \
if(currentRow!=newRow)//This means we are on a different row, so the row we went down on didn't have any items. Simply drop down to the OK Button.
#define DefaultBehavior \
} \
if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
/*Select the component that matches this new number.*/ \
if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
/*Select the component that matches this new number.*/ \
if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
if(newRowIndex<0||newRowIndex>=itemsList.size())ERR(std::format("New Row Index ended up out-of-bounds! newRowIndex={}. THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
/*Select the component that matches this new number.*/ \
if(component==itemsList.end())ERR(std::format("WARNING! Could not find row index {} in items list while navigating! THIS SHOULD NOT BE HAPPENING!",newRowIndex)); \
Component<MenuLabel>(CHARACTER_MENU,"Level Class Display")->SetLabel(std::format("Lv{} {}",game->GetPlayer()->Level(),game->GetPlayer()->GetClassName()));