summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2008-01-30 03:34:24 +0000
committerbelugas <belugas@openttd.org>2008-01-30 03:34:24 +0000
commit94aa04948c35a08fadc26a1213440f83fc1f6825 (patch)
treeb25be0c2b78e4856dbb24ee6a70e415d68810b85 /src
parent44f4ebffed894f9dee57747da1ad177bc5e96171 (diff)
downloadopenttd-94aa04948c35a08fadc26a1213440f83fc1f6825.tar.xz
(svn r12018) -Fix(FS#1721,r9563): Restore initial intent on the invisible tree while transparent building patch setting
Diffstat (limited to 'src')
-rw-r--r--src/main_gui.cpp5
-rw-r--r--src/transparency_gui.cpp6
-rw-r--r--src/tree_cmd.cpp3
3 files changed, 9 insertions, 5 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index 1e9f327ec..c5a4ac5b6 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -176,10 +176,7 @@ static void MenuClickSettings(int index)
case 9: ToggleBit(_display_opt, DO_WAYPOINTS); break;
case 10: ToggleBit(_display_opt, DO_FULL_ANIMATION); break;
case 11: ToggleBit(_display_opt, DO_FULL_DETAIL); break;
- case 12:
- ToggleTransparency(TO_TREES);
- ToggleTransparency(TO_HOUSES);
- break;
+ case 12: ToggleTransparency(TO_HOUSES); break;
case 13: ToggleTransparency(TO_SIGNS); break;
}
MarkWholeScreenDirty();
diff --git a/src/transparency_gui.cpp b/src/transparency_gui.cpp
index f09d73c3a..df214e81d 100644
--- a/src/transparency_gui.cpp
+++ b/src/transparency_gui.cpp
@@ -7,6 +7,7 @@
#include "variables.h"
#include "transparency.h"
#include "sound_func.h"
+#include "settings_type.h"
#include "table/sprites.h"
#include "table/strings.h"
@@ -37,6 +38,11 @@ static void TransparencyToolbWndProc(Window *w, WindowEvent *e)
for (uint i = TTW_WIDGET_SIGNS; i < TTW_WIDGET_END; i++) {
w->SetWidgetLoweredState(i, IsTransparencySet((TransparencyOption)(i - TTW_WIDGET_SIGNS)));
}
+
+ /* Disabling the trees button allows to make it very evident that it has no effect
+ * upon current situation */
+ w->SetWidgetDisabledState(TTW_WIDGET_TREES, _patches.invisible_trees && IsTransparencySet(TO_HOUSES));
+
DrawWindowWidgets(w);
break;
diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp
index 6a9526958..7fc9c133c 100644
--- a/src/tree_cmd.cpp
+++ b/src/tree_cmd.cpp
@@ -428,7 +428,8 @@ static void DrawTile_Trees(TileInfo *ti)
StartSpriteCombine();
- if (!(IsTransparencySet(TO_TREES) && _patches.invisible_trees)) {
+ /* Do not draw trees when buildings are transparent and when the invisile trees patch is on */
+ if (!(_patches.invisible_trees && IsTransparencySet(TO_HOUSES))) {
TreeListEnt te[4];
uint i;