@ -38,12 +38,43 @@ All rights reserved.
# include "Menu.h"
# include "AdventuresInLestoria.h"
# include "RowInventoryScrollableWindowComponent.h"
# include "InventoryCreator.h"
# include "MenuItemItemButton.h"
# include "RowItemDisplay.h"
INCLUDE_game
void Menu : : InitializeArtificerDisassembleWindow ( ) {
Menu * artificerDisassembleWindow = CreateMenu ( ARTIFICER_DISASSEMBLE , CENTERED , vi2d { 144 , 144 } ) ;
Menu * artificerDisassembleWindow = CreateMenu ( ARTIFICER_DISASSEMBLE , CENTERED , game - > GetScreenSize ( ) - vi2d { 52 , 52 } ) ;
auto disassemblyTitleLabel { artificerDisassembleWindow - > ADD ( " Disassembly Title Label " , MenuLabel ) ( geom2d : : rect < float > { { } , { artificerDisassembleWindow - > size . x , 24.f } } , " Accessory Disassembly " , 2.f , ComponentAttr : : SHADOW | ComponentAttr : : OUTLINE | ComponentAttr : : BACKGROUND ) END } ;
auto inventoryLabel = artificerDisassembleWindow - > ADD ( " Accessory List Label " , MenuLabel ) ( geom2d : : rect < float > { { 0.f , 28.f } , { 180.f , 12.f } } , " Choose Accessory: " , 1.f , ComponentAttr : : SHADOW | ComponentAttr : : LEFT_ALIGN ) END ;
auto inventoryDisplay = artificerDisassembleWindow - > ADD ( " Accessory List " , RowInventoryScrollableWindowComponent ) ( geom2d : : rect < float > { { 0.f , 44.f } , { artificerDisassembleWindow - > size . x / 2 - 4.f , artificerDisassembleWindow - > size . y - 60 } } , " " , " " , [ ] ( MenuFuncData data ) {
return true ;
} , [ ] ( MenuFuncData data ) {
RowItemDisplay & item { * DYNAMIC_POINTER_CAST < RowItemDisplay > ( data . component ) } ;
Component < MenuItemItemButton > ( data . menu . type , " Item Icon " ) - > SetItem ( item . GetItem ( ) . lock ( ) ) ;
return true ;
} , DO_NOTHING ,
InventoryCreator : : RowPlayer_InventoryUpdate ,
InventoryWindowOptions { . padding = 1 , . size = { artificerDisassembleWindow - > size . x / 2 - 5.f - 12.f , 28 } } ) END ;
auto itemIcon { artificerDisassembleWindow - > ADD ( " Item Icon " , MenuItemItemButton ) ( geom2d : : rect < float > ( { artificerDisassembleWindow - > size . x / 2 + 4.f , 44.f } , { 48 , 48 } ) , Item : : BLANK , DO_NOTHING , " " , " Item Description " , IconButtonAttr : : NOT_SELECTABLE ) END } ;
itemIcon - > SetIconScale ( { 2.f , 2.f } ) ;
itemIcon - > SetCompactDescriptions ( true ) ;
auto accessoryDescription { artificerDisassembleWindow - > ADD ( " Item Description " , MenuLabel ) ( geom2d : : rect < float > ( { artificerDisassembleWindow - > size . x / 2 + 56.f , 44.f } , { artificerDisassembleWindow - > size . x / 2 - 56.f , 72.f } ) , " " , 0.5f , ComponentAttr : : BACKGROUND | ComponentAttr : : OUTLINE | ComponentAttr : : SHADOW | ComponentAttr : : LEFT_ALIGN ) END } ;
auto backButton = artificerDisassembleWindow - > ADD ( " Back " , MenuComponent ) ( geom2d : : rect < float > { { 0.f , artificerDisassembleWindow - > size . y - 12.f } , { 96.f , 16.f } } , " Back " , [ ] ( MenuFuncData data ) {
Menu : : CloseMenu ( ) ;
return true ;
} ) END ;
Menu : : AddInventoryListener ( inventoryDisplay , " Accessories " ) ;
artificerDisassembleWindow - > SetupKeyboardNavigation (
[ ] ( MenuType type , Data & returnData ) { //On Open
returnData = " " ;