Add main menu window interface outlines. Fixed menu labels not being centered properly.

This commit is contained in:
2023-10-20 22:49:12 -05:00
parent e9952ca1be
commit b702fa2fe5
14 changed files with 92 additions and 62 deletions
+9 -2
View File
@@ -30,6 +30,9 @@ void Menu::InitializeMenus(){
InitializeTestMenu();
InitializeTestSubMenu();
InitializeInventoryWindow();
InitializeClassInfoWindow();
InitializeClassSelectionWindow();
InitializeMainMenuWindow();
for(MenuType type=TEST;type<MenuType::ENUM_END;type=MenuType(int(type+1))){
if(menus.count(type)==0){
@@ -236,13 +239,13 @@ void Menu::Draw(Crawler*game){
game->Clear(BLANK);
for(auto&component:displayComponents){
if(component->renderInMain){
component->_Draw(game,{0,0},this==Menu::stack.back());
component->_Draw(game,pos,this==Menu::stack.back());
}
}
for(auto&key:buttons){
for(auto&button:key.second){
if(button->renderInMain){
button->_Draw(game,{0,0},this==Menu::stack.back());
button->_Draw(game,pos,this==Menu::stack.back());
}
}
}
@@ -582,4 +585,8 @@ void Menu::AddInventoryListener(MenuComponent*component,ITCategory category){
std::cout<<"WARNING! Inventory category "<<category<<" does not exist!"<<std::endl;
throw;
}
}
vf2d Menu::center(){
return pos+size/2;
}