From 13331cc67dbb97146a30ecaec5bb7ae273994f65 Mon Sep 17 00:00:00 2001 From: Lorenc Pekaj Date: Fri, 9 Nov 2018 15:28:35 +1100 Subject: [PATCH] fix styling with vd dialog --- .../irresistible/cnr/features/gangs/gvehicles.pwn | 6 +++--- .../cnr/features/vehicles/vdealership.pwn | 12 ++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/gamemodes/irresistible/cnr/features/gangs/gvehicles.pwn b/gamemodes/irresistible/cnr/features/gangs/gvehicles.pwn index f3c92d0..f651388 100644 --- a/gamemodes/irresistible/cnr/features/gangs/gvehicles.pwn +++ b/gamemodes/irresistible/cnr/features/gangs/gvehicles.pwn @@ -643,12 +643,12 @@ static stock GangVehicles_ShowBuyableList( playerid, type_id ) static buyable_vehicles[ 1400 ], i; - for ( i = 0, buyable_vehicles[ 0 ] = '\0'; i < sizeof( g_BuyableVehicleData ); i ++ ) if ( g_BuyableVehicleData[ i ] [ E_TYPE ] == type_id ) { - format( buyable_vehicles, sizeof( buyable_vehicles ), "%s"COL_GOLD"%s%s%s\t%s\n", buyable_vehicles, cash_format( g_BuyableVehicleData[ i ] [ E_PRICE ] * GANG_VEHICLE_PRICE_FACTOR ), g_BuyableVehicleData[ i ] [ E_VIP ] ? ( "" ) : ( #COL_WHITE ), g_BuyableVehicleData[ i ] [ E_PRICE ] < 100000 ? ( "\t" ) : ( "" ), g_BuyableVehicleData[ i ] [ E_NAME ] ); + for ( i = 0, buyable_vehicles = ""COL_WHITE"Vehicle\t"COL_WHITE"Price ($)\n"; i < sizeof( g_BuyableVehicleData ); i ++ ) if ( g_BuyableVehicleData[ i ] [ E_TYPE ] == type_id ) { + format( buyable_vehicles, sizeof( buyable_vehicles ), "%s%s%s\t"COL_GREEN"%s\n", buyable_vehicles, g_BuyableVehicleData[ i ] [ E_VIP ] ? ( COL_GOLD ) : ( COL_WHITE ), g_BuyableVehicleData[ i ] [ E_NAME ], cash_format( g_BuyableVehicleData[ i ] [ E_PRICE ] * GANG_VEHICLE_PRICE_FACTOR ) ); } SetPVarInt( playerid, "vehicle_preview", type_id ); - return ShowPlayerDialog( playerid, DIALOG_GANG_VD_BUY, DIALOG_STYLE_LIST, "{FFFFFF}Vehicle Dealership", buyable_vehicles, "Select", "Back" ); + return ShowPlayerDialog( playerid, DIALOG_GANG_VD_BUY, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Vehicle Dealership", buyable_vehicles, "Select", "Back" ); } stock GetGangVehicleData( vehicleid, &gangid, &slotid ) { diff --git a/gamemodes/irresistible/cnr/features/vehicles/vdealership.pwn b/gamemodes/irresistible/cnr/features/vehicles/vdealership.pwn index 1d9c6b3..1d73cce 100644 --- a/gamemodes/irresistible/cnr/features/vehicles/vdealership.pwn +++ b/gamemodes/irresistible/cnr/features/vehicles/vdealership.pwn @@ -413,17 +413,13 @@ stock ShowBuyableVehiclesList( playerid, dialogid = DIALOG_VEHDEALER, secondary_ stock ShowBuyableVehiclesTypeDialog( playerid, type_id ) { static - szBuyableVehicles[ 1400 ]; + buyable_vehicles[ 1400 ], i; - erase( szBuyableVehicles ); - - for( new i; i < sizeof( g_BuyableVehicleData ); i++ ) - { - if ( g_BuyableVehicleData[ i ] [ E_TYPE ] == type_id ) - format( szBuyableVehicles, sizeof( szBuyableVehicles ), "%s"COL_GOLD"%s%s%s\t%s\n", szBuyableVehicles, cash_format( g_BuyableVehicleData[ i ] [ E_PRICE ] ), g_BuyableVehicleData[ i ] [ E_VIP ] ? ( "" ) : ( #COL_WHITE ), g_BuyableVehicleData[ i ] [ E_PRICE ] < 100000 ? ( "\t" ) : ( "" ), g_BuyableVehicleData[ i ] [ E_NAME ] ); + for ( i = 0, buyable_vehicles = ""COL_WHITE"Vehicle\t"COL_WHITE"Price ($)\n"; i < sizeof( g_BuyableVehicleData ); i ++ ) if ( g_BuyableVehicleData[ i ] [ E_TYPE ] == type_id ) { + format( buyable_vehicles, sizeof( buyable_vehicles ), "%s%s%s\t"COL_GREEN"%s\n", buyable_vehicles, g_BuyableVehicleData[ i ] [ E_VIP ] ? ( COL_GOLD ) : ( COL_WHITE ), g_BuyableVehicleData[ i ] [ E_NAME ], cash_format( g_BuyableVehicleData[ i ] [ E_PRICE ] ) ); } - ShowPlayerDialog( playerid, DIALOG_VEHDEALER_BUY, DIALOG_STYLE_LIST, "{FFFFFF}Vehicle Dealership", szBuyableVehicles, "Options", "Cancel" ); + ShowPlayerDialog( playerid, DIALOG_VEHDEALER_BUY, DIALOG_STYLE_TABLIST_HEADERS, "{FFFFFF}Vehicle Dealership", buyable_vehicles, "Options", "Cancel" ); SetPVarInt( playerid, "vehicle_preview", type_id ); return 1; }