Refactor menucomponent internal draw function a little bit for code organizing.

This commit is contained in:
2023-11-06 00:05:09 -06:00
parent fe8cbb022a
commit c82a3c5980
5 changed files with 18 additions and 9 deletions
+4 -4
View File
@@ -276,13 +276,13 @@ void Menu::Draw(Crawler*game){
game->Clear(BLANK);
for(auto&component:displayComponents){
if(component->renderInMain){
component->_Draw(game,{0,0});
component->_Draw(game);
}
}
for(auto&key:buttons){
for(auto&button:key.second){
if(button->renderInMain){
button->_Draw(game,{0,0});
button->_Draw(game);
}
}
}
@@ -292,13 +292,13 @@ void Menu::Draw(Crawler*game){
game->DrawDecal(pos,r.Decal());
for(auto&component:displayComponents){
if(component->renderInMain){
component->_DrawDecal(game,{0,0},this==Menu::stack.back());
component->_DrawDecal(game,this==Menu::stack.back());
}
}
for(auto&key:buttons){
for(auto&button:key.second){
if(button->renderInMain){
button->_DrawDecal(game,{0,0},this==Menu::stack.back());
button->_DrawDecal(game,this==Menu::stack.back());
}
}
}