Back button in character stats window, moved elements slightly upwards for better positioning.

This commit is contained in:
2023-12-08 17:06:34 -06:00
parent ae2d1719c8
commit 13104bae66
6 changed files with 68 additions and 27 deletions
+27 -9
View File
@@ -84,14 +84,16 @@ void MenuComponent::_Update(Crawler*game){
}
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));
}
if(border){
game->DrawRect(rect.pos+parentPos,rect.size);
}
if(showDefaultLabel){
game->DrawStringProp(rect.pos+parentPos+rect.size/2-game->GetTextSizeProp(label)/2,label);
if(!decal){
if(background){
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);
}
if(showDefaultLabel){
game->DrawStringProp(rect.pos+parentPos+rect.size/2-game->GetTextSizeProp(label)/2,label);
}
}
}
@@ -107,7 +109,23 @@ void MenuComponent::_Draw(Crawler*game,vf2d parentPos){
}
}
void MenuComponent::DrawDecal(Crawler*game,vf2d parentPos,bool focused){}
void MenuComponent::DrawDecal(Crawler*game,vf2d parentPos,bool focused){
if(decal){
parentPos+=Menu::menus[parentMenu]->pos;
if(background){
game->FillRectDecal(rect.pos+parentPos,rect.size,PixelLerp(Menu::themes[Menu::themeSelection].GetButtonCol(),Menu::themes[Menu::themeSelection].GetHighlightCol(),hoverEffect/"ThemeGlobal.HighlightTime"_F));
}
if(border){
game->FillRectDecal(rect.pos+parentPos,{rect.size.x,1});
game->FillRectDecal(rect.pos+parentPos,{1,rect.size.y});
game->FillRectDecal(rect.pos+parentPos+vf2d{rect.size.x-1,0},{1,rect.size.y});
game->FillRectDecal(rect.pos+parentPos+vf2d{0,rect.size.y-1},{rect.size.x,1});
}
if(showDefaultLabel){
game->DrawStringPropDecal(rect.pos+parentPos+rect.size/2-game->GetTextSizeProp(label)/2,label);
}
}
}
void MenuComponent::_DrawDecal(Crawler*game,bool focused){
_DrawDecal(game,{0,0},focused);