Changeset - r18403:c5ec10907d18
[Not reviewed]
master
0 4 0
frosch - 13 years ago 2011-11-18 14:40:57
frosch@openttd.org
(svn r23249) -Feature: Also allow viewing of the other two textfiles supplied by BaNaNaS tars, i.e. changelog and license.
4 files changed with 58 insertions and 19 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -2399,25 +2399,29 @@ STR_NEWGRF_SETTINGS_PRESET_DELETE       
 
STR_NEWGRF_SETTINGS_PRESET_DELETE_TOOLTIP                       :{BLACK}Delete the currently selected preset
 
STR_NEWGRF_SETTINGS_ADD                                         :{BLACK}Add
 
STR_NEWGRF_SETTINGS_ADD_FILE_TOOLTIP                            :{BLACK}Add the selected NewGRF file to your configuration
 
STR_NEWGRF_SETTINGS_RESCAN_FILES                                :{BLACK}Rescan files
 
STR_NEWGRF_SETTINGS_RESCAN_FILES_TOOLTIP                        :{BLACK}Update the list of available NewGRF files
 
STR_NEWGRF_SETTINGS_REMOVE                                      :{BLACK}Remove
 
STR_NEWGRF_SETTINGS_REMOVE_TOOLTIP                              :{BLACK}Remove the selected NewGRF file from the list
 
STR_NEWGRF_SETTINGS_MOVEUP                                      :{BLACK}Move Up
 
STR_NEWGRF_SETTINGS_MOVEUP_TOOLTIP                              :{BLACK}Move the selected NewGRF file up the list
 
STR_NEWGRF_SETTINGS_MOVEDOWN                                    :{BLACK}Move Down
 
STR_NEWGRF_SETTINGS_MOVEDOWN_TOOLTIP                            :{BLACK}Move the selected NewGRF file down the list
 
STR_NEWGRF_SETTINGS_FILE_TOOLTIP                                :{BLACK}A list of the NewGRF files that are installed.
 

	
 
# Additional textfiles accompanying NewGRFs
 
STR_NEWGRF_SETTINGS_VIEW_README                                 :{BLACK}View readme
 
STR_NEWGRF_SETTINGS_VIEW_CHANGELOG                              :{BLACK}Changelog
 
STR_NEWGRF_SETTINGS_VIEW_LICENSE                                :{BLACK}License
 

	
 
STR_NEWGRF_SETTINGS_SET_PARAMETERS                              :{BLACK}Set parameters
 
STR_NEWGRF_SETTINGS_TOGGLE_PALETTE                              :{BLACK}Toggle palette
 
STR_NEWGRF_SETTINGS_TOGGLE_PALETTE_TOOLTIP                      :{BLACK}Toggle the palette of the selected NewGRF.{}Do this when the graphics from this NewGRF look pink in-game
 
STR_NEWGRF_SETTINGS_APPLY_CHANGES                               :{BLACK}Apply changes
 

	
 
STR_NEWGRF_SETTINGS_FIND_MISSING_CONTENT_BUTTON                 :{BLACK}Find missing content online
 
STR_NEWGRF_SETTINGS_FIND_MISSING_CONTENT_TOOLTIP                :{BLACK}Check whether the missing content can be found online
 

	
 
STR_NEWGRF_SETTINGS_FILENAME                                    :{BLACK}Filename: {SILVER}{RAW_STRING}
 
STR_NEWGRF_SETTINGS_GRF_ID                                      :{BLACK}GRF ID: {SILVER}{RAW_STRING}
 
STR_NEWGRF_SETTINGS_VERSION                                     :{BLACK}Version: {SILVER}{NUM}
 
@@ -2433,24 +2437,26 @@ STR_NEWGRF_SETTINGS_INCOMPATIBLE        
 

	
 
# NewGRF parameters window
 
STR_NEWGRF_PARAMETERS_CAPTION                                   :{WHITE}Change NewGRF parameters
 
STR_NEWGRF_PARAMETERS_CLOSE                                     :{BLACK}Close
 
STR_NEWGRF_PARAMETERS_RESET                                     :{BLACK}Reset
 
STR_NEWGRF_PARAMETERS_RESET_TOOLTIP                             :{BLACK}Set all parameters to their default value
 
STR_NEWGRF_PARAMETERS_DEFAULT_NAME                              :Parameter {NUM}
 
STR_NEWGRF_PARAMETERS_SETTING                                   :{STRING1}: {ORANGE}{STRING1}
 
STR_NEWGRF_PARAMETERS_NUM_PARAM                                 :{LTBLUE}Number of parameters: {ORANGE}{NUM}
 

	
 
# NewGRF textfile window
 
STR_NEWGRF_README_CAPTION                                       :{WHITE}NewGRF readme of {RAW_STRING}
 
STR_NEWGRF_CHANGELOG_CAPTION                                    :{WHITE}NewGRF changelog of {RAW_STRING}
 
STR_NEWGRF_LICENSE_CAPTION                                      :{WHITE}NewGRF license of {RAW_STRING}
 

	
 
# NewGRF inspect window
 
STR_NEWGRF_INSPECT_CAPTION                                      :{WHITE}Inspect - {STRING5}
 
STR_NEWGRF_INSPECT_PARENT_BUTTON                                :{BLACK}Parent
 
STR_NEWGRF_INSPECT_PARENT_TOOLTIP                               :{BLACK}Inspect the object of the parent scope
 

	
 
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT                            :{STRING1} at {HEX}
 
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_OBJECT                     :Object
 
STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_RAIL_TYPE                  :Rail type
 

	
 
STR_NEWGRF_INSPECT_QUERY_CAPTION                                :{WHITE}NewGRF variable 60+x parameter (hexadecimal)
 

	
src/newgrf_config.cpp
Show inline comments
 
@@ -825,29 +825,37 @@ static const uint32 OPENTTD_GRAPHICS_BAS
 

	
 
/**
 
 * Checks whether this GRF is a OpenTTD base graphic GRF.
 
 * @return true if and only if it is a base GRF.
 
 */
 
bool GRFConfig::IsOpenTTDBaseGRF() const
 
{
 
	return (this->ident.grfid & 0x00FFFFFF) == OPENTTD_GRAPHICS_BASE_GRF_ID;
 
}
 

	
 
/**
 
 * Search a textfile file next to this NewGRF.
 
 * @param type The type of the textfile to search for.
 
 * @return The filename for the textfile, \c NULL otherwise.
 
 */
 
const char *GRFConfig::GetTextfile() const
 
const char *GRFConfig::GetTextfile(TextfileType type) const
 
{
 
	static const char prefix[] = "readme";
 
	static const char * const prefixes[] = {
 
		"readme",
 
		"changelog",
 
		"license",
 
	};
 
	assert_compile(lengthof(prefixes) == TFT_END);
 

	
 
	const char *prefix = prefixes[type];
 

	
 
	if (this->filename == NULL) return NULL;
 

	
 
	static char file_path[MAX_PATH];
 
	strecpy(file_path, this->filename, lastof(file_path));
 

	
 
	char *slash = strrchr(file_path, PATHSEPCHAR);
 
	if (slash == NULL) return NULL;
 

	
 
	seprintf(slash + 1, lastof(file_path), "%s_%s.txt", prefix, GetCurrentLanguageIsoCode());
 
	if (FioCheckFileExists(file_path, NEWGRF_DIR)) return file_path;
 

	
src/newgrf_config.h
Show inline comments
 
@@ -137,24 +137,36 @@ struct GRFParameterInfo {
 
	uint32 GetValue(struct GRFConfig *config) const;
 
	void SetValue(struct GRFConfig *config, uint32 value);
 
};
 

	
 
/** Reference counted wrapper around a GRFText pointer. */
 
struct GRFTextWrapper : public SimpleCountedObject {
 
	struct GRFText *text; ///< The actual text
 

	
 
	GRFTextWrapper();
 
	~GRFTextWrapper();
 
};
 

	
 
/** Additional text files accompanying NewGRFs */
 
enum TextfileType {
 
	TFT_BEGIN,
 

	
 
	TFT_README = TFT_BEGIN,  ///< NewGRF readme
 
	TFT_CHANGELOG,           ///< NewGRF changelog
 
	TFT_LICENSE,             ///< NewGRF license
 

	
 
	TFT_END
 
};
 
DECLARE_POSTFIX_INCREMENT(TextfileType)
 

	
 
/** Information about GRF, used in the game and (part of it) in savegames */
 
struct GRFConfig : ZeroedMemoryAllocator {
 
	GRFConfig(const char *filename = NULL);
 
	GRFConfig(const GRFConfig &config);
 
	~GRFConfig();
 

	
 
	GRFIdentifier ident;                           ///< grfid and md5sum to uniquely identify newgrfs
 
	uint8 original_md5sum[16];                     ///< MD5 checksum of original file if only a 'compatible' file was loaded
 
	char *filename;                                ///< Filename - either with or without full path
 
	GRFTextWrapper *name;                          ///< NOSAVE: GRF name (Action 0x08)
 
	GRFTextWrapper *info;                          ///< NOSAVE: GRF info (author, copyright, ...) (Action 0x08)
 
	GRFError *error;                               ///< NOSAVE: Error/Warning during GRF loading (Action 0x0B)
 
@@ -166,25 +178,25 @@ struct GRFConfig : ZeroedMemoryAllocator
 
	uint32 grf_bugs;                               ///< NOSAVE: bugs in this GRF in this run, @see enum GRFBugs
 
	uint32 param[0x80];                            ///< GRF parameters
 
	uint8 num_params;                              ///< Number of used parameters
 
	uint8 num_valid_params;                        ///< NOSAVE: Number of valid parameters (action 0x14)
 
	uint8 palette;                                 ///< GRFPalette, bitset
 
	SmallVector<GRFParameterInfo *, 4> param_info; ///< NOSAVE: extra information about the parameters
 
	bool has_param_defaults;                       ///< NOSAVE: did this newgrf specify any defaults for it's parameters
 

	
 
	struct GRFConfig *next;                        ///< NOSAVE: Next item in the linked list
 

	
 
	bool IsOpenTTDBaseGRF() const;
 

	
 
	const char *GetTextfile() const;
 
	const char *GetTextfile(TextfileType type) const;
 
	const char *GetName() const;
 
	const char *GetDescription() const;
 

	
 
	void SetParameterDefaults();
 
	void SetSuitablePalette();
 
};
 

	
 
/** Method to find GRFs using FindGRFConfig */
 
enum FindGRFConfigMode {
 
	FGCM_EXACT,       ///< Only find Grfs matching md5sum
 
	FGCM_COMPATIBLE,  ///< Find best compatible Grf wrt. desired_version
 
	FGCM_NEWEST,      ///< Find newest Grf
src/newgrf_gui.cpp
Show inline comments
 
@@ -466,37 +466,39 @@ void OpenGRFParameterWindow(GRFConfig *c
 

	
 
/** Widgets of the #NewGRFTextfileWindow. */
 
enum ShowNewGRFTextfileWidgets {
 
	GTW_WIDGET_CAPTION,    ///< The caption of the window.
 
	GTW_WIDGET_BACKGROUND, ///< Panel to draw the textfile on.
 
	GTW_WIDGET_VSCROLLBAR, ///< Vertical scrollbar to scroll through the textfile up-and-down.
 
	GTW_WIDGET_HSCROLLBAR, ///< Horizontal scrollbar to scroll through the textfile left-to-right.
 
};
 

	
 
/** Window for displaying the textfile of a NewGRF. */
 
struct NewGRFTextfileWindow : public Window {
 
	const GRFConfig *grf_config;         ///< View the textfile of this GRFConfig.
 
	TextfileType file_type;              ///< Type of textfile to view.
 
	int line_height;                     ///< Height of a line in the display widget.
 
	Scrollbar *vscroll;                  ///< Vertical scrollbar.
 
	Scrollbar *hscroll;                  ///< Horizontal scrollbar.
 
	char *text;                          ///< Lines of text from the NewGRF's textfile.
 
	SmallVector<const char *, 64> lines; ///< #text, split into lines in a table with lines.
 
	uint max_length;                     ///< The longest line in the textfile (in pixels).
 

	
 
	static const int TOP_SPACING    = WD_FRAMETEXT_TOP;    ///< Additional spacing at the top of the #GTW_WIDGET_BACKGROUND widget.
 
	static const int BOTTOM_SPACING = WD_FRAMETEXT_BOTTOM; ///< Additional spacing at the bottom of the #GTW_WIDGET_BACKGROUND widget.
 

	
 
	NewGRFTextfileWindow(const WindowDesc *desc, const GRFConfig *c) : Window(), grf_config(c)
 
	NewGRFTextfileWindow(const WindowDesc *desc, const GRFConfig *c, TextfileType file_type) : Window(), grf_config(c), file_type(file_type)
 
	{
 
		this->CreateNestedTree(desc);
 
		this->GetWidget<NWidgetCore>(GTW_WIDGET_CAPTION)->SetDataTip(STR_NEWGRF_README_CAPTION + file_type, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS);
 
		this->vscroll = this->GetScrollbar(GTW_WIDGET_VSCROLLBAR);
 
		this->hscroll = this->GetScrollbar(GTW_WIDGET_HSCROLLBAR);
 
		this->FinishInitNested(desc);
 

	
 
		this->LoadTextfile();
 
	}
 

	
 
	~NewGRFTextfileWindow()
 
	{
 
		free(this->text);
 
	}
 

	
 
@@ -545,25 +547,25 @@ struct NewGRFTextfileWindow : public Win
 
	}
 

	
 
private:
 

	
 
	/**
 
	 * Load the NewGRF's textfile text from file, and setup #lines, #max_length, and both scrollbars.
 
	 */
 
	void LoadTextfile()
 
	{
 
		this->lines.Clear();
 

	
 
		/* Does GRF have a file of the demanded type? */
 
		const char *textfile = this->grf_config->GetTextfile();
 
		const char *textfile = this->grf_config->GetTextfile(file_type);
 
		if (textfile == NULL) return;
 

	
 
		/* Get text from file */
 
		size_t filesize;
 
		FILE *handle = FioFOpenFile(textfile, "rb", NEWGRF_DIR, &filesize);
 
		if (handle == NULL) return;
 

	
 
		this->text = ReallocT(this->text, filesize + 1);
 
		size_t read = fread(this->text, 1, filesize, handle);
 
		fclose(handle);
 

	
 
		if (read != filesize) return;
 
@@ -596,51 +598,51 @@ private:
 
		this->max_length = 0;
 
		for (uint i = 0; i < this->lines.Length(); i++) {
 
			this->max_length = max(this->max_length, GetStringBoundingBox(this->lines[i]).width);
 
		}
 
		this->hscroll->SetCount(this->max_length + WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT);
 
		this->hscroll->SetStepSize(10); // Speed up horizontal scrollbar
 
	}
 
};
 

	
 
static const NWidgetPart _nested_newgrf_textfile_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
 
		NWidget(WWT_CAPTION, COLOUR_MAUVE, GTW_WIDGET_CAPTION), SetDataTip(STR_NEWGRF_README_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
		NWidget(WWT_CAPTION, COLOUR_MAUVE, GTW_WIDGET_CAPTION), SetDataTip(STR_NULL, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PANEL, COLOUR_MAUVE, GTW_WIDGET_BACKGROUND), SetMinimalSize(200, 125), SetResize(1, 12), SetScrollbar(GTW_WIDGET_VSCROLLBAR),
 
		EndContainer(),
 
		NWidget(NWID_VERTICAL),
 
			NWidget(NWID_VSCROLLBAR, COLOUR_MAUVE, GTW_WIDGET_VSCROLLBAR),
 
		EndContainer(),
 
	EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(NWID_HSCROLLBAR, COLOUR_MAUVE, GTW_WIDGET_HSCROLLBAR),
 
		NWidget(WWT_RESIZEBOX, COLOUR_MAUVE),
 
	EndContainer(),
 
};
 

	
 
/** Window definition for the grf textfile window */
 
static const WindowDesc _newgrf_textfile_desc(
 
	WDP_CENTER, 630, 460,
 
	WC_NEWGRF_TEXTFILE, WC_NONE,
 
	WDF_UNCLICK_BUTTONS,
 
	_nested_newgrf_textfile_widgets, lengthof(_nested_newgrf_textfile_widgets)
 
);
 

	
 
void ShowNewGRFTextfileWindow(const GRFConfig *c)
 
void ShowNewGRFTextfileWindow(const GRFConfig *c, TextfileType file_type)
 
{
 
	DeleteWindowByClass(WC_NEWGRF_TEXTFILE);
 
	new NewGRFTextfileWindow(&_newgrf_textfile_desc, c);
 
	new NewGRFTextfileWindow(&_newgrf_textfile_desc, c, file_type);
 
}
 

	
 
static GRFPresetList _grf_preset_list;
 

	
 
class DropDownListPresetItem : public DropDownListItem {
 
public:
 
	DropDownListPresetItem(int result) : DropDownListItem(result, false) {}
 

	
 
	virtual ~DropDownListPresetItem() {}
 

	
 
	bool Selectable() const
 
	{
 
@@ -662,26 +664,26 @@ enum ShowNewGRFStateWidgets {
 
	SNGRFS_PRESET_DELETE,
 
	SNGRFS_ADD,
 
	SNGRFS_REMOVE,
 
	SNGRFS_MOVE_UP,
 
	SNGRFS_MOVE_DOWN,
 
	SNGRFS_FILTER,
 
	SNGRFS_FILE_LIST,
 
	SNGRFS_SCROLLBAR,
 
	SNGRFS_AVAIL_LIST,
 
	SNGRFS_SCROLL2BAR,
 
	SNGRFS_NEWGRF_INFO_TITLE,
 
	SNGRFS_NEWGRF_INFO,
 
	SNGRFS_NEWGRF_README,
 
	SNGRFS_SET_PARAMETERS,
 
	SNGRFS_NEWGRF_TEXTFILE,
 
	SNGRFS_SET_PARAMETERS = SNGRFS_NEWGRF_TEXTFILE + TFT_END,
 
	SNGRFS_TOGGLE_PALETTE,
 
	SNGRFS_APPLY_CHANGES,
 
	SNGRFS_RESCAN_FILES,
 
	SNGRFS_RESCAN_FILES2,
 
	SNGRFS_CONTENT_DOWNLOAD,
 
	SNGRFS_CONTENT_DOWNLOAD2,
 
	SNGRFS_SHOW_REMOVE, ///< Select active list buttons (0 = normal, 1 = simple layout).
 
	SNGRFS_SHOW_APPLY,  ///< Select display of the buttons below the 'details'.
 
};
 

	
 
/**
 
 * Window for showing NewGRF files
 
@@ -944,24 +946,31 @@ struct NewGRFWindow : public QueryString
 
				const GRFConfig *selected = this->active_sel;
 
				if (selected == NULL) selected = this->avail_sel;
 
				if (selected != NULL) {
 
					ShowNewGRFInfo(selected, r.left + WD_FRAMERECT_LEFT, r.top + WD_FRAMERECT_TOP, r.right - WD_FRAMERECT_RIGHT, r.bottom - WD_FRAMERECT_BOTTOM, this->show_params);
 
				}
 
				break;
 
			}
 
		}
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget, int click_count)
 
	{
 
		if (widget >= SNGRFS_NEWGRF_TEXTFILE && widget < SNGRFS_NEWGRF_TEXTFILE + TFT_END) {
 
			if (this->active_sel == NULL && this->avail_sel == NULL) return;
 

	
 
			ShowNewGRFTextfileWindow(this->active_sel != NULL ? this->active_sel : this->avail_sel, (TextfileType)(widget - SNGRFS_NEWGRF_TEXTFILE));
 
			return;
 
		}
 

	
 
		switch (widget) {
 
			case SNGRFS_PRESET_LIST: {
 
				DropDownList *list = new DropDownList();
 

	
 
				/* Add 'None' option for clearing list */
 
				list->push_back(new DropDownListStringItem(STR_NONE, -1, false));
 

	
 
				for (uint i = 0; i < _grf_preset_list.Length(); i++) {
 
					if (_grf_preset_list[i] != NULL) {
 
						list->push_back(new DropDownListPresetItem(i));
 
					}
 
				}
 
@@ -1115,30 +1124,24 @@ struct NewGRFWindow : public QueryString
 
						STR_NEWGRF_CONFIRMATION_TEXT,
 
						this,
 
						NewGRFConfirmationCallback
 
					);
 
				} else {
 
					CopyGRFConfigList(this->orig_list, this->actives, true);
 
					ResetGRFConfig(false);
 
					ReloadNewGRFData();
 
				}
 
				this->DeleteChildWindows(WC_QUERY_STRING); // Remove the parameter query window
 
				break;
 

	
 
			case SNGRFS_NEWGRF_README: // View GRF readme
 
				if (this->active_sel == NULL && this->avail_sel == NULL) break;
 

	
 
				ShowNewGRFTextfileWindow(this->active_sel != NULL ? this->active_sel : this->avail_sel);
 
				break;
 

	
 
			case SNGRFS_SET_PARAMETERS: { // Edit parameters
 
				if (this->active_sel == NULL || !this->editable || !this->show_params || this->active_sel->num_valid_params == 0) break;
 

	
 
				OpenGRFParameterWindow(this->active_sel);
 
				break;
 
			}
 

	
 
			case SNGRFS_TOGGLE_PALETTE:
 
				if (this->active_sel != NULL || !this->editable) {
 
					this->active_sel->palette ^= GRFP_USE_MASK;
 
					this->SetDirty();
 
				}
 
@@ -1281,25 +1284,27 @@ struct NewGRFWindow : public QueryString
 
		);
 
		this->SetWidgetDisabledState(SNGRFS_ADD, !this->editable || this->avail_sel == NULL || HasBit(this->avail_sel->flags, GCF_INVALID));
 

	
 
		bool disable_all = this->active_sel == NULL || !this->editable;
 
		this->SetWidgetsDisabledState(disable_all,
 
			SNGRFS_REMOVE,
 
			SNGRFS_MOVE_UP,
 
			SNGRFS_MOVE_DOWN,
 
			WIDGET_LIST_END
 
		);
 

	
 
		const GRFConfig *c = (this->avail_sel == NULL) ? this->active_sel : this->avail_sel;
 
		this->SetWidgetDisabledState(SNGRFS_NEWGRF_README, c == NULL || c->GetTextfile() == NULL);
 
		for (TextfileType tft = TFT_BEGIN; tft < TFT_END; tft++) {
 
			this->SetWidgetDisabledState(SNGRFS_NEWGRF_TEXTFILE + tft, c == NULL || c->GetTextfile(tft) == NULL);
 
		}
 

	
 
		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) {
 
			/* All widgets are now enabled, so disable widgets we can't use */
 
			if (this->active_sel == this->actives)    this->DisableWidget(SNGRFS_MOVE_UP);
 
			if (this->active_sel->next == NULL)       this->DisableWidget(SNGRFS_MOVE_DOWN);
 
			if (this->active_sel->IsOpenTTDBaseGRF()) this->DisableWidget(SNGRFS_REMOVE);
 
		}
 

	
 
		this->SetWidgetDisabledState(SNGRFS_PRESET_DELETE, this->preset == -1);
 
@@ -1764,29 +1769,37 @@ static const NWidgetPart _nested_newgrf_
 
			NWidget(NWID_VERTICAL),
 
				NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, SNGRFS_RESCAN_FILES), SetFill(1, 0), SetResize(1, 0),
 
						SetDataTip(STR_NEWGRF_SETTINGS_RESCAN_FILES, STR_NEWGRF_SETTINGS_RESCAN_FILES_TOOLTIP),
 
				NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, SNGRFS_CONTENT_DOWNLOAD), SetFill(1, 0), SetResize(1, 0),
 
						SetDataTip(STR_INTRO_ONLINE_CONTENT, STR_INTRO_TOOLTIP_ONLINE_CONTENT),
 
			EndContainer(),
 
		EndContainer(),
 
	EndContainer(),
 
};
 

	
 
static const NWidgetPart _nested_newgrf_infopanel_widgets[] = {
 
	/* Right side, info panel. */
 
	NWidget(NWID_VERTICAL), SetPadding(0, 0, 2, 0),
 
	NWidget(WWT_PANEL, COLOUR_MAUVE), SetPadding(0, 0, 2, 0),
 
		NWidget(WWT_EMPTY, COLOUR_MAUVE, SNGRFS_NEWGRF_INFO_TITLE), SetFill(1, 0), SetResize(1, 0),
 
		NWidget(WWT_EMPTY, COLOUR_MAUVE, SNGRFS_NEWGRF_INFO), SetFill(1, 1), SetResize(1, 1), SetMinimalSize(150, 100),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, SNGRFS_NEWGRF_README), SetFill(1, 0), SetResize(1, 0),
 
				SetDataTip(STR_NEWGRF_SETTINGS_VIEW_README, STR_NULL), SetPadding(2, 2, 2, 2),
 
		EndContainer(),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, SNGRFS_NEWGRF_TEXTFILE + TFT_README), SetFill(1, 0), SetResize(1, 0),
 
				SetDataTip(STR_NEWGRF_SETTINGS_VIEW_README, STR_NULL),
 
		NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, SNGRFS_NEWGRF_TEXTFILE + TFT_CHANGELOG), SetFill(1, 0), SetResize(1, 0),
 
					SetDataTip(STR_NEWGRF_SETTINGS_VIEW_CHANGELOG, STR_NULL),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, SNGRFS_NEWGRF_TEXTFILE + TFT_LICENSE), SetFill(1, 0), SetResize(1, 0),
 
					SetDataTip(STR_NEWGRF_SETTINGS_VIEW_LICENSE, STR_NULL),
 
		EndContainer(),
 
	EndContainer(),
 
	NWidget(NWID_SELECTION, INVALID_COLOUR, SNGRFS_SHOW_APPLY),
 
		/* Right side, buttons. */
 
		NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(0, WD_RESIZEBOX_WIDTH, 0),
 
			NWidget(NWID_VERTICAL),
 
				NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, SNGRFS_SET_PARAMETERS), SetFill(1, 0), SetResize(1, 0),
 
						SetDataTip(STR_NEWGRF_SETTINGS_SET_PARAMETERS, STR_NULL),
 
				NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, SNGRFS_TOGGLE_PALETTE), SetFill(1, 0), SetResize(1, 0),
 
						SetDataTip(STR_NEWGRF_SETTINGS_TOGGLE_PALETTE, STR_NEWGRF_SETTINGS_TOGGLE_PALETTE_TOOLTIP),
 
			EndContainer(),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, SNGRFS_APPLY_CHANGES), SetFill(1, 0), SetResize(1, 0),
 
					SetDataTip(STR_NEWGRF_SETTINGS_APPLY_CHANGES, STR_NULL),
0 comments (0 inline, 0 general)