summaryrefslogtreecommitdiff
path: root/src/newgrf_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-11-15 07:42:25 +0000
committerrubidium <rubidium@openttd.org>2007-11-15 07:42:25 +0000
commitf546de602b9c59c3fbaaea8fac5f008ed0443fea (patch)
tree16f3e2ff6c7d1a27f793c7fea834b2625afd09ab /src/newgrf_gui.cpp
parentf28723830fc92c4ef2235739a1dd85d686235211 (diff)
downloadopenttd-f546de602b9c59c3fbaaea8fac5f008ed0443fea.tar.xz
(svn r11433) -Fix: starting OpenTTD with DOS files made it look weird out of the box.
-Change: make extra sprites (the ones not in the TTD GRFs) replaceable using Action 5. -Feature: make replacing contiguous subsets of sprites in for some types possible in Action 5. Note to GRF authors: when you replaced OpenTTD sprites that are not from the TTD GRF files using Action A, your GRF will not have the intended result anymore as the sprite numbers have changed. You should replace the Action A with an Action 5 from now on.
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r--src/newgrf_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 17e80656f..aa4e308a7 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -16,7 +16,6 @@
#include "strings.h"
#include "helpers.hpp"
-
/** Parse an integerlist string and set each found value
* @param p the string to be parsed. Each element in the list is seperated by a
* comma or a space character
@@ -128,7 +127,7 @@ static void NewGRFAddDlgWndProc(Window *w, WindowEvent *e)
w->vscroll.cap = (w->widget[3].bottom - w->widget[3].top) / 10;
SetVScrollCount(w, n);
- SetWindowWidgetDisabledState(w, 6, WP(w, newgrf_add_d).sel == NULL);
+ SetWindowWidgetDisabledState(w, 6, WP(w, newgrf_add_d).sel == NULL || WP(w, newgrf_add_d).sel->IsOpenTTDBaseGRF());
DrawWindowWidgets(w);
GfxFillRect(w->widget[3].left + 1, w->widget[3].top + 1, w->widget[3].right, w->widget[3].bottom, 0xD7);
@@ -283,6 +282,7 @@ static void SetupNewGRFState(Window *w)
/* All widgets are now enabled, so disable widgets we can't use */
if (WP(w, newgrf_d).sel == *WP(w, newgrf_d).list) DisableWindowWidget(w, SNGRFS_MOVE_UP);
if (WP(w, newgrf_d).sel->next == NULL) DisableWindowWidget(w, SNGRFS_MOVE_DOWN);
+ if (WP(w, newgrf_d).sel->IsOpenTTDBaseGRF()) DisableWindowWidget(w, SNGRFS_REMOVE);
}
}