Changeset - r28045:bf5fcc2d8b3e
[Not reviewed]
master
0 1 0
Peter Nelson - 8 months ago 2023-10-25 21:12:39
peter1138@openttd.org
Codechange: Remove redundant WWT_PANEL from bootstrap error windows.
1 file changed with 7 insertions and 11 deletions:
0 comments (0 inline, 0 general)
src/bootstrap_gui.cpp
Show inline comments
 
@@ -59,29 +59,27 @@ public:
 
	void DrawWidget(const Rect &r, int) const override
 
	{
 
		GfxFillRect(r.left, r.top, r.right, r.bottom, 4, FILLRECT_OPAQUE);
 
		GfxFillRect(r.left, r.top, r.right, r.bottom, 0, FILLRECT_CHECKER);
 
	}
 
};
 

	
 
/** Nested widgets for the error window. */
 
static const NWidgetPart _nested_bootstrap_errmsg_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CAPTION, COLOUR_GREY, WID_BEM_CAPTION), SetDataTip(STR_MISSING_GRAPHICS_ERROR_TITLE, STR_NULL),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY),
 
		NWidget(WWT_PANEL, COLOUR_GREY, WID_BEM_MESSAGE), EndContainer(),
 
		NWidget(NWID_HORIZONTAL),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BEM_QUIT), SetDataTip(STR_MISSING_GRAPHICS_ERROR_QUIT, STR_NULL), SetFill(1, 0),
 
		EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, WID_BEM_MESSAGE), EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BEM_QUIT), SetDataTip(STR_MISSING_GRAPHICS_ERROR_QUIT, STR_NULL), SetFill(1, 0),
 
	EndContainer(),
 
};
 

	
 
/** Window description for the error window. */
 
static WindowDesc _bootstrap_errmsg_desc(
 
	WDP_CENTER, nullptr, 0, 0,
 
	WC_BOOTSTRAP, WC_NONE,
 
	WDF_MODAL | WDF_NO_CLOSE,
 
	std::begin(_nested_bootstrap_errmsg_widgets), std::end(_nested_bootstrap_errmsg_widgets)
 
);
 

	
 
/** The window for a failed bootstrap. */
 
@@ -169,30 +167,28 @@ public:
 

	
 
		/* _exit_game is used to break out of the outer video driver's MainLoop. */
 
		_exit_game = true;
 
		this->Close();
 
	}
 
};
 

	
 
/** The widgets for the query. It has no close box as that sprite does not exist yet. */
 
static const NWidgetPart _bootstrap_query_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_MISSING_GRAPHICS_SET_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY),
 
		NWidget(WWT_PANEL, COLOUR_GREY, WID_BAFD_QUESTION), EndContainer(),
 
		NWidget(NWID_HORIZONTAL),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BAFD_YES), SetDataTip(STR_MISSING_GRAPHICS_YES_DOWNLOAD, STR_NULL),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BAFD_NO), SetDataTip(STR_MISSING_GRAPHICS_NO_QUIT, STR_NULL),
 
		EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_GREY, WID_BAFD_QUESTION), EndContainer(),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BAFD_YES), SetDataTip(STR_MISSING_GRAPHICS_YES_DOWNLOAD, STR_NULL),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BAFD_NO), SetDataTip(STR_MISSING_GRAPHICS_NO_QUIT, STR_NULL),
 
	EndContainer(),
 
};
 

	
 
/** The window description for the query. */
 
static WindowDesc _bootstrap_query_desc(
 
	WDP_CENTER, nullptr, 0, 0,
 
	WC_CONFIRM_POPUP_QUERY, WC_NONE,
 
	WDF_NO_CLOSE,
 
	std::begin(_bootstrap_query_widgets), std::end(_bootstrap_query_widgets)
 
);
 

	
 
/** The window for the query. It can't use the generic query window as that uses sprites that don't exist yet. */
0 comments (0 inline, 0 general)