From 4f253c2656fe04a97cbd3fabaab98798cc514456 Mon Sep 17 00:00:00 2001 From: dominik Date: Fri, 20 Aug 2004 15:30:32 +0000 Subject: (svn r92) Feature: invisible trees when in transparent mode (patch entry) --- lang/english.txt | 1 + settings.c | 1 + settings_gui.c | 7 +++++++ tree_cmd.c | 1 + variables.h | 1 + 5 files changed, 11 insertions(+) diff --git a/lang/english.txt b/lang/english.txt index e5f3fdfe3..417e44c15 100644 --- a/lang/english.txt +++ b/lang/english.txt @@ -977,6 +977,7 @@ STR_CONFIG_PATCHES_AUTORENEW_VEHICLE :{LTBLUE}Autorenew vehicle when it gets o STR_CONFIG_PATCHES_AUTORENEW_MONTHS :{LTBLUE}Autorenew when vehice is {ORANGE}{STRING}{LTBLUE} months before/after max age STR_CONFIG_PATCHES_AUTORENEW_MONEY :{LTBLUE}Autorenew minimum needed money for renew: {ORANGE}{STRING} STR_CONFIG_PATCHES_ERRMSG_DURATION :{LTBLUE}Duration of error message: {ORANGE}{STRING} +STR_CONFIG_PATCHES_INVISIBLE_TREES :{LTBLUE}Invisible trees (with transparent buildings): {ORANGE}{STRING} STR_CONFIG_PATCHES_SNOWLINE_HEIGHT :{LTBLUE}Snow line height: {ORANGE}{STRING} STR_CONFIG_PATCHES_STATION_SPREAD :{LTBLUE}Max station spread: {ORANGE}{STRING} STR_CONFIG_PATCHES_SERVICEATHELIPAD :{LTBLUE}Service helicopters at helipads automatically: {ORANGE}{STRING} diff --git a/settings.c b/settings.c index d281c37cb..134153672 100644 --- a/settings.c +++ b/settings.c @@ -858,6 +858,7 @@ static const SettingDesc patch_settings[] = { {"colored_news_date", SDT_UINT32, (void*)2000, (void*)offsetof(Patches, colored_news_date)}, {"bridge_pillars", SDT_BOOL, (void*)true, (void*)offsetof(Patches, bridge_pillars)}, + {"invisible_trees", SDT_BOOL, (void*)false, (void*)offsetof(Patches, invisible_trees)}, {"keep_all_autosave", SDT_BOOL, (void*)false, (void*)offsetof(Patches, keep_all_autosave)}, diff --git a/settings_gui.c b/settings_gui.c index e8334808c..d4718f381 100644 --- a/settings_gui.c +++ b/settings_gui.c @@ -678,6 +678,12 @@ int32 AiNew_PatchActive_Warning(int32 p1) return 0; } +int32 InvisibleTreesActive(int32 p1) +{ + MarkWholeScreenDirty(); + return 0; +} + typedef int32 PatchButtonClick(int32); static PatchButtonClick * const _patch_button_proc[] = { &v_PositionMainToolbar, @@ -715,6 +721,7 @@ static const PatchEntry _patches_ui[] = { {PE_UINT8, 0, STR_CONFIG_PATCHES_ERRMSG_DURATION, &_patches.errmsg_duration, 0, 20, 1}, {PE_UINT8, PF_MULTISTRING, STR_CONFIG_PATCHES_TOOLBAR_POS, &_patches.toolbar_pos, 0, 2, 1, &v_PositionMainToolbar}, + {PE_BOOL, 0, STR_CONFIG_PATCHES_INVISIBLE_TREES, &_patches.invisible_trees, 0, 1, 1, &InvisibleTreesActive}, }; static const PatchEntry _patches_construction[] = { diff --git a/tree_cmd.c b/tree_cmd.c index 62761a472..dd574b548 100644 --- a/tree_cmd.c +++ b/tree_cmd.c @@ -287,6 +287,7 @@ static void DrawTile_Trees(TileInfo *ti) StartSpriteCombine(); + if((_display_opt & DO_TRANS_BUILDINGS) || !_patches.invisible_trees) { int i; diff --git a/variables.h b/variables.h index 2073979e9..9e8f09484 100644 --- a/variables.h +++ b/variables.h @@ -109,6 +109,7 @@ typedef struct Patches { bool nonuniform_stations;// allow nonuniform train stations bool always_small_airport; // always allow small airports bool realistic_acceleration; // realistic acceleration for trains + bool invisible_trees; // don't show trees when buildings are transparent uint8 toolbar_pos; // position of toolbars, 0=left, 1=center, 2=right -- cgit v1.2.3-70-g09d2