summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-07-07 21:52:08 +0000
committerfrosch <frosch@openttd.org>2011-07-07 21:52:08 +0000
commita6ce6c144b77e24a4555e5ecb6f6fcbddd1c70d5 (patch)
tree454cab966b6d7e733af8d12406da1bc6ac08538a
parent566a9612a0245dca9264f8b4c9d4f76c543e16c4 (diff)
downloadopenttd-a6ce6c144b77e24a4555e5ecb6f6fcbddd1c70d5.tar.xz
(svn r22642) -Change: Disable the 'set parameters' button in the NewGRF GUI, if the GRF specifies to have no parameters and one would not be able to set any parameters anyway.
-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 8fcb1c0e4..1623e271e 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -943,7 +943,7 @@ struct NewGRFWindow : public QueryStringBaseWindow {
break;
case SNGRFS_SET_PARAMETERS: { // Edit parameters
- if (this->active_sel == NULL || !this->editable || !this->show_params) break;
+ if (this->active_sel == NULL || !this->editable || !this->show_params || this->active_sel->num_valid_params == 0) break;
OpenGRFParameterWindow(this->active_sel);
break;
@@ -1098,7 +1098,7 @@ struct NewGRFWindow : public QueryStringBaseWindow {
SNGRFS_MOVE_DOWN,
WIDGET_LIST_END
);
- this->SetWidgetDisabledState(SNGRFS_SET_PARAMETERS, !this->show_params || disable_all);
+ this->SetWidgetDisabledState(SNGRFS_SET_PARAMETERS, !this->show_params || disable_all || this->active_sel->num_valid_params == 0);
this->SetWidgetDisabledState(SNGRFS_TOGGLE_PALETTE, disable_all);
if (!disable_all) {