@ -1585,14 +1585,9 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
}
}
if ( ACTIONKEYPRESSED ) {
GAME_STATE = GameState : : OVERWORLD_EQUIP_ITEM_MENU ;
EQUIP_ITEM_MENU_CONTENTS . clear ( ) ;
EQUIP_ITEM_MENU_OFFSET = 0 ;
EQUIP_ITEM_MENU_CURSOR = 0 ;
for ( int i = 0 ; i < PARTY_INVENTORY . size ( ) ; i + + ) {
if ( PARTY_INVENTORY [ i ] - > stats . equip = = EQUIP_MENU_SLOT ) {
EQUIP_ITEM_MENU_CONTENTS . push_back ( i ) ;
}
PopulateEquipMenuItems ( ) ;
if ( EQUIP_ITEM_MENU_CONTENTS . size ( ) > 0 ) {
GAME_STATE = GameState : : OVERWORLD_EQUIP_ITEM_MENU ;
}
}
} break ;
@ -1627,6 +1622,20 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
if ( LeftPressed ( ) ) {
GAME_STATE = GameState : : OVERWORLD_EQUIP_MENU ;
}
if ( ACTIONKEYPRESSED ) {
if ( EQUIP_ITEM_MENU_CONTENTS [ EQUIP_ITEM_MENU_CURSOR ] = = - 1 ) {
PARTY_MEMBER_STATS [ PARTY_MEMBER_ID [ OVERWORLD_POWER_SELECTION_MEMBER ] ] - > RemoveEquip ( EQUIP_MENU_SLOT ) ;
} else {
PARTY_MEMBER_STATS [ PARTY_MEMBER_ID [ OVERWORLD_POWER_SELECTION_MEMBER ] ] - > EquipItem ( EQUIP_ITEM_MENU_CONTENTS [ EQUIP_ITEM_MENU_CURSOR ] ) ;
}
if ( EQUIP_ITEM_MENU_CURSOR > = EQUIP_ITEM_MENU_CONTENTS . size ( ) ) {
EQUIP_ITEM_MENU_CURSOR - - ;
}
if ( EQUIP_ITEM_MENU_OFFSET > EQUIP_ITEM_MENU_CURSOR ) {
EQUIP_ITEM_MENU_OFFSET = EQUIP_ITEM_MENU_CURSOR ;
}
PopulateEquipMenuItems ( ) ;
}
} break ;
}
ANYKEYPRESSED = ACTIONKEYPRESSED = false ;
@ -1793,7 +1802,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
DrawDecal ( { 8 , ( float ) ( 12 + ( EQUIP_ITEM_MENU_CURSOR - EQUIP_ITEM_MENU_OFFSET ) * 12 ) } , SPRITES [ " cursor.png " ] ) ;
for ( int i = 0 ; i < 8 ; i + + ) {
if ( EQUIP_ITEM_MENU_OFFSET + i < EQUIP_ITEM_MENU_CONTENTS . size ( ) ) {
DrawStringPropDecal ( { 16 , ( float ) ( 12 + i * 12 ) } , PARTY_INVENTORY [ EQUIP_ITEM_MENU_CONTENTS [ i + EQUIP_ITEM_MENU_OFFSET ] ] - > name ) ;
DrawStringPropDecal ( { 16 , ( float ) ( 12 + i * 12 ) } , EQUIP_ITEM_MENU_CONTENTS [ i + EQUIP_ITEM_MENU_OFFSET ] = = - 1 ? " Unequip " : PARTY_INVENTORY [ EQUIP_ITEM_MENU_CONTENTS [ i + EQUIP_ITEM_MENU_OFFSET ] ] - > name ) ;
}
}
if ( EQUIP_ITEM_MENU_OFFSET > 0 ) {
@ -4394,6 +4403,20 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
}
return false ;
}
void PopulateEquipMenuItems ( ) {
EQUIP_ITEM_MENU_CONTENTS . clear ( ) ;
EQUIP_ITEM_MENU_OFFSET = 0 ;
EQUIP_ITEM_MENU_CURSOR = 0 ;
for ( int i = 0 ; i < PARTY_INVENTORY . size ( ) ; i + + ) {
if ( PARTY_INVENTORY [ i ] - > stats . equip = = EQUIP_MENU_SLOT ) {
EQUIP_ITEM_MENU_CONTENTS . push_back ( i ) ;
}
}
if ( PARTY_MEMBER_STATS [ PARTY_MEMBER_ID [ OVERWORLD_POWER_SELECTION_MEMBER ] ] - > equipment [ EQUIP_MENU_SLOT ] ! = nullptr ) {
EQUIP_ITEM_MENU_CONTENTS . push_back ( - 1 ) ;
}
}
} ;
int main ( )