@ -89,7 +89,11 @@ void Menu::InitializeInventoryWindow(){
Component < RowInventoryScrollableWindowComponent > ( data . menu . GetType ( ) , " Inventory Display - " + data . component . lock ( ) - > S ( A : : CATEGORY_NAME ) ) - > Enable ( ) ;
Component < MenuComponent > ( data . menu . GetType ( ) , data . component . lock ( ) - > S ( A : : CATEGORY_NAME ) + " Inventory Tab " ) - > SetSelected ( true ) ;
data . menu . S ( A : : LAST_INVENTORY_TYPE_OPENED ) = data . component . lock ( ) - > S ( A : : CATEGORY_NAME ) ;
data . menu . I ( A : : ITEM_SLOT ) = Component < RowInventoryScrollableWindowComponent > ( data . menu . GetType ( ) , " Inventory Display - " + data . component . lock ( ) - > S ( A : : CATEGORY_NAME ) ) - > GetComponents ( ) . size ( ) - 1 ;
if ( Component < RowInventoryScrollableWindowComponent > ( data . menu . GetType ( ) , " Inventory Display - " + data . component . lock ( ) - > S ( A : : CATEGORY_NAME ) ) - > GetComponents ( ) . size ( ) > 0 ) {
data . menu . I ( A : : ITEM_SLOT ) = 0 ;
} else {
data . menu . I ( A : : ITEM_SLOT ) = - 1 ;
}
if ( data . menu . I ( A : : ITEM_SLOT ) > = 0 ) {
data . menu . SetSelection ( Component < RowInventoryScrollableWindowComponent > ( data . menu . GetType ( ) , " Inventory Display - " + data . component . lock ( ) - > S ( A : : CATEGORY_NAME ) ) - > GetComponents ( ) [ 0 ] , true ) ;
}
@ -198,20 +202,42 @@ void Menu::InitializeInventoryWindow(){
{ game - > KEY_CONFIRM , { " Select " , [ ] ( MenuType type ) { } } } ,
}
, { //Button Navigation Rules
{ " Back Button " , {
. up = [ ] ( MenuType type , Data & returnData ) {
auto inventoryDisplay = Component < RowInventoryScrollableWindowComponent > ( type , std : : format ( " Inventory Display - {} " , Menu : : menus [ type ] - > S ( A : : LAST_INVENTORY_TYPE_OPENED ) ) ) ;
if ( inventoryDisplay - > GetComponents ( ) . size ( ) > 0 ) {
returnData = inventoryDisplay - > GetComponents ( ) [ inventoryDisplay - > GetComponents ( ) . size ( ) - 1 ] ;
} else {
returnData = " Back Button " ;
}
} ,
. down = [ ] ( MenuType type , Data & returnData ) {
auto inventoryDisplay = Component < RowInventoryScrollableWindowComponent > ( type , std : : format ( " Inventory Display - {} " , Menu : : menus [ type ] - > S ( A : : LAST_INVENTORY_TYPE_OPENED ) ) ) ;
if ( inventoryDisplay - > GetComponents ( ) . size ( ) > 0 ) {
returnData = inventoryDisplay - > GetComponents ( ) [ 0 ] ;
} else {
returnData = " Back Button " ;
}
} ,
. left = [ ] ( MenuType type , Data & returnData ) {
returnData = std : : format ( " {} Inventory Tab " , Menu : : menus [ type ] - > S ( A : : LAST_INVENTORY_TYPE_OPENED ) ) ;
} ,
. right = [ ] ( MenuType type , Data & returnData ) {
returnData = std : : format ( " {} Inventory Tab " , Menu : : menus [ type ] - > S ( A : : LAST_INVENTORY_TYPE_OPENED ) ) ;
} ,
} } ,
{ " Inventory Display - Consumables " , {
. up = [ ] ( MenuType type , Data & returnData ) {
Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) - - ;
if ( Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) < 0 ) {
Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Consumables " ) - > GetComponents ( ) . size ( ) - 1 ;
}
returnData = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Consumables " ) - > GetComponents ( ) [ Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) ] ;
returnData = " Back Button " ;
} else returnData = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Consumables " ) - > GetComponents ( ) [ Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) ] ;
} ,
. down = [ ] ( MenuType type , Data & returnData ) {
Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) + + ;
if ( Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) > = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Consumables " ) - > GetComponents ( ) . size ( ) ) {
Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) - = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Consumables " ) - > GetComponents ( ) . size ( ) ;
}
returnData = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Consumables " ) - > GetComponents ( ) [ Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) ] ;
returnData = " Back Button " ;
} else returnData = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Consumables " ) - > GetComponents ( ) [ Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) ] ;
} ,
. left = [ ] ( MenuType type , Data & returnData ) {
returnData = std : : format ( " {} Inventory Tab " , Menu : : menus [ type ] - > S ( A : : LAST_INVENTORY_TYPE_OPENED ) ) ;
@ -224,16 +250,14 @@ void Menu::InitializeInventoryWindow(){
. up = [ ] ( MenuType type , Data & returnData ) {
Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) - - ;
if ( Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) < 0 ) {
Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Equipment " ) - > GetComponents ( ) . size ( ) - 1 ;
}
returnData = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Equipment " ) - > GetComponents ( ) [ Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) ] ;
returnData = " Back Button " ;
} else returnData = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Equipment " ) - > GetComponents ( ) [ Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) ] ;
} ,
. down = [ ] ( MenuType type , Data & returnData ) {
Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) + + ;
if ( Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) > = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Equipment " ) - > GetComponents ( ) . size ( ) ) {
Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) - = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Equipment " ) - > GetComponents ( ) . size ( ) ;
}
returnData = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Equipment " ) - > GetComponents ( ) [ Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) ] ;
returnData = " Back Button " ;
} else returnData = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Equipment " ) - > GetComponents ( ) [ Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) ] ;
} ,
. left = [ ] ( MenuType type , Data & returnData ) {
returnData = std : : format ( " {} Inventory Tab " , Menu : : menus [ type ] - > S ( A : : LAST_INVENTORY_TYPE_OPENED ) ) ;
@ -246,16 +270,14 @@ void Menu::InitializeInventoryWindow(){
. up = [ ] ( MenuType type , Data & returnData ) {
Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) - - ;
if ( Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) < 0 ) {
Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Accessories " ) - > GetComponents ( ) . size ( ) - 1 ;
}
returnData = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Accessories " ) - > GetComponents ( ) [ Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) ] ;
returnData = " Back Button " ;
} else returnData = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Accessories " ) - > GetComponents ( ) [ Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) ] ;
} ,
. down = [ ] ( MenuType type , Data & returnData ) {
Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) + + ;
if ( Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) > = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Accessories " ) - > GetComponents ( ) . size ( ) ) {
Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) - = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Accessories " ) - > GetComponents ( ) . size ( ) ;
}
returnData = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Accessories " ) - > GetComponents ( ) [ Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) ] ;
returnData = " Back Button " ;
} else returnData = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Accessories " ) - > GetComponents ( ) [ Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) ] ;
} ,
. left = [ ] ( MenuType type , Data & returnData ) {
returnData = std : : format ( " {} Inventory Tab " , Menu : : menus [ type ] - > S ( A : : LAST_INVENTORY_TYPE_OPENED ) ) ;
@ -268,16 +290,14 @@ void Menu::InitializeInventoryWindow(){
. up = [ ] ( MenuType type , Data & returnData ) {
Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) - - ;
if ( Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) < 0 ) {
Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Materials " ) - > GetComponents ( ) . size ( ) - 1 ;
}
returnData = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Materials " ) - > GetComponents ( ) [ Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) ] ;
returnData = " Back Button " ;
} else returnData = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Materials " ) - > GetComponents ( ) [ Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) ] ;
} ,
. down = [ ] ( MenuType type , Data & returnData ) {
Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) + + ;
if ( Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) > = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Materials " ) - > GetComponents ( ) . size ( ) ) {
Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) - = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Materials " ) - > GetComponents ( ) . size ( ) ;
}
returnData = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Materials " ) - > GetComponents ( ) [ Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) ] ;
returnData = " Back Button " ;
} else returnData = Component < RowInventoryScrollableWindowComponent > ( type , " Inventory Display - Materials " ) - > GetComponents ( ) [ Menu : : menus [ type ] - > I ( A : : ITEM_SLOT ) ] ;
} ,
. left = [ ] ( MenuType type , Data & returnData ) {
returnData = std : : format ( " {} Inventory Tab " , Menu : : menus [ type ] - > S ( A : : LAST_INVENTORY_TYPE_OPENED ) ) ;