Correct memory leak in consuming items from inventory. Added overworld menu layout. Warrior Up walk animation has head bobbing like all the others now. Fixed alignment of items for ScrollableWindowComponents, fix scrollbar resizing when parent component has offsets.
This commit is contained in:
+12
-7
@@ -28,6 +28,7 @@ std::vector<MenuComponent*>Menu::unhandledComponents;
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
MenuType Menu::lastMenuTypeCreated;
|
||||
std::string Menu::lastRegisteredComponent;
|
||||
bool Menu::cover;
|
||||
|
||||
INCLUDE_GFX
|
||||
extern vi2d WINDOW_SIZE;
|
||||
@@ -54,6 +55,7 @@ void Menu::InitializeMenus(){
|
||||
InitializeClassSelectionWindow();
|
||||
InitializeClassInfoWindow();
|
||||
InitializeMainMenuWindow();
|
||||
InitializeOverworldMapLevelWindow();
|
||||
|
||||
for(MenuType type=TEST;type<MenuType::ENUM_END;type=MenuType(int(type+1))){
|
||||
if(menus.count(type)==0){
|
||||
@@ -154,12 +156,14 @@ void Menu::HoverMenuSelect(Crawler*game){
|
||||
|
||||
void Menu::MenuSelect(Crawler*game){
|
||||
if(selection==vi2d{-1,-1}||buttons[selection.y][selection.x]->disabled)return;
|
||||
buttons[selection.y][selection.x]->onClick(MenuFuncData{*this,game,buttons[selection.y][selection.x]});
|
||||
if(buttons[selection.y][selection.x]->menuDest!=MenuType::ENUM_END){
|
||||
if(stack.size()<32){
|
||||
stack.push_back(menus[buttons[selection.y][selection.x]->menuDest]);//Navigate to the next menu.
|
||||
}else{
|
||||
ERR("WARNING! Exceeded menu stack size limit!")
|
||||
bool buttonStillValid=buttons[selection.y][selection.x]->onClick(MenuFuncData{*this,game,buttons[selection.y][selection.x]});
|
||||
if(buttonStillValid){
|
||||
if(buttons[selection.y][selection.x]->menuDest!=MenuType::ENUM_END){
|
||||
if(stack.size()<32){
|
||||
stack.push_back(menus[buttons[selection.y][selection.x]->menuDest]);//Navigate to the next menu.
|
||||
}else{
|
||||
ERR("WARNING! Exceeded menu stack size limit!")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -339,7 +343,8 @@ void Menu::Draw(Crawler*game){
|
||||
}
|
||||
};
|
||||
|
||||
void Menu::OpenMenu(MenuType menu){
|
||||
void Menu::OpenMenu(MenuType menu,bool cover){
|
||||
Menu::cover=cover;
|
||||
stack.clear();
|
||||
stack.push_back(menus[menu]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user