Toggle Interface implementation. Class toggling connections created and class switching via class selection menu completed.

This commit is contained in:
2023-10-24 04:52:24 -05:00
parent 598ce523e9
commit cedb465c79
18 changed files with 162 additions and 37 deletions
+11 -7
View File
@@ -43,21 +43,21 @@ void MenuComponent::_Update(Crawler*game){
}
}
void MenuComponent::Draw(Crawler*game,vf2d parentPos,bool focused){
void MenuComponent::Draw(Crawler*game,vf2d parentPos){
if(background){
game->FillRect(rect.pos+parentPos,rect.size,PixelLerp(Menu::themes[Menu::themeSelection].GetButtonCol(),Menu::themes[Menu::themeSelection].GetHighlightCol(),hoverEffect/"ThemeGlobal.HighlightTime"_F)*(focused?1:"ThemeGlobal.MenuUnfocusedColorMult"_F));
game->FillRect(rect.pos+parentPos,rect.size,PixelLerp(Menu::themes[Menu::themeSelection].GetButtonCol(),Menu::themes[Menu::themeSelection].GetHighlightCol(),hoverEffect/"ThemeGlobal.HighlightTime"_F));
}
if(border){
game->DrawRect(rect.pos+parentPos,rect.size,focused?GREY:GREY*"ThemeGlobal.MenuUnfocusedColorMult"_F);
game->DrawRect(rect.pos+parentPos,rect.size);
}
if(showDefaultLabel){
game->DrawStringProp(rect.pos+parentPos+rect.size/2-game->GetTextSizeProp(label)/2,label,focused?WHITE:WHITE*"ThemeGlobal.MenuUnfocusedColorMult"_F);
game->DrawStringProp(rect.pos+parentPos+rect.size/2-game->GetTextSizeProp(label)/2,label);
}
}
void MenuComponent::_Draw(Crawler*game,vf2d parentPos,bool focused){
void MenuComponent::_Draw(Crawler*game,vf2d parentPos){
if(!disabled){
Draw(game,parentPos,focused);
Draw(game,parentPos);
}
}
@@ -110,4 +110,8 @@ void MenuComponent::OnInventorySlotsUpdate(ITCategory cat){}
std::string MenuComponent::GetLabel(){
return label;
}
}
void MenuComponent::Enable(bool enabled){
disabled=!enabled;
};