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:
@@ -26,12 +26,13 @@ void Menu::InitializeClassSelectionWindow(){
|
||||
|
||||
vf2d navigationButtonSize={24*2.5f,16};
|
||||
|
||||
MenuComponent*backButton=NEW MenuComponent(CLASS_SELECTION,{{4+2,outlineSize.y+4-navigationButtonSize.y-2},navigationButtonSize},"Back",[](MenuFuncData data){Menu::CloseMenu();});
|
||||
MenuComponent*backButton=NEW MenuComponent(CLASS_SELECTION,{{4+2,outlineSize.y+4-navigationButtonSize.y-2},navigationButtonSize},"Back",[](MenuFuncData data){Menu::CloseMenu();return true;});
|
||||
classSelectionWindow->AddComponent("Back Button",backButton);
|
||||
MenuComponent*confirmButton=NEW MenuComponent(CLASS_SELECTION,{{outlineSize.x+4-navigationButtonSize.x-2,outlineSize.y+4-navigationButtonSize.y-2},navigationButtonSize},"Confirm",[](MenuFuncData data){
|
||||
std::string selectedClass=data.component->S(A::CLASS_SELECTION);
|
||||
data.game->ChangePlayerClass(classutils::StringToClass(selectedClass));
|
||||
GameState::ChangeState(States::OVERWORLD_MAP);
|
||||
return true;
|
||||
});
|
||||
confirmButton->disabled=true;
|
||||
classSelectionWindow->AddComponent("Confirm",confirmButton);
|
||||
@@ -79,6 +80,7 @@ void Menu::InitializeClassSelectionWindow(){
|
||||
MenuAnimatedIconToggleButton*classSprite=NEW MenuAnimatedIconToggleButton(CLASS_SELECTION,{backgroundOffsetPos+vf2d{0,12},backgroundSize+vf2d{0,-buttonSize.y-12}},classAnimationName,[](MenuFuncData data){
|
||||
data.menu.components["Confirm"]->Enable(true);
|
||||
data.menu.components["Confirm"]->S(A::CLASS_SELECTION)=data.component->S(A::CLASS_SELECTION);
|
||||
return true;
|
||||
});
|
||||
toggleGroup.push_back(classSprite);
|
||||
MenuComponent*classButton=NEW MenuComponent(CLASS_SELECTION,{offsetPos,buttonSize},"Info",CLASS_INFO,
|
||||
@@ -86,6 +88,7 @@ void Menu::InitializeClassSelectionWindow(){
|
||||
data.menu.S(A::CLASS_SELECTION)=data.component->S(A::CLASS_SELECTION);
|
||||
delete Menu::menus[CLASS_INFO];
|
||||
Menu::InitializeClassInfoWindow();
|
||||
return true;
|
||||
});
|
||||
classSprite->S(A::CLASS_SELECTION)=classButton->S(A::CLASS_SELECTION)=className;
|
||||
classSelectionWindow->AddComponent(className+" Button",classButton);
|
||||
|
||||
Reference in New Issue
Block a user