Hover functionality moved out to MenuComponent so any component can utilize them.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user