OpenTTD Source: src/newgrf_gui.cpp File Reference

OpenTTD Source 15.3

Data Structures | Typedefs | Functions | Variables
newgrf_gui.cpp File Reference

GUI to change NewGRF settings. More...

`#include "stdafx.h"`
`#include "error.h"`
`#include "settings_gui.h"`
`#include "newgrf.h"`
`#include "strings_func.h"`
`#include "window_func.h"`
`#include "gamelog.h"`
`#include "settings_type.h"`
`#include "settings_func.h"`
`#include "dropdown_type.h"`
`#include "dropdown_func.h"`
`#include "network/network.h"`
`#include "network/network_content.h"`
`#include "sortlist_type.h"`
`#include "stringfilter_type.h"`
`#include "querystring_gui.h"`
`#include "core/geometry_func.hpp"`
`#include "newgrf_text.h"`
`#include "textfile_gui.h"`
`#include "tilehighlight_func.h"`
`#include "fios.h"`
`#include "timer/timer.h"`
`#include "timer/timer_window.h"`
`#include "zoom_func.h"`
`#include "core/string_consumer.hpp"`
`#include "widgets/newgrf_widget.h"`
`#include "widgets/misc_widget.h"`
`#include "table/sprites.h"`
`#include "table/strings.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Data Structures
struct | NewGRFParametersWindow
| Window for setting the parameters of a NewGRF. More...
struct | NewGRFTextfileWindow
| Window for displaying the textfile of a NewGRF. More...
struct | NewGRFWindow
| Window for showing NewGRF files. More...
class | NWidgetNewGRFDisplay
| Custom nested widget container for the NewGRF gui. More...
struct | SavePresetWindow
| Class for the save preset window. More...
struct | ScanProgressWindow
| Window for showing the progress of NewGRF scanning. More...

## Typedefs
typedef std::map< uint32_t, const GRFConfig * > | GrfIdMap
| Map of grfid to the grf config.

## Functions
void | ShowNewGRFError ()
| Show the first NewGRF error we can find.
static StringID | GetGRFPaletteString (uint8_t palette)
static void | ShowNewGRFInfo (const GRFConfig &c, const Rect &r, bool show_params)
void | OpenGRFParameterWindow (bool is_baseset, GRFConfig &c, bool editable)
void | ShowNewGRFTextfileWindow (Window *parent, TextfileType file_type, const GRFConfig *c)
static void | FillGrfidMap (const GRFConfigList &lst, GrfIdMap &grfid_map)
| Add all grf configs from c into the map.
static void | NewGRFConfirmationCallback (Window *w, bool confirmed)
| Callback function for the newgrf 'apply changes' confirmation window.
static void | ShowSavePresetWindow (std::string_view initial_text)
| Open the window for saving a preset.
void | ShowMissingContentWindow (const GRFConfigList &list)
| Show the content list window with all missing grfs from the given list.
std::unique_ptr< NWidgetBase > | NewGRFDisplay ()
| Construct nested container widget for managing the lists and the info panel of the NewGRF GUI.
void | ShowNewGRFSettings (bool editable, bool show_params, bool exec_changes, GRFConfigList &config)
| Setup the NewGRF gui.
void | UpdateNewGRFScanStatus (uint num, std::string &&name)
| Update the NewGRF scan status.

## Variables
static constexpr std::initializer_list< NWidgetPart > | _nested_newgrf_parameter_widgets
static WindowDesc | _newgrf_parameters_desc (WDP_CENTER, "settings_newgrf_config", 500, 208, WC_GRF_PARAMETERS, WC_NONE, {}, _nested_newgrf_parameter_widgets)
| Window definition for the change grf parameters window.
static constexpr std::initializer_list< NWidgetPart > | _nested_newgrf_actives_widgets
static constexpr std::initializer_list< NWidgetPart > | _nested_newgrf_availables_widgets
static constexpr std::initializer_list< NWidgetPart > | _nested_newgrf_infopanel_widgets
static constexpr std::initializer_list< NWidgetPart > | _nested_newgrf_widgets
static WindowDesc | _newgrf_desc (WDP_CENTER, "settings_newgrf", 300, 263, WC_GAME_OPTIONS, WC_NONE, {}, _nested_newgrf_widgets)
static constexpr std::initializer_list< NWidgetPart > | _nested_save_preset_widgets
| Widget parts of the save preset window.
static WindowDesc | _save_preset_desc (WDP_CENTER, "save_preset", 140, 110, WC_SAVE_PRESET, WC_GAME_OPTIONS, WindowDefaultFlag::Modal, _nested_save_preset_widgets)
| Window description of the preset save window.
static constexpr std::initializer_list< NWidgetPart > | _nested_scan_progress_widgets
| Widgets for the progress window.
static WindowDesc | _scan_progress_desc (WDP_CENTER, {}, 0, 0, WC_MODAL_PROGRESS, WC_NONE, {}, _nested_scan_progress_widgets)
| Description of the widgets and other settings of the window.

## Detailed Description

GUI to change NewGRF settings.

Definition in file newgrf_gui.cpp.

## Typedef Documentation

## ◆ GrfIdMap

typedef std::map<uint32_t, const GRFConfig *> GrfIdMap

Map of grfid to the grf config.

Definition at line 576 of file newgrf_gui.cpp.

## Function Documentation

## ◆ FillGrfidMap()

static void FillGrfidMap | ( | const GRFConfigList & | lst,
|  | GrfIdMap & | grfid_map
| ) |  |
| static

Add all grf configs from c into the map.

Parameters

  lst | Grf list to add.
  grfid_map | Map to add them to.

Definition at line 583 of file newgrf_gui.cpp.

References GRFIdentifier::grfid, and GRFConfig::ident.

Referenced by NewGRFWindow::CanUpgradeCurrent(), and NewGRFWindow::UpgradeCurrent().

## ◆ GetGRFPaletteString()

static StringID GetGRFPaletteString | ( | uint8_t | palette | ) |
| static

Definition at line 76 of file newgrf_gui.cpp.

## ◆ NewGRFConfirmationCallback()

static void NewGRFConfirmationCallback | ( | Window * | w,
|  | bool | confirmed
| ) |  |
| static

Callback function for the newgrf 'apply changes' confirmation window.

Parameters

  w | Window which is calling this callback
  confirmed | boolean value, true when yes was clicked, false otherwise

Definition at line 1920 of file newgrf_gui.cpp.

References _gamelog, _grfconfig, NewGRFWindow::active_sel, NewGRFWindow::actives, NewGRFWindow::avails, Window::CloseChildWindows(), CloseWindowByClass(), CopyGRFConfigList(), GUIList< T, P, F >::ForceRebuild(), GLAT_GRF, Gamelog::GRFUpdate(), Window::InvalidateData(), NewGRFWindow::modified, NewGRFWindow::orig_list, ReInitAllWindows(), ReloadNewGRFData(), Gamelog::StartAction(), Gamelog::StopAction(), WC_BUILD_OBJECT, WC_GRF_PARAMETERS, and WC_TEXTFILE.

Referenced by NewGRFWindow::OnClick().

## ◆ NewGRFDisplay()

std::unique_ptr< NWidgetBase > NewGRFDisplay | ( |  | ) |

Construct nested container widget for managing the lists and the info panel of the NewGRF GUI.

Definition at line 1881 of file newgrf_gui.cpp.

References MakeNWidgets().

## ◆ OpenGRFParameterWindow()

void OpenGRFParameterWindow | ( | bool | is_baseset,
|  | GRFConfig & | c,
|  | bool | editable
| ) |  |

Definition at line 542 of file newgrf_gui.cpp.

## ◆ ShowMissingContentWindow()

void ShowMissingContentWindow | ( | const GRFConfigList & | list | ) |

Show the content list window with all missing grfs from the given list.

Parameters

  list | The list of grfs to check for missing / not exactly matching ones.

Definition at line 1505 of file newgrf_gui.cpp.

References Compatible, CONTENT_TYPE_NEWGRF, ContentInfo::DoesNotExist, GRFConfig::flags, GCS_NOT_FOUND, GRFConfig::GetName(), GRFIdentifier::grfid, GRFConfig::ident, GRFIdentifier::md5sum, GRFConfig::original_md5sum, ShowNetworkContentListWindow(), GRFConfig::status, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().

Referenced by SaveLoadWindow::OnClick(), NetworkGameWindow::OnClick(), and NewGRFWindow::OnClick().

## ◆ ShowNewGRFError()

void ShowNewGRFError | ( |  | ) |

Show the first NewGRF error we can find.

Definition at line 47 of file newgrf_gui.cpp.

References _grfconfig, GRFError::custom_message, GRFError::data, GetEncodedStringWithArgs(), GRFError::message, GRFError::param_value, GRFError::severity, ShowErrorMessage(), WL_CRITICAL, and WL_ERROR.

Referenced by _GenerateWorld(), and InitializeWindowsAndCaches().

## ◆ ShowNewGRFInfo()

static void ShowNewGRFInfo | ( | const GRFConfig & | c,
|  | const Rect & | r,
|  | bool | show_params
| ) |  |
| static

Definition at line 84 of file newgrf_gui.cpp.

## ◆ ShowNewGRFSettings()

void ShowNewGRFSettings | ( | bool | editable,
|  | bool | show_params,
|  | bool | exec_changes,
|  | GRFConfigList & | config
| ) |  |

Setup the NewGRF gui.

Parameters

  editable | allow the user to make changes to the grfconfig in the window
  show_params | show information about what parameters are set for the grf files
  exec_changes | if changes are made to the list (editable is true), apply these changes immediately or only update the list
  config | The GRFConfigList that will be shown.

Definition at line 1968 of file newgrf_gui.cpp.

References CloseWindowByClass(), and WC_GAME_OPTIONS.

Referenced by MenuClickSettings(), SaveLoadWindow::OnClick(), GenerateLandscapeWindow::OnClick(), and NetworkGameWindow::OnClick().

## ◆ ShowNewGRFTextfileWindow()

void ShowNewGRFTextfileWindow | ( | Window * | parent,
|  | TextfileType | file_type,
|  | const GRFConfig * | c
| ) |  |

Definition at line 570 of file newgrf_gui.cpp.

## ◆ ShowSavePresetWindow()

static void ShowSavePresetWindow | ( | std::string_view | initial_text | ) |
| static

Open the window for saving a preset.

Parameters

  initial_text | Initial text to display in the edit box, or `nullptr`.

Definition at line 2121 of file newgrf_gui.cpp.

References CloseWindowByClass(), and WC_SAVE_PRESET.

Referenced by NewGRFWindow::OnClick().

## ◆ UpdateNewGRFScanStatus()

void UpdateNewGRFScanStatus | ( | uint | num,
|  | std::string && | name
| ) |  |

Update the NewGRF scan status.

Parameters

  num | The number of NewGRFs scanned so far.
  name | The name of the last scanned NewGRF.

Definition at line 2220 of file newgrf_gui.cpp.

References FindWindowByClass(), ScanProgressWindow::UpdateNewGRFScanStatus(), and WC_MODAL_PROGRESS.

Referenced by GRFFileScanner::AddFile().

## Variable Documentation

## ◆ _nested_newgrf_actives_widgets

constexpr std::initializer_list<NWidgetPart> _nested_newgrf_actives_widgets
| staticconstexpr

Definition at line 1748 of file newgrf_gui.cpp.

## ◆ _nested_newgrf_availables_widgets

constexpr std::initializer_list<NWidgetPart> _nested_newgrf_availables_widgets
| staticconstexpr

Definition at line 1803 of file newgrf_gui.cpp.

## ◆ _nested_newgrf_infopanel_widgets

constexpr std::initializer_list<NWidgetPart> _nested_newgrf_infopanel_widgets
| staticconstexpr

Definition at line 1836 of file newgrf_gui.cpp.

## ◆ _nested_newgrf_parameter_widgets

constexpr std::initializer_list<NWidgetPart> _nested_newgrf_parameter_widgets
| staticconstexpr

Initial value:
= {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
NWidget(WWT_CAPTION, COLOUR_MAUVE, WID_NP_CAPTION),
NWidget(WWT_DEFSIZEBOX, COLOUR_MAUVE),
EndContainer(),
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_NP_SHOW_NUMPAR),
NWidget(WWT_PANEL, COLOUR_MAUVE), SetResize(1, 0), SetFill(1, 0), SetPIP(4, 0, 4),
NWidget(NWID_HORIZONTAL), SetPIP(4, 0, 4),
NWidget(WWT_PUSHARROWBTN, COLOUR_YELLOW, WID_NP_NUMPAR_DEC), SetMinimalSize(12, 12), SetArrowWidgetTypeTip(AWV_DECREASE),
NWidget(WWT_PUSHARROWBTN, COLOUR_YELLOW, WID_NP_NUMPAR_INC), SetMinimalSize(12, 12), SetArrowWidgetTypeTip(AWV_INCREASE),
NWidget(WWT_TEXT, INVALID_COLOUR, WID_NP_NUMPAR), SetResize(1, 0), SetFill(1, 0), SetPadding(0, 0, 0, 4),
EndContainer(),
EndContainer(),
EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_MATRIX, COLOUR_MAUVE, WID_NP_BACKGROUND), SetMinimalSize(188, 182), SetResize(1, 1), SetFill(1, 0), SetMatrixDataTip(1, 0), SetScrollbar(WID_NP_SCROLLBAR),
NWidget(NWID_VSCROLLBAR, COLOUR_MAUVE, WID_NP_SCROLLBAR),
EndContainer(),
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_NP_SHOW_DESCRIPTION),
NWidget(WWT_PANEL, COLOUR_MAUVE, WID_NP_DESCRIPTION), SetResize(1, 0), SetFill(1, 0),
EndContainer(),
EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_PUSHTXTBTN, COLOUR_MAUVE, WID_NP_RESET), SetStringTip(STR_NEWGRF_PARAMETERS_RESET, STR_NEWGRF_PARAMETERS_RESET_TOOLTIP),
NWidget(WWT_PANEL, COLOUR_MAUVE), SetResize(1, 0), SetFill(1, 0),
EndContainer(),
NWidget(WWT_RESIZEBOX, COLOUR_MAUVE),
EndContainer(),
}
SetMatrixDataTip
constexpr NWidgetPart SetMatrixDataTip(uint32_t cols, uint32_t rows, StringID tip={})
Widget part function for setting the data and tooltip of WWT_MATRIX widgets.
Definition widget_type.h:1311
SetFill
constexpr NWidgetPart SetFill(uint16_t fill_x, uint16_t fill_y)
Widget part function for setting filling.
Definition widget_type.h:1222
SetPIP
constexpr NWidgetPart SetPIP(uint8_t pre, uint8_t inter, uint8_t post)
Widget part function for setting a pre/inter/post spaces.
Definition widget_type.h:1378
SetScrollbar
constexpr NWidgetPart SetScrollbar(WidgetID index)
Attach a scrollbar to a widget.
Definition widget_type.h:1402
SetPadding
constexpr NWidgetPart SetPadding(uint8_t top, uint8_t right, uint8_t bottom, uint8_t left)
Widget part function for setting additional space around a widget.
Definition widget_type.h:1335
SetStringTip
constexpr NWidgetPart SetStringTip(StringID string, StringID tip={})
Widget part function for setting the string and tooltip.
Definition widget_type.h:1243
SetMinimalSize
constexpr NWidgetPart SetMinimalSize(int16_t x, int16_t y)
Widget part function for setting the minimal size.
Definition widget_type.h:1159
EndContainer
constexpr NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME,...
Definition widget_type.h:1232
SetArrowWidgetTypeTip
constexpr NWidgetPart SetArrowWidgetTypeTip(ArrowWidgetValues widget_type, StringID tip={})
Widget part function for setting the arrow widget type and tooltip.
Definition widget_type.h:1277
NWidget
constexpr NWidgetPart NWidget(WidgetType tp, Colours col, WidgetID idx=INVALID_WIDGET)
Widget part function for starting a new 'real' widget.
Definition widget_type.h:1427
SetResize
constexpr NWidgetPart SetResize(int16_t dx, int16_t dy)
Widget part function for setting the resize step.
Definition widget_type.h:1148
WID_NP_NUMPAR_INC
@ WID_NP_NUMPAR_INC
Button to increase number of parameters.
Definition newgrf_widget.h:21
WID_NP_RESET
@ WID_NP_RESET
Reset button.
Definition newgrf_widget.h:26
WID_NP_NUMPAR_DEC
@ WID_NP_NUMPAR_DEC
Button to decrease number of parameters.
Definition newgrf_widget.h:20
WID_NP_SCROLLBAR
@ WID_NP_SCROLLBAR
Scrollbar to scroll through all settings.
Definition newgrf_widget.h:25
WID_NP_CAPTION
@ WID_NP_CAPTION
Caption of the window.
Definition newgrf_widget.h:18
WID_NP_BACKGROUND
@ WID_NP_BACKGROUND
Panel to draw the settings on.
Definition newgrf_widget.h:24
WID_NP_NUMPAR
@ WID_NP_NUMPAR
Optional number of parameters.
Definition newgrf_widget.h:22
WID_NP_SHOW_NUMPAR
@ WID_NP_SHOW_NUMPAR
NWID_SELECTION to optionally display WID_NP_NUMPAR.
Definition newgrf_widget.h:19
WID_NP_SHOW_DESCRIPTION
@ WID_NP_SHOW_DESCRIPTION
NWID_SELECTION to optionally display parameter descriptions.
Definition newgrf_widget.h:27
WID_NP_DESCRIPTION
@ WID_NP_DESCRIPTION
Multi-line description of a parameter.
Definition newgrf_widget.h:28
WWT_PUSHTXTBTN
@ WWT_PUSHTXTBTN
Normal push-button (no toggle button) with text caption.
Definition widget_type.h:105
WWT_PUSHARROWBTN
@ WWT_PUSHARROWBTN
Normal push-button (no toggle button) with arrow caption.
Definition widget_type.h:107
NWID_HORIZONTAL
@ NWID_HORIZONTAL
Horizontal container.
Definition widget_type.h:66
WWT_PANEL
@ WWT_PANEL
Simple depressed panel.
Definition widget_type.h:39
WWT_MATRIX
@ WWT_MATRIX
Grid of rows and columns.
Definition widget_type.h:50
WWT_CAPTION
@ WWT_CAPTION
Window caption (window title between closebox and stickybox)
Definition widget_type.h:52
NWID_VSCROLLBAR
@ NWID_VSCROLLBAR
Vertical scrollbar.
Definition widget_type.h:76
WWT_CLOSEBOX
@ WWT_CLOSEBOX
Close box (at top-left of a window)
Definition widget_type.h:60
WWT_RESIZEBOX
@ WWT_RESIZEBOX
Resize box (normally at bottom-right of a window)
Definition widget_type.h:59
WWT_DEFSIZEBOX
@ WWT_DEFSIZEBOX
Default window size box (at top-right of a window, between WWT_SHADEBOX and WWT_STICKYBOX)
Definition widget_type.h:56
WWT_TEXT
@ WWT_TEXT
Pure simple text.
Definition widget_type.h:49
NWID_SELECTION
@ NWID_SELECTION
Stacked widgets, only one visible at a time (eg in a panel with tabs).
Definition widget_type.h:71
AWV_DECREASE
@ AWV_DECREASE
Arrow to the left or in case of RTL to the right.
Definition widget_type.h:20
AWV_INCREASE
@ AWV_INCREASE
Arrow to the right or in case of RTL to the left.
Definition widget_type.h:21

Definition at line 503 of file newgrf_gui.cpp.

## ◆ _nested_newgrf_widgets

constexpr std::initializer_list<NWidgetPart> _nested_newgrf_widgets
| staticconstexpr

Initial value:
= {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
NWidget(WWT_CAPTION, COLOUR_MAUVE), SetStringTip(STR_NEWGRF_SETTINGS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_DEFSIZEBOX, COLOUR_MAUVE),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_MAUVE),
NWidgetFunction(NewGRFDisplay), SetPadding(WidgetDimensions::unscaled.sparse_resize),
NWidget(NWID_HORIZONTAL),
NWidget(NWID_SPACER), SetFill(1, 0), SetResize(1, 0),
NWidget(WWT_RESIZEBOX, COLOUR_MAUVE), SetResizeWidgetTypeTip(RWV_HIDE_BEVEL, STR_TOOLTIP_RESIZE),
EndContainer(),
EndContainer(),
}
WidgetDimensions::unscaled
static const WidgetDimensions unscaled
Unscaled widget dimensions.
Definition window_gui.h:93
NWidgetFunction
constexpr NWidgetPart NWidgetFunction(NWidgetFunctionType *func_ptr)
Obtain a nested widget (sub)tree from an external source.
Definition widget_type.h:1448
SetResizeWidgetTypeTip
constexpr NWidgetPart SetResizeWidgetTypeTip(ResizeWidgetValues widget_type, StringID tip)
Widget part function for setting the resize widget type and tooltip.
Definition widget_type.h:1288
NewGRFDisplay
std::unique_ptr< NWidgetBase > NewGRFDisplay()
Construct nested container widget for managing the lists and the info panel of the NewGRF GUI.
Definition newgrf_gui.cpp:1881
NWID_SPACER
@ NWID_SPACER
Invisible widget that takes some space.
Definition widget_type.h:70
RWV_HIDE_BEVEL
@ RWV_HIDE_BEVEL
Bevel of resize box is hidden.
Definition widget_type.h:29

Definition at line 1891 of file newgrf_gui.cpp.

## ◆ _nested_save_preset_widgets

constexpr std::initializer_list<NWidgetPart> _nested_save_preset_widgets
| staticconstexpr

Initial value:
= {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_SAVE_PRESET_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_DEFSIZEBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_INSET, COLOUR_GREY, WID_SVP_PRESET_LIST), SetPadding(2, 1, 2, 2),
SetToolTip(STR_SAVE_PRESET_LIST_TOOLTIP), SetResize(1, 10), SetScrollbar(WID_SVP_SCROLLBAR), EndContainer(),
NWidget(NWID_VSCROLLBAR, COLOUR_GREY, WID_SVP_SCROLLBAR),
EndContainer(),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY),
NWidget(WWT_EDITBOX, COLOUR_GREY, WID_SVP_EDITBOX), SetPadding(2, 2, 2, 2), SetFill(1, 0), SetResize(1, 0),
SetStringTip(STR_SAVE_PRESET_TITLE, STR_SAVE_PRESET_EDITBOX_TOOLTIP),
EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SVP_SAVE), SetStringTip(STR_SAVE_PRESET_SAVE, STR_SAVE_PRESET_SAVE_TOOLTIP), SetFill(1, 0), SetResize(1, 0),
NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(),
}
SetToolTip
constexpr NWidgetPart SetToolTip(StringID tip)
Widget part function for setting tooltip and clearing the widget data.
Definition widget_type.h:1321
WID_SVP_SAVE
@ WID_SVP_SAVE
Button to save the preset.
Definition newgrf_widget.h:70
WID_SVP_PRESET_LIST
@ WID_SVP_PRESET_LIST
List with available preset names.
Definition newgrf_widget.h:67
WID_SVP_SCROLLBAR
@ WID_SVP_SCROLLBAR
Scrollbar for the list available preset names.
Definition newgrf_widget.h:68
WID_SVP_EDITBOX
@ WID_SVP_EDITBOX
Edit box for changing the preset name.
Definition newgrf_widget.h:69
WWT_INSET
@ WWT_INSET
Pressed (inset) panel, most commonly used as combo box text area.
Definition widget_type.h:40
WWT_EDITBOX
@ WWT_EDITBOX
a textbox for typing
Definition widget_type.h:62

Widget parts of the save preset window.

Definition at line 1975 of file newgrf_gui.cpp.

## ◆ _nested_scan_progress_widgets

constexpr std::initializer_list<NWidgetPart> _nested_scan_progress_widgets
| staticconstexpr

Initial value:
= {
NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_NEWGRF_SCAN_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PANEL, COLOUR_GREY),
NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), SetPadding(WidgetDimensions::unscaled.modalpopup),
NWidget(WWT_LABEL, INVALID_COLOUR), SetStringTip(STR_NEWGRF_SCAN_MESSAGE), SetFill(1, 0),
NWidget(WWT_EMPTY, INVALID_COLOUR, WID_SP_PROGRESS_BAR), SetFill(1, 0),
NWidget(WWT_EMPTY, INVALID_COLOUR, WID_SP_PROGRESS_TEXT), SetFill(1, 0), SetMinimalSize(400, 0),
EndContainer(),
EndContainer(),
}
WID_SP_PROGRESS_BAR
@ WID_SP_PROGRESS_BAR
Simple progress bar.
Definition newgrf_widget.h:75
WID_SP_PROGRESS_TEXT
@ WID_SP_PROGRESS_TEXT
Text explaining what is happening.
Definition newgrf_widget.h:76
WWT_LABEL
@ WWT_LABEL
Centered label.
Definition widget_type.h:48
NWID_VERTICAL
@ NWID_VERTICAL
Vertical container.
Definition widget_type.h:68
WWT_EMPTY
@ WWT_EMPTY
Empty widget, place holder to reserve space in widget tree.
Definition widget_type.h:37

Widgets for the progress window.

Definition at line 2128 of file newgrf_gui.cpp.