From 37e00dbef2e4efa25dd9ddb4ca227f4fffde924f Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 17 Sep 2006 20:52:54 +0000 Subject: (svn r6474) - Add a patch option to control display of liveries, allowing none, your own, or all companies. --- lang/english.txt | 4 ++++ settings.c | 1 + settings_gui.c | 1 + variables.h | 1 + vehicle.c | 2 +- 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lang/english.txt b/lang/english.txt index 467fc8523..0c21c9fa5 100644 --- a/lang/english.txt +++ b/lang/english.txt @@ -1070,6 +1070,10 @@ STR_CONFIG_PATCHES_STATION_SPREAD :{LTBLUE}Max sta STR_CONFIG_PATCHES_SERVICEATHELIPAD :{LTBLUE}Service helicopters at helipads automatically: {ORANGE}{STRING1} STR_CONFIG_PATCHES_LINK_TERRAFORM_TOOLBAR :{LTBLUE}Link landscape toolbar to rail/road/water/airport toolbars: {ORANGE}{STRING1} STR_CONFIG_PATCHES_REVERSE_SCROLLING :{LTBLUE}Reverse scroll direction: {ORANGE}{STRING1} +STR_CONFIG_PATCHES_LIVERIES :{LTBLUE}Show company liveries: {ORANGE}{STRING1} +STR_CONFIG_PATCHES_LIVERIES_NONE :None +STR_CONFIG_PATCHES_LIVERIES_OWN :Own company +STR_CONFIG_PATCHES_LIVERIES_ALL :All companies STR_CONFIG_PATCHES_MAX_TRAINS :{LTBLUE}Max trains per player: {ORANGE}{STRING1} STR_CONFIG_PATCHES_MAX_ROADVEH :{LTBLUE}Max road vehicles per player: {ORANGE}{STRING1} diff --git a/settings.c b/settings.c index 57a65821f..98dd32036 100644 --- a/settings.c +++ b/settings.c @@ -1261,6 +1261,7 @@ const SettingDesc _patch_settings[] = { SDT_VAR(Patches, map_x, SLE_UINT8, S, 0, 8, 6, 11, 0, STR_CONFIG_PATCHES_MAP_X, NULL), SDT_VAR(Patches, map_y, SLE_UINT8, S, 0, 8, 6, 11, 0, STR_CONFIG_PATCHES_MAP_Y, NULL), SDT_BOOL(Patches, link_terraform_toolbar, S, 0, false, STR_CONFIG_PATCHES_LINK_TERRAFORM_TOOLBAR,NULL), + SDT_VAR(Patches, liveries, SLE_UINT8, S,MS, 2, 0, 2, 0, STR_CONFIG_PATCHES_LIVERIES, RedrawScreen), /***************************************************************************/ /* Construction section of the GUI-configure patches window */ diff --git a/settings_gui.c b/settings_gui.c index eabe26899..15db71374 100644 --- a/settings_gui.c +++ b/settings_gui.c @@ -570,6 +570,7 @@ static const char *_patches_ui[] = { "population_in_label", "link_terraform_toolbar", "progress_update_interval", + "liveries", }; static const char *_patches_construction[] = { diff --git a/variables.h b/variables.h index 209bf134b..b7a1071cd 100644 --- a/variables.h +++ b/variables.h @@ -126,6 +126,7 @@ typedef struct Patches { bool no_servicing_if_no_breakdowns; // dont send vehicles to depot when breakdowns are disabled bool link_terraform_toolbar; // display terraform toolbar when displaying rail, road, water and airport toolbars bool reverse_scroll; // Right-Click-Scrolling scrolls in the opposite direction + byte liveries; // Options for displaying company liveries, 0=none, 1=self, 2=all uint8 toolbar_pos; // position of toolbars, 0=left, 1=center, 2=right uint8 window_snap_radius; // Windows snap at each other if closer than this diff --git a/vehicle.c b/vehicle.c index 7081c5fc5..8633a6cea 100644 --- a/vehicle.c +++ b/vehicle.c @@ -2313,7 +2313,7 @@ static PalSpriteID GetEngineColourMap(EngineID engine_type, PlayerID player, Eng /* The default livery is always available for use, but its in_use flag determines * whether any _other_ liveries are in use. */ - if (p->livery[LS_DEFAULT].in_use) { + if (p->livery[LS_DEFAULT].in_use && (_patches.liveries == 2 || (_patches.liveries == 1 && player == _local_player))) { /* Determine the livery scheme to use */ switch (GetEngine(engine_type)->type) { case VEH_Train: { -- cgit v1.2.3-70-g09d2