Added XP bar animations and steady increasing progress bar. Added level up animation text on stage completion screen. Refactor enable and disable functions for menu components. Differentiated between disabling due to being outside the window, and manual enable/disabling of components. Fix infinite loop bug with components outside of a scrollable window component not being iterated over. Fix bug with hovering over non-navigational components causing the default component for a menu to be selected while in mouse navigation mode. Release Build 7095.

This commit is contained in:
2024-02-11 18:31:30 -06:00
parent 22b1557c05
commit 8afd66632a
29 changed files with 244 additions and 104 deletions
+31 -5
View File
@@ -80,7 +80,7 @@ void MenuComponent::Update(AiL*game){
}
void MenuComponent::_Update(AiL*game){
if(!disabled){
if(!disable&&!disableOutsideWindow){
_OnHover();
Update(game);
}
@@ -130,7 +130,7 @@ void MenuComponent::DrawDecal(ViewPort&window,bool focused){
}
void MenuComponent::_DrawDecal(ViewPort&window,bool focused){
if(!disabled){
if(!disable&&!disableOutsideWindow){
DrawDecal(window,focused);
}
}
@@ -188,8 +188,20 @@ const std::string&MenuComponent::GetLabel()const{
return label;
}
void MenuComponent::Enable(bool enabled){
disabled=!enabled;
void MenuComponent::Enable(){
disable=false;
};
void MenuComponent::Disable(){
disable=true;
};
void MenuComponent::EnableOutsideWindow(){
disableOutsideWindow=false;
};
void MenuComponent::DisableOutsideWindow(){
disableOutsideWindow=true;
};
void MenuComponent::Cleanup(){}
@@ -248,7 +260,7 @@ void MenuComponent::OnPlayerMoneyUpdate(uint32_t newMoney){}
void MenuComponent::OnChapterUpdate(uint8_t newChapter){}
void MenuComponent::Click(){
if(grayedOut||disabled)return;
if(grayedOut||disable||disableOutsideWindow)return;
bool buttonStillValid=onClick(MenuFuncData{*Menu::menus[parentMenu],game,Menu::menus[parentMenu]->components[name]});
if(buttonStillValid){
if(menuDest!=MenuType::ENUM_END){
@@ -263,4 +275,18 @@ void MenuComponent::Click(){
}
void MenuComponent::SetLabel(std::string newLabel){
label=newLabel;
}
const bool MenuComponent::IsEnabled()const{
return !IsDisabled();
}
const bool MenuComponent::IsDisabled()const{
return disable;
}
const bool MenuComponent::IsEnabledOutsideWindow()const{
return !IsDisabledOutsideWindow();
}
const bool MenuComponent::IsDisabledOutsideWindow()const{
return disableOutsideWindow;
}