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:
@@ -86,6 +86,12 @@ public:
|
||||
this->hideQty=!show;
|
||||
}
|
||||
protected:
|
||||
virtual inline void BeforeUpdate(Crawler*game)override{
|
||||
if(!hovered&&runHoverFunctions&&hoverState){
|
||||
hoverState=false;
|
||||
onMouseOut(MenuFuncData{*Menu::menus[parentMenu],game,this,(ScrollableWindowComponent*)(parentComponent)});
|
||||
}
|
||||
}
|
||||
virtual inline void Update(Crawler*game)override{
|
||||
MenuIconButton::Update(game);
|
||||
valid=!itemRef.get().IsBlank();
|
||||
@@ -110,10 +116,6 @@ protected:
|
||||
hoverState=true;
|
||||
onHover(MenuFuncData{*Menu::menus[parentMenu],game,this,(ScrollableWindowComponent*)(parentComponent)});
|
||||
}
|
||||
}else
|
||||
if(runHoverFunctions&&hoverState){
|
||||
hoverState=false;
|
||||
onMouseOut(MenuFuncData{*Menu::menus[parentMenu],game,this,(ScrollableWindowComponent*)(parentComponent)});
|
||||
}
|
||||
}
|
||||
virtual inline void Draw(Crawler*game,vf2d parentPos)override{
|
||||
|
||||
Reference in New Issue
Block a user