# pragma region License
/*
License ( OLC - 3 )
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Copyright 2024 Joshua Sigona < sigonasr2 @ gmail . com >
Redistribution and use in source and binary forms , with or without modification ,
are permitted provided that the following conditions are met :
1. Redistributions or derivations of source code must retain the above copyright
notice , this list of conditions and the following disclaimer .
2. Redistributions or derivative works in binary form must reproduce the above
copyright notice . This list of conditions and the following disclaimer must be
reproduced in the documentation and / or other materials provided with the distribution .
3. Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without specific
prior written permission .
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS " AND ANY
EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT LIMITED TO , THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT ,
INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , DATA , OR PROFITS ; OR
BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY , WHETHER IN
CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE .
Portions of this software are copyright © 2024 The FreeType
Project ( www . freetype . org ) . Please see LICENSE_FT . txt for more information .
All rights reserved .
*/
# pragma endregion
# include "Menu.h"
# include "AdventuresInLestoria.h"
# include "MenuLabel.h"
# include "MenuComponent.h"
# include "InventoryScrollableWindowComponent.h"
# include "PopupMenuLabel.h"
# include "Unlock.h"
# include "State_OverworldMap.h"
INCLUDE_game
void Menu : : InitializeLevelCompleteWindow ( ) {
geom2d : : rect < int > windowSize = { { 28 , 28 } , game - > GetScreenSize ( ) - vf2d { 56 , 56 } } ;
Menu * levelCompleteWindow = Menu : : CreateMenu ( LEVEL_COMPLETE , windowSize . pos , windowSize . size ) ;
levelCompleteWindow - > ADD ( " Stage Complete Label " , MenuLabel ) ( geom2d : : rect < float > { { 0 , 4 } , { windowSize . size . x - 1.f , 20 } } , " Stage Completed " , 2 , ComponentAttr : : OUTLINE | ComponentAttr : : BACKGROUND | ComponentAttr : : SHADOW ) END ;
levelCompleteWindow - > ADD ( " Monster Loot Outline " , MenuComponent ) ( geom2d : : rect < float > { { 0 , 32 } , { windowSize . size . x - 80.f , 72 } } , " " , DO_NOTHING , ButtonAttr : : UNSELECTABLE ) END ;
levelCompleteWindow - > ADD ( " Monster Loot Label " , MenuLabel ) ( geom2d : : rect < float > { { 0 , 32 } , { windowSize . size . x - 80.f , 12 } } , " Monster Loot " , 1 , ComponentAttr : : LEFT_ALIGN | ComponentAttr : : SHADOW | ComponentAttr : : OUTLINE ) END ;
auto monsterLootWindow = levelCompleteWindow - > ADD ( " Monster Loot Window " , InventoryScrollableWindowComponent ) ( geom2d : : rect < float > { { 0 , 44 } , { windowSize . size . x - 80.f , 60 } } , " Monster Loot Popup Item Name " , " Monster Loot Popup Item Description " , DO_NOTHING , InventoryCreator : : Player_InventoryUpdate ) END ;
Menu : : AddInventoryListener ( monsterLootWindow , " Monster Loot " ) ;
levelCompleteWindow - > ADD ( " Stage Loot Outline " , MenuComponent ) ( geom2d : : rect < float > { { 0 , 108 } , { windowSize . size . x - 80.f , 72 } } , " " , DO_NOTHING , ButtonAttr : : UNSELECTABLE ) END ;
levelCompleteWindow - > ADD ( " Stage Loot Label " , MenuLabel ) ( geom2d : : rect < float > { { 0 , 108 } , { windowSize . size . x - 80.f , 12 } } , " Stage Loot " , 1 , ComponentAttr : : LEFT_ALIGN | ComponentAttr : : SHADOW | ComponentAttr : : OUTLINE ) END ;
auto stageLootWindow = levelCompleteWindow - > ADD ( " Stage Loot Window " , InventoryScrollableWindowComponent ) ( geom2d : : rect < float > { { 0 , 120 } , { windowSize . size . x - 80.f , 60 } } , " Stage Loot Popup Item Name " , " Stage Loot Popup Item Description " , DO_NOTHING , InventoryCreator : : Player_InventoryUpdate ) END ;
Menu : : AddInventoryListener ( stageLootWindow , " Stage Loot " ) ;
auto nextButtonAction = [ ] ( MenuFuncData data ) {
Unlock : : UnlockArea ( State_OverworldMap : : GetCurrentConnectionPoint ( ) . map ) ;
Merchant : : RandomizeTravelingMerchant ( ) ;
GameState : : ChangeState ( States : : GAME_HUB , 0.25f ) ;
return true ;
} ;
levelCompleteWindow - > ADD ( " Level Details Outline " , MenuComponent ) ( geom2d : : rect < float > { { windowSize . size . x - 72.f , 32 } , { 71 , 72 } } , " " , DO_NOTHING , ButtonAttr : : UNSELECTABLE ) END ;
levelCompleteWindow - > ADD ( " Level EXP Gain Outline " , MenuLabel ) ( geom2d : : rect < float > { { windowSize . size . x - 72.f , 104 } , { 71 , 36 } } , " + Exp " , 1 , ComponentAttr : : SHADOW | ComponentAttr : : OUTLINE | ComponentAttr : : BACKGROUND ) END ;
levelCompleteWindow - > ADD ( " Next Button " , MenuComponent ) ( geom2d : : rect < float > { { windowSize . size . x - 72.f , 144 } , { 71 , 32 } } , " Next " , nextButtonAction ) END ;
levelCompleteWindow - > ADD ( " Monster Loot Popup Item Name " , PopupMenuLabel ) ( geom2d : : rect < float > { { 0 , 108 } , { windowSize . size . x - 80.f , 12 } } , " " , 1.0f , ComponentAttr : : LEFT_ALIGN | ComponentAttr : : SHADOW | ComponentAttr : : OUTLINE | ComponentAttr : : BACKGROUND ) END ;
levelCompleteWindow - > ADD ( " Monster Loot Popup Item Description " , PopupMenuLabel ) ( geom2d : : rect < float > { { 0 , 120 } , { windowSize . size . x - 80.f , 60 } } , " " , 1.0f , ComponentAttr : : LEFT_ALIGN | ComponentAttr : : SHADOW | ComponentAttr : : OUTLINE | ComponentAttr : : BACKGROUND ) END ;
levelCompleteWindow - > ADD ( " Stage Loot Popup Item Name " , PopupMenuLabel ) ( geom2d : : rect < float > { { 0 , 32 } , { windowSize . size . x - 80.f , 12 } } , " " , 1.0f , ComponentAttr : : LEFT_ALIGN | ComponentAttr : : SHADOW | ComponentAttr : : OUTLINE | ComponentAttr : : BACKGROUND ) END ;
levelCompleteWindow - > ADD ( " Stage Loot Popup Item Description " , PopupMenuLabel ) ( geom2d : : rect < float > { { 0 , 44 } , { windowSize . size . x - 80.f , 60 } } , " " , 1.0f , ComponentAttr : : LEFT_ALIGN | ComponentAttr : : SHADOW | ComponentAttr : : OUTLINE | ComponentAttr : : BACKGROUND ) END ;
}