Begin work on Level Completion controller compatibility. Add in inventory scrollable window helper navigation macros to make coding wrapping functionality easier. Release Build 7010.
intnewRowIndex=selectedButton.lock()->inventoryIndex-invWidth;//Moving up moves the cursor up an entire row.
if(newRowIndex<0){
//This means we have to wrap around.
returnData="OK Button";
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));
//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;
}
}else{
#pragma region Inventory Wrapping Handling Up 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 up moves the cursor up an entire row.*/ \
if(newRowIndex<0){
#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)); \
/*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.
returnData="OK Button";
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));
//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;
}
}else{
#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));
returnData=*component;
}
}else{
#pragma region Inventory Wrapping Handling Left Macros
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;
}
}else{
#pragma region Inventory Wrapping Handling Right Macros
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){
//This means we have to wrap around.
returnData="OK Button";
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));
//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));