@ -56,15 +56,10 @@ void Menu::InitializeCharacterMenuWindow(){
vf2d windowSize = game - > GetScreenSize ( ) - vf2d { 52 , 52 } ;
vf2d windowSize = game - > GetScreenSize ( ) - vf2d { 52 , 52 } ;
Menu * characterMenuWindow = CreateMenu ( CHARACTER_MENU , CENTERED , windowSize ) ;
Menu * characterMenuWindow = CreateMenu ( CHARACTER_MENU , CENTERED , windowSize ) ;
MenuLabel * characterLabel = NEW MenuLabel ( CHARACTER_MENU , { { 0 , - 4 } , { float ( windowSize . x ) - 1 , 24 } } , " Character " , 2 , ComponentAttr : : SHADOW | ComponentAttr : : OUTLINE | ComponentAttr : : BACKGROUND ) ;
characterMenuWindow - > ADD ( " Character Label " , MenuLabel ) ( { { 0 , - 4 } , { float ( windowSize . x ) - 1 , 24 } } , " Character " , 2 , ComponentAttr : : SHADOW | ComponentAttr : : OUTLINE | ComponentAttr : : BACKGROUND ) END
characterLabel - > decal = true ;
- > decal = true ;
characterMenuWindow - > ADD ( " Equip Slot Outline " , MenuComponent ) ( { { 0 , 28 } , { 120 , windowSize . y - 37 } } , " " , DO_NOTHING , ButtonAttr : : UNSELECTABLE ) END ;
MenuComponent * equipSlotOutline = NEW MenuComponent ( CHARACTER_MENU , { { 0 , 28 } , { 120 , windowSize . y - 37 } } , " " , DO_NOTHING , ButtonAttr : : UNSELECTABLE ) ;
characterMenuWindow - > ADD ( " Character Rotating Display " , CharacterRotatingDisplay ) ( { { 135 , 28 } , { 90 , windowSize . y - 37 } } , GFX [ classutils : : GetClassInfo ( game - > GetPlayer ( ) - > GetClassName ( ) ) . classFullImgName ] . Decal ( ) ) END ;
CharacterRotatingDisplay * charDisplay = NEW CharacterRotatingDisplay ( CHARACTER_MENU , { { 135 , 28 } , { 90 , windowSize . y - 37 } } , GFX [ classutils : : GetClassInfo ( game - > GetPlayer ( ) - > GetClassName ( ) ) . classFullImgName ] . Decal ( ) ) ;
characterMenuWindow - > AddComponent ( " Character Label " , characterLabel ) ;
characterMenuWindow - > AddComponent ( " Equip Slot Outline " , equipSlotOutline ) ;
characterMenuWindow - > AddComponent ( " Character Rotating Display " , charDisplay ) ;
const static std : : array < ItemAttribute , 7 > displayAttrs {
const static std : : array < ItemAttribute , 7 > displayAttrs {
ItemAttribute : : health ,
ItemAttribute : : health ,
@ -76,33 +71,31 @@ void Menu::InitializeCharacterMenuWindow(){
ItemAttribute : : critDmgPct ,
ItemAttribute : : critDmgPct ,
} ;
} ;
MenuComponent * equipSelectionOutline = NEW MenuComponent ( CHARACTER_MENU , { { 123 , 28 } , { 120 , windowSize . y - 37 } } , " " , DO_NOTHING , ButtonAttr : : UNSELECTABLE ) ;
ScrollableWindowComponent * equipmentList = NEW ScrollableWindowComponent ( CHARACTER_MENU , { { 123 , 28 } , { 120 , windowSize . y - 37 - 24 } } ) ;
MenuComponent * equipSelectionBottomOutline = NEW MenuComponent ( CHARACTER_MENU , { { 123 , 28 + ( windowSize . y - 37 - 24 ) } , { 120 , 24 } } , " " , DO_NOTHING , ButtonAttr : : UNSELECTABLE ) ;
MenuComponent * equipSelectionSelectButton = NEW MenuComponent ( CHARACTER_MENU , { { 123 + 12 , 28 + ( windowSize . y - 37 - 24 ) + 6 } , { 96 , 12 } } , " Select " , [ ] ( MenuFuncData data ) {
Component < MenuComponent > ( data . component - > parentMenu , " Equip Selection Outline " ) - > Enable ( false ) ;
Component < ScrollableWindowComponent > ( data . component - > parentMenu , " Equip List " ) - > Enable ( false ) ;
Component < MenuComponent > ( data . component - > parentMenu , " Equip Selection Bottom Outline " ) - > Enable ( false ) ;
Component < MenuComponent > ( data . component - > parentMenu , " Equip Selection Select Button " ) - > Enable ( false ) ;
Component < CharacterRotatingDisplay > ( data . component - > parentMenu , " Character Rotating Display " ) - > Enable ( true ) ;
for ( int counter = 0 ; ItemAttribute attribute : displayAttrs ) {
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 ) ;
characterMenuWindow - > ADD ( " Equip Selection Outline " , MenuComponent ) ( { { 123 , 28 } , { 120 , windowSize . y - 37 } } , " " , DO_NOTHING , ButtonAttr : : UNSELECTABLE ) END
equipmentList - > Enable ( false ) ;
- > Enable ( false ) ;
equipSelectionBottomOutline - > Enable ( false ) ;
characterMenuWindow - > ADD ( " Equip List " , ScrollableWindowComponent ) ( { { 123 , 28 } , { 120 , windowSize . y - 37 - 24 } } ) DEPTH - 1 END
equipSelectionSelectButton - > Enable ( false ) ;
- > Enable ( false ) ;
characterMenuWindow - > ADD ( " Equip Selection Bottom Outline " , MenuComponent ) ( { { 123 , 28 + ( windowSize . y - 37 - 24 ) } , { 120 , 24 } } , " " , DO_NOTHING , ButtonAttr : : UNSELECTABLE ) END
- > Enable ( false ) ;
auto equipSelectionSelectButton = characterMenuWindow - > ADD ( " Equip Selection Select Button " , MenuComponent ) ( { { 123 + 12 , 28 + ( windowSize . y - 37 - 24 ) + 6 } , { 96 , 12 } } , " Select " ,
[ ] ( MenuFuncData data ) {
Component < MenuComponent > ( data . component - > parentMenu , " Equip Selection Outline " ) - > Enable ( false ) ;
Component < ScrollableWindowComponent > ( data . component - > parentMenu , " Equip List " ) - > Enable ( false ) ;
Component < MenuComponent > ( data . component - > parentMenu , " Equip Selection Bottom Outline " ) - > Enable ( false ) ;
Component < MenuComponent > ( data . component - > parentMenu , " Equip Selection Select Button " ) - > Enable ( false ) ;
Component < CharacterRotatingDisplay > ( data . component - > parentMenu , " Character Rotating Display " ) - > Enable ( true ) ;
for ( int counter = 0 ; ItemAttribute attribute : displayAttrs ) {
StatLabel * statDisplayLabel = Component < StatLabel > ( CHARACTER_MENU , " Attribute " + ItemAttributable : : GetDisplayInfo ( attribute ) . name + " Label " ) ;
statDisplayLabel - > SetStatChangeAmt ( 0 ) ;
}
equipmentWindowOpened = false ;
return true ;
} ) END ;
characterMenuWindow - > AddComponent ( " Equip Selection Outline " , equipSelectionOutline ) ;
characterMenuWindow - > AddComponent ( " Equip List " , equipmentList , - 1 ) ;
equipSelectionSelectButton - > decal = true ;
characterMenuWindow - > AddComponent ( " Equip Selection Bottom Outline " , equipSelectionBottomOutline ) ;
equipSelectionSelectButton - > Enable ( false ) ;
characterMenuWindow - > AddComponent ( " Equip Selection Select Button " , equipSelectionSelectButton ) ;
const static auto GetLabelText = [ ] ( ItemAttribute attribute ) {
const static auto GetLabelText = [ ] ( ItemAttribute attribute ) {
AttributeData data = ItemAttributable : : GetDisplayInfo ( attribute ) ;
AttributeData data = ItemAttributable : : GetDisplayInfo ( attribute ) ;
@ -126,139 +119,128 @@ void Menu::InitializeCharacterMenuWindow(){
}
}
const static std : : array < std : : string , 8 > slotNames { " Helmet " , " Weapon " , " Armor " , " Gloves " , " Pants " , " Shoes " , " Ring 1 " , " Ring 2 " } ;
const static std : : array < std : : string , 8 > slotNames { " Helmet " , " Weapon " , " Armor " , " Gloves " , " Pants " , " Shoes " , " Ring 1 " , " Ring 2 " } ;
EquipSlot slot = EquipSlot ( equipSlot ) ;
EquipSlot slot = EquipSlot ( equipSlot ) ;
auto equipmentSlot = characterMenuWindow - > ADD ( " Equip Slot " + slotNames [ i ] , EquipSlotButton ) ( { { x , y + 28 } , { 24 , 24 } } , slot , MenuType : : ENUM_END ,
EquipSlotButton * equipmentSlot = NEW EquipSlotButton ( CHARACTER_MENU , { { x , y + 28 } , { 24 , 24 } } , slot , MenuType : : ENUM_END ,
[ & ] ( MenuFuncData data ) {
[ & ] ( MenuFuncData data ) {
EquipSlot slot = EquipSlot ( data . component - > I ( Attribute : : EQUIP_TYPE ) ) ;
EquipSlot slot = EquipSlot ( data . component - > I ( Attribute : : EQUIP_TYPE ) ) ;
std : : vector < Item > & equips = Inventory : : get ( " Equipment " ) ;
std : : vector < Item > & equips = Inventory : : get ( " Equipment " ) ;
std : : vector < Item > & accessories = Inventory : : get ( " Accessories " ) ;
std : : vector < Item > & accessories = Inventory : : get ( " Accessories " ) ;
std : : vector < Item > availableEquipment ;
std : : vector < Item > availableEquipment ;
std : : copy_if ( equips . begin ( ) , equips . end ( ) , std : : back_inserter ( availableEquipment ) , [ & ] ( Item & it ) {
std : : copy_if ( equips . begin ( ) , equips . end ( ) , std : : back_inserter ( availableEquipment ) , [ & ] ( Item & it ) {
return it . GetEquipSlot ( ) & slot ;
return it . GetEquipSlot ( ) & slot ;
} ) ;
} ) ;
std : : copy_if ( accessories . begin ( ) , accessories . end ( ) , std : : back_inserter ( availableEquipment ) , [ & ] ( Item & it ) {
std : : copy_if ( accessories . begin ( ) , accessories . end ( ) , std : : back_inserter ( availableEquipment ) , [ & ] ( Item & it ) {
return it . GetEquipSlot ( ) & slot ;
return it . GetEquipSlot ( ) & slot ;
} ) ;
} ) ;
ScrollableWindowComponent * equipList = Component < ScrollableWindowComponent > ( data . component - > parentMenu , " Equip List " ) ;
ScrollableWindowComponent * equipList = Component < ScrollableWindowComponent > ( data . component - > parentMenu , " Equip List " ) ;
equipList - > RemoveAllComponents ( ) ;
equipList - > RemoveAllComponents ( ) ;
for ( int counter = 0 ; Item & it : availableEquipment ) {
for ( int counter = 0 ; Item & it : availableEquipment ) {
float xOffset = ( counter % 3 ) * 26 ;
float xOffset = ( counter % 3 ) * 26 ;
Item & itemInvRef = Inventory : : GetItem ( it . Name ( ) ) ;
Item & itemInvRef = Inventory : : GetItem ( it . Name ( ) ) ;
auto equip = equipList - > ADD ( " Equip Item " + std : : to_string ( counter ) , MenuItemItemButton ) ( { { 2 + xOffset , 2 } , { 24 , 24 } } , itemInvRef , MenuType : : ENUM_END ,
MenuItemItemButton * equip = NEW MenuItemItemButton ( CHARACTER_MENU , { { 2 + xOffset , 2 } , { 24 , 24 } } , itemInvRef , MenuType : : ENUM_END , [ ] ( MenuFuncData data ) {
[ ] ( MenuFuncData data ) {
MenuItemItemButton * comp = ( MenuItemItemButton * ) data . component ;
MenuItemItemButton * comp = ( MenuItemItemButton * ) data . component ;
Inventory : : EquipItem ( comp - > GetItem ( ) , EquipSlot ( comp - > I ( Attribute : : EQUIP_TYPE ) ) ) ;
Inventory : : EquipItem ( comp - > GetItem ( ) , EquipSlot ( comp - > I ( Attribute : : EQUIP_TYPE ) ) ) ;
for ( MenuComponent * button : ( ( ScrollableWindowComponent * ) data . parentComponent ) - > GetComponents ( ) ) {
for ( MenuComponent * button : ( ( ScrollableWindowComponent * ) data . parentComponent ) - > GetComponents ( ) ) {
MenuItemItemButton * comp = ( MenuItemItemButton * ) button ;
MenuItemItemButton * comp = ( MenuItemItemButton * ) button ;
comp - > SetSelected ( false ) ;
comp - > SetSelected ( false ) ;
}
}
comp - > SetSelected ( true ) ;
comp - > SetSelected ( true ) ;
for ( int counter = 0 ; ItemAttribute attribute : displayAttrs ) {
for ( int counter = 0 ; ItemAttribute attribute : displayAttrs ) {
StatLabel * statDisplayLabel = Component < StatLabel > ( CHARACTER_MENU , " Attribute " + ItemAttributable : : GetDisplayInfo ( attribute ) . name + " Label " ) ;
StatLabel * statDisplayLabel = Component < StatLabel > ( CHARACTER_MENU , " Attribute " + ItemAttributable : : GetDisplayInfo ( attribute ) . name + " Label " ) ;
statDisplayLabel - > SetStatChangeAmt ( 0 ) ;
statDisplayLabel - > SetStatChangeAmt ( 0 ) ;
}
MenuItemItemButton * equipButton = Component < MenuItemItemButton > ( CHARACTER_MENU , " Equip Slot " + slotNames [ data . parentComponent - > I ( A : : INDEXED_THEME ) ] ) ;
equipButton - > SetItem ( comp - > GetItem ( ) ) ;
return true ;
} , [ & ] ( MenuFuncData data ) {
MenuItemItemButton * button = ( MenuItemItemButton * ) data . component ;
Item & buttonItem = button - > GetItem ( ) ;
std : : vector < int > statsBeforeEquip ;
EquipSlot slot = EquipSlot ( button - > I ( Attribute : : EQUIP_TYPE ) ) ;
for ( ItemAttribute attribute : displayAttrs ) {
statsBeforeEquip . push_back ( game - > GetPlayer ( ) - > GetStat ( attribute ) ) ;
}
Item * equippedItem = Inventory : : GetEquip ( slot ) ;
Inventory : : EquipItem ( buttonItem , slot ) ;
for ( int counter = 0 ; ItemAttribute attribute : displayAttrs ) {
StatLabel * statDisplayLabel = Component < StatLabel > ( CHARACTER_MENU , " Attribute " + ItemAttributable : : GetDisplayInfo ( attribute ) . name + " Label " ) ;
int statChangeAmt = game - > GetPlayer ( ) - > GetStat ( attribute ) - statsBeforeEquip [ counter ] ;
statDisplayLabel - > SetStatChangeAmt ( statChangeAmt ) ;
counter + + ;
}
Inventory : : UnequipItem ( slot ) ;
if ( * equippedItem ! = Item : : BLANK ) {
Inventory : : EquipItem ( * equippedItem , slot ) ;
}
return true ;
} , [ ] ( MenuFuncData data ) {
for ( int counter = 0 ; ItemAttribute attribute : displayAttrs ) {
StatLabel * statDisplayLabel = Component < StatLabel > ( CHARACTER_MENU , " Attribute " + ItemAttributable : : GetDisplayInfo ( attribute ) . name + " Label " ) ;
statDisplayLabel - > SetStatChangeAmt ( 0 ) ;
counter + + ;
}
return true ;
} , " Item Name " , " Item Description " ) END ;
equip - > I ( Attribute : : EQUIP_TYPE ) = int ( slot ) ;
if ( Inventory : : GetEquip ( slot ) = = & itemInvRef ) {
equip - > SetSelected ( true ) ;
}
}
MenuItemItemButton * equipButton = Component < MenuItemItemButton > ( CHARACTER_MENU , " Equip Slot " + slotNames [ data . parentComponent - > I ( A : : INDEXED_THEME ) ] ) ;
equip - > SetCompactDescriptions ( false ) ;
equipButton - > SetItem ( comp - > GetItem ( ) ) ;
return true ;
counter + + ;
} , [ & ] ( MenuFuncData data ) {
MenuItemItemButton * button = ( MenuItemItemButton * ) data . component ;
Item & buttonItem = button - > GetItem ( ) ;
std : : vector < int > statsBeforeEquip ;
EquipSlot slot = EquipSlot ( button - > I ( Attribute : : EQUIP_TYPE ) ) ;
for ( ItemAttribute attribute : displayAttrs ) {
statsBeforeEquip . push_back ( game - > GetPlayer ( ) - > GetStat ( attribute ) ) ;
}
Item * equippedItem = Inventory : : GetEquip ( slot ) ;
Inventory : : EquipItem ( buttonItem , slot ) ;
for ( int counter = 0 ; ItemAttribute attribute : displayAttrs ) {
StatLabel * statDisplayLabel = Component < StatLabel > ( CHARACTER_MENU , " Attribute " + ItemAttributable : : GetDisplayInfo ( attribute ) . name + " Label " ) ;
int statChangeAmt = game - > GetPlayer ( ) - > GetStat ( attribute ) - statsBeforeEquip [ counter ] ;
statDisplayLabel - > SetStatChangeAmt ( statChangeAmt ) ;
counter + + ;
}
Inventory : : UnequipItem ( slot ) ;
if ( * equippedItem ! = Item : : BLANK ) {
Inventory : : EquipItem ( * equippedItem , slot ) ;
}
return true ;
} , [ ] ( MenuFuncData data ) {
for ( int counter = 0 ; ItemAttribute attribute : displayAttrs ) {
StatLabel * statDisplayLabel = Component < StatLabel > ( CHARACTER_MENU , " Attribute " + ItemAttributable : : GetDisplayInfo ( attribute ) . name + " Label " ) ;
statDisplayLabel - > SetStatChangeAmt ( 0 ) ;
counter + + ;
}
return true ;
} , " Item Name " , " Item Description " ) ;
equip - > I ( Attribute : : EQUIP_TYPE ) = int ( slot ) ;
if ( Inventory : : GetEquip ( slot ) = = & itemInvRef ) {
equip - > SetSelected ( true ) ;
}
}
equip - > SetCompactDescriptions ( false ) ;
equipList - > I ( Attribute : : INDEXED_THEME ) = data . component - > I ( Attribute : : INDEXED_THEME ) ;
equipList - > AddComponent ( Menu : : menus [ CHARACTER_MENU ] , " Equip Item " + std : : to_string ( counter ) , equip ) ;
Component < MenuComponent > ( data . component - > parentMenu , " Equip Selection Outline " ) - > Enable ( true ) ;
counter + + ;
equipList - > Enable ( true ) ;
}
Component < MenuComponent > ( data . component - > parentMenu , " Equip Selection Bottom Outline " ) - > Enable ( true ) ;
equipList - > I ( Attribute : : INDEXED_THEME ) = data . component - > I ( Attribute : : INDEXED_THEME ) ;
Component < MenuComponent > ( data . component - > parentMenu , " Equip Selection Select Button " ) - > Enable ( true ) ;
Component < MenuComponent > ( data . component - > parentMenu , " Equip Selection Outline " ) - > Enable ( true ) ;
equipList - > Enable ( true ) ;
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 ) ;
Component < CharacterRotatingDisplay > ( data . component - > parentMenu , " Character Rotating Display " ) - > Enable ( false ) ;
}
equipmentWindowOpened = true ;
return true ;
return true ;
} , [ ] ( MenuFuncData data ) { //On Mouse Out
} , [ ] ( MenuFuncData data ) { //On Mouse Hover
if ( Component < MenuLabel > ( data . component - > parentMenu , " Item Equip Description " ) - > GetLabel ( ) ! = " " & & ! equipmentWindowOpened ) {
if ( Component < MenuLabel > ( data . component - > parentMenu , " Item Equip Description " ) - > GetLabel ( ) ! = " " ) {
Component < CharacterRotatingDisplay > ( data . component - > parentMenu , " Character Rotating Display " ) - > Enable ( true ) ;
Component < CharacterRotatingDisplay > ( data . component - > parentMenu , " Character Rotating Display " ) - > Enable ( false ) ;
}
}
return true ;
return true ;
} , " Item Equip Name " , " Item Equip Description " ) ;
} , [ ] ( MenuFuncData data ) { //On Mouse Out
PopupMenuLabel * equipmentLabel = NEW PopupMenuLabel ( CHARACTER_MENU , { { labelX , labelY } , { 29 , 16 } } , slotNames [ i ] , { 0.5 , 1 } , ComponentAttr : : SHADOW ) ;
if ( Component < MenuLabel > ( data . component - > parentMenu , " Item Equip Description " ) - > GetLabel ( ) ! = " " & & ! equipmentWindowOpened ) {
Component < CharacterRotatingDisplay > ( data . component - > parentMenu , " Character Rotating Display " ) - > Enable ( true ) ;
}
return true ;
} , " Item Equip Name " , " Item Equip Description " ) END ;
equipmentSlot - > I ( Attribute : : EQUIP_TYPE ) = int ( slot ) ;
equipmentSlot - > I ( Attribute : : EQUIP_TYPE ) = int ( slot ) ;
equipmentSlot - > I ( Attribute : : INDEXED_THEME ) = i ;
equipmentSlot - > I ( Attribute : : INDEXED_THEME ) = i ;
equipmentSlot - > SetShowQuantity ( false ) ;
equipmentSlot - > SetShowQuantity ( false ) ;
equipmentSlot - > SetCompactDescriptions ( false ) ;
equipmentSlot - > SetCompactDescriptions ( false ) ;
equipSlot < < = 1 ;
equipSlot < < = 1 ;
characterMenuWindow - > AddComponent ( " Equip Slot " + slotNames [ i ] , equipmentSlot ) ;
characterMenuWindow - > ADD ( " Equip Label " + slotNames [ i ] , PopupMenuLabel ) ( { { labelX , labelY } , { 29 , 16 } } , slotNames [ i ] , { 0.5 , 1 } , ComponentAttr : : SHADOW ) END ;
characterMenuWindow - > AddComponent ( " Equip Label " + slotNames [ i ] , equipmentLabel ) ;
Menu : : AddEquipStatListener ( equipmentSlot ) ;
Menu : : AddEquipStatListener ( equipmentSlot ) ;
}
}
MenuComponent * statDisplayOutline = NEW MenuComponent ( CHARACTER_MENU , { { 245 , 28 } , { 62 , windowSize . y - 37 } } , " " , DO_NOTHING , ButtonAttr : : UNSELECTABLE ) ;
characterMenuWindow - > ADD ( " Stat Display Outline " , MenuComponent ) ( { { 245 , 28 } , { 62 , windowSize . y - 37 } } , " " , DO_NOTHING , ButtonAttr : : UNSELECTABLE ) END ;
characterMenuWindow - > AddComponent ( " Stat Display Outline " , statDisplayOutline ) ;
int yOffset = 0 ;
int yOffset = 0 ;
for ( ItemAttribute attribute : displayAttrs ) {
for ( ItemAttribute attribute : displayAttrs ) {
std : : string attrStr = GetLabelText ( attribute ) ;
std : : string attrStr = GetLabelText ( attribute ) ;
StatLabel * attrLabel = NEW StatLabel ( CHARACTER_MENU , { { 245 , 28 + 2 + float ( yOffset ) } , { 62 , 18 } } , attribute , 1 , ComponentAttr : : SHADOW | ComponentAttr : : LEFT_ALIGN ) ;
yOffset + = 20 ;
AttributeData data = ItemAttributable : : GetDisplayInfo ( attribute ) ;
AttributeData data = ItemAttributable : : GetDisplayInfo ( attribute ) ;
characterMenuWindow - > AddComponent ( " Attribute " + data . name + " Label " , attrLabel ) ;
auto attrLabel = characterMenuWindow - > ADD ( " Attribute " + data . name + " Label " , StatLabel ) ( { { 245 , 28 + 2 + float ( yOffset ) } , { 62 , 18 } } , attribute , 1 , ComponentAttr : : SHADOW | ComponentAttr : : LEFT_ALIGN ) END ;
Menu : : AddEquipStatListener ( attrLabel ) ;
Menu : : AddEquipStatListener ( attrLabel ) ;
yOffset + = 20 ;
}
}
MenuComponent * backButton = NEW MenuComponent ( CHARACTER_MENU , { { windowSize . x / 2 - 64 , windowSize . y } , { 128 , 12 } } , " Back " , [ ] ( MenuFuncData data ) { Menu : : stack . pop_back ( ) ; return true ; } ) ;
characterMenuWindow - > ADD ( " Back button " , MenuComponent ) ( { { windowSize . x / 2 - 64 , windowSize . y } , { 128 , 12 } } , " Back " , [ ] ( MenuFuncData data ) { Menu : : stack . pop_back ( ) ; return true ; } ) END
backButton - > decal = true ;
- > decal = true ;
characterMenuWindow - > AddComponent ( " Back button " , backButton ) ;
MenuLabel * itemNameDisplay = NEW MenuLabel ( CHARACTER_MENU , { { 0 , 28 } , { 120 , 12 } } , " " , 1 , ComponentAttr : : BACKGROUND | ComponentAttr : : LEFT_ALIGN | ComponentAttr : : OUTLINE | ComponentAttr : : SHADOW ) ;
auto itemNameDisplay = characterMenuWindow - > ADD ( " Item Name " , MenuLabel ) ( { { 0 , 28 } , { 120 , 12 } } , " " , 1 , ComponentAttr : : BACKGROUND | ComponentAttr : : LEFT_ALIGN | ComponentAttr : : OUTLINE | ComponentAttr : : SHADOW ) END ;
MenuLabel * itemDescriptionDisplay = NEW MenuLabel ( CHARACTER_MENU , { { 0 , 40 } , { 120 , windowSize . y - 49 } } , " " , 1 , ComponentAttr : : BACKGROUND | ComponentAttr : : LEFT_ALIGN | ComponentAttr : : OUTLINE | ComponentAttr : : SHADOW ) ;
auto itemDescriptionDisplay = characterMenuWindow - > ADD ( " Item Description " , MenuLabel ) ( { { 0 , 40 } , { 120 , windowSize . y - 49 } } , " " , 1 , ComponentAttr : : BACKGROUND | ComponentAttr : : LEFT_ALIGN | ComponentAttr : : OUTLINE | ComponentAttr : : SHADOW ) END ;
characterMenuWindow - > ADD ( " Item Equip Name " , MenuLabel ) ( { { 123 , 28 } , { 120 , 12 } } , " " , 1 , ComponentAttr : : BACKGROUND | ComponentAttr : : LEFT_ALIGN | ComponentAttr : : OUTLINE | ComponentAttr : : SHADOW ) END ;
itemNameDisplay - > decal = true ;
characterMenuWindow - > ADD ( " Item Equip Description " , MenuLabel ) ( { { 123 , 40 } , { 120 , windowSize . y - 49 } } , " " , 1 , ComponentAttr : : BACKGROUND | ComponentAttr : : LEFT_ALIGN | ComponentAttr : : OUTLINE | ComponentAttr : : SHADOW ) END ;
itemDescriptionDisplay - > decal = true ;
itemNameDisplay - > decal = itemDescriptionDisplay - > decal = true ;
itemNameDisplay - > Enable ( false ) ;
itemNameDisplay - > Enable ( false ) ;
itemDescriptionDisplay - > 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 ) ;
}
}