|
@@ -13,13 +13,12 @@
|
|
|
#include "table/sprites.h"
|
|
|
#include "newgrf.h"
|
|
|
#include "newgrf_config.h"
|
|
|
#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
|
|
|
* @param items pointer to the integerlist-array that will be filled with values
|
|
|
* @param maxitems the maximum number of elements the integerlist-array has
|
|
|
* @return returns the number of items found, or -1 on an error */
|
|
@@ -125,13 +124,13 @@ static void NewGRFAddDlgWndProc(Window *
|
|
|
/* Count the number of GRFs */
|
|
|
for (c = _all_grfs; c != NULL; c = c->next) n++;
|
|
|
|
|
|
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);
|
|
|
|
|
|
n = 0;
|
|
|
y = w->widget[3].top + 1;
|
|
@@ -280,12 +279,13 @@ static void SetupNewGRFState(Window *w)
|
|
|
SetWindowWidgetDisabledState(w, SNGRFS_SET_PARAMETERS, !WP(w, newgrf_d).show_params || disable_all);
|
|
|
|
|
|
if (!disable_all) {
|
|
|
/* 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);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
static void SetupNewGRFWindow(Window *w)
|
|
|
{
|