Add a BeforeUpdate event for components to handle mouse out events (specifically for equip item slots showing stat differences.) Corrects a bug with stat differences not refreshing on mouse out.

This commit is contained in:
2023-12-08 16:36:51 -06:00
parent 4ab88b3014
commit ae2d1719c8
7 changed files with 43 additions and 14 deletions
+8 -1
View File
@@ -177,7 +177,14 @@ void Menu::InitializeCharacterMenuWindow(){
Inventory::EquipItem(*equippedItem,slot);
}
return true;
},DO_NOTHING);
},[](MenuFuncData data){
for(int counter=0;ItemAttribute attribute:displayAttrs){
StatLabel*statDisplayLabel=Component<StatLabel>(CHARACTER_MENU,"Attribute "+ItemAttributable::GetDisplayInfo(attribute).name+" Label");
statDisplayLabel->SetStatChangeAmt(0);
counter++;
}
return true;
});
equip->I(Attribute::EQUIP_TYPE)=int(slot);
if(Inventory::GetEquip(slot)==&itemInvRef){
equip->SetSelected(true);