Hover functionality moved out to MenuComponent so any component can utilize them.

This commit is contained in:
2023-12-16 21:28:41 -06:00
parent 025a89788e
commit ac0f5c42aa
11 changed files with 222 additions and 79 deletions
+3 -2
View File
@@ -113,8 +113,9 @@ protected:
if(downButton){downButton->Enable(!disabled);}
}
virtual inline void BeforeUpdate(Crawler*game)override{
MenuComponent::BeforeUpdate(game);
for(MenuComponent*component:components){
component->BeforeUpdate(game);
component->_BeforeUpdate(game);
}
}
virtual inline void Update(Crawler*game)override{
@@ -162,7 +163,7 @@ protected:
SetScrollAmount({GetScrollAmount().x,0});
}
std::sort(components.begin(),components.end(),[](MenuComponent*c1,MenuComponent*c2){return c1->depth>c2->depth;});
std::sort(components.begin(),components.end(),[](MenuComponent*c1,MenuComponent*c2){return c1->depth>c2->depth;});
for(MenuComponent*component:components){
component->disabled=!OnScreen(component);
component->_Update(game);