@ -51,6 +51,8 @@ INCLUDE_game
INCLUDE_GFX
void Menu : : InitializeCharacterMenuWindow ( ) {
static bool equipmentWindowOpened = false ;
vf2d windowSize = game - > GetScreenSize ( ) - vf2d { 52 , 52 } ;
Menu * characterMenuWindow = CreateMenu ( CHARACTER_MENU , CENTERED , windowSize ) ;
@ -87,8 +89,10 @@ void Menu::InitializeCharacterMenuWindow(){
StatLabel * statDisplayLabel = Component < StatLabel > ( CHARACTER_MENU , " Attribute " + ItemAttributable : : GetDisplayInfo ( attribute ) . name + " Label " ) ;
statDisplayLabel - > SetStatChangeAmt ( 0 ) ;
}
equipmentWindowOpened = false ;
return true ;
} ) ;
equipSelectionSelectButton - > decal = true ;
equipSelectionOutline - > Enable ( false ) ;
equipmentList - > Enable ( false ) ;
@ -190,6 +194,7 @@ void Menu::InitializeCharacterMenuWindow(){
if ( Inventory : : GetEquip ( slot ) = = & itemInvRef ) {
equip - > SetSelected ( true ) ;
}
equip - > SetCompactDescriptions ( false ) ;
equipList - > AddComponent ( Menu : : menus [ CHARACTER_MENU ] , " Equip Item " + std : : to_string ( counter ) , equip ) ;
counter + + ;
}
@ -199,12 +204,24 @@ void Menu::InitializeCharacterMenuWindow(){
Component < MenuComponent > ( data . component - > parentMenu , " Equip Selection Bottom Outline " ) - > Enable ( true ) ;
Component < MenuComponent > ( data . component - > parentMenu , " Equip Selection Select Button " ) - > Enable ( true ) ;
Component < CharacterRotatingDisplay > ( data . component - > parentMenu , " Character Rotating Display " ) - > Enable ( false ) ;
equipmentWindowOpened = true ;
return true ;
} , [ ] ( MenuFuncData data ) { //On Mouse Hover
if ( Component < MenuLabel > ( data . component - > parentMenu , " Item Equip Description " ) - > GetLabel ( ) ! = " " ) {
Component < CharacterRotatingDisplay > ( data . component - > parentMenu , " Character Rotating Display " ) - > Enable ( false ) ;
}
return true ;
} , [ ] ( MenuFuncData data ) { //On Mouse Out
if ( Component < MenuLabel > ( data . component - > parentMenu , " Item Equip Description " ) - > GetLabel ( ) ! = " " & & ! equipmentWindowOpened ) {
Component < CharacterRotatingDisplay > ( data . component - > parentMenu , " Character Rotating Display " ) - > Enable ( true ) ;
}
return true ;
} , DO_NOTHING , DO_NOTHING , " Item Name " , " Item Description " ) ;
} , " Item Equip Name " , " Item Equip Description " ) ;
PopupMenuLabel * equipmentLabel = NEW PopupMenuLabel ( CHARACTER_MENU , { { labelX , labelY } , { 29 , 16 } } , slotNames [ i ] , { 0.5 , 1 } , ComponentAttr : : SHADOW ) ;
equipmentSlot - > I ( Attribute : : EQUIP_TYPE ) = int ( slot ) ;
equipmentSlot - > I ( Attribute : : INDEXED_THEME ) = i ;
equipmentSlot - > SetShowQuantity ( false ) ;
equipmentSlot - > SetCompactDescriptions ( false ) ;
equipSlot < < = 1 ;
characterMenuWindow - > AddComponent ( " Equip Slot " + slotNames [ i ] , equipmentSlot ) ;
characterMenuWindow - > AddComponent ( " Equip Label " + slotNames [ i ] , equipmentLabel ) ;
@ -229,10 +246,19 @@ void Menu::InitializeCharacterMenuWindow(){
backButton - > decal = true ;
characterMenuWindow - > AddComponent ( " Back button " , backButton ) ;
MenuLabel * itemNameDisplay = NEW MenuLabel ( CHARACTER_MENU , { { 32 , windowSize . y - 32 } , { windowSize . x - 64 , 12 } } , " " , 1 , ComponentAttr : : BACKGROUND | ComponentAttr : : LEFT_ALIGN | ComponentAttr : : OUTLINE | ComponentAttr : : SHADOW ) ;
MenuLabel * itemNameDisplay = NEW MenuLabel ( CHARACTER_MENU , { { 0 , 28 } , { 120 , 12 } } , " " , 1 , ComponentAttr : : BACKGROUND | ComponentAttr : : LEFT_ALIGN | ComponentAttr : : OUTLINE | ComponentAttr : : SHADOW ) ;
MenuLabel * itemDescriptionDisplay = NEW MenuLabel ( CHARACTER_MENU , { { 0 , 40 } , { 120 , windowSize . y - 49 } } , " " , 1 , ComponentAttr : : BACKGROUND | ComponentAttr : : LEFT_ALIGN | ComponentAttr : : OUTLINE | ComponentAttr : : SHADOW ) ;
itemNameDisplay - > decal = true ;
MenuLabel * itemDescriptionDisplay = NEW MenuLabel ( CHARACTER_MENU , { { 32 , windowSize . y - 20 } , { windowSize . x - 64 , 32 } } , " " , 1 , ComponentAttr : : BACKGROUND | ComponentAttr : : LEFT_ALIGN | ComponentAttr : : OUTLINE | ComponentAttr : : SHADOW ) ;
itemDescriptionDisplay - > decal = true ;
itemNameDisplay - > Enable ( false ) ;
itemDescriptionDisplay - > Enable ( false ) ;
MenuLabel * itemNameDisplayEquip = NEW MenuLabel ( CHARACTER_MENU , { { 123 , 28 } , { 120 , 12 } } , " " , 1 , ComponentAttr : : BACKGROUND | ComponentAttr : : LEFT_ALIGN | ComponentAttr : : OUTLINE | ComponentAttr : : SHADOW ) ;
MenuLabel * itemDescriptionDisplayEquip = NEW MenuLabel ( CHARACTER_MENU , { { 123 , 40 } , { 120 , windowSize . y - 49 } } , " " , 1 , ComponentAttr : : BACKGROUND | ComponentAttr : : LEFT_ALIGN | ComponentAttr : : OUTLINE | ComponentAttr : : SHADOW ) ;
characterMenuWindow - > AddComponent ( " Item Name " , itemNameDisplay ) ;
characterMenuWindow - > AddComponent ( " Item Description " , itemDescriptionDisplay ) ;
characterMenuWindow - > AddComponent ( " Item Equip Name " , itemNameDisplayEquip ) ;
characterMenuWindow - > AddComponent ( " Item Equip Description " , itemDescriptionDisplayEquip ) ;
}