Setup framework for scrollbar and buttons in ScrollableWindowComponent. Fixed a bug where disabled buttons would not increment selection check loop. CreateMenu function instead of creating pointer and returning, so windows can add stuff to menus easily.

This commit is contained in:
2023-10-15 12:58:39 -05:00
parent b08002e61b
commit ff3f4ba1c0
13 changed files with 86 additions and 48 deletions
+2
View File
@@ -7,6 +7,8 @@ MenuComponent::MenuComponent(MenuType parent,geom2d::rect<float>rect,std::string
MenuComponent::MenuComponent(MenuType parent,geom2d::rect<float>rect,std::string label,MenuType menuDest,MenuFunc onClick,bool selectable)
:parentMenu(parent),rect(rect),label(label),menuDest(menuDest),onClick(onClick),hoverEffect(0),selectable(selectable){}
void MenuComponent::AfterCreate(){}
void MenuComponent::Update(Crawler*game){
if(hovered){
hoverEffect=std::min("ThemeGlobal.HighlightTime"_F,hoverEffect+game->GetElapsedTime());