Merge branch 'master' into jgrpp
# Conflicts: # .github/workflows/ci-build.yml # .github/workflows/release-linux.yml # .github/workflows/release-macos.yml # .github/workflows/release-windows.yml # .gitignore # COMPILING.md # src/company_gui.cpp # src/date_gui.cpp # src/engine.cpp # src/engine_func.h # src/fileio.cpp # src/linkgraph/linkgraph_gui.h # src/newgrf_debug_gui.cpp # src/newgrf_gui.cpp # src/order_gui.cpp # src/osk_gui.cpp # src/rail_gui.cpp # src/road_gui.cpp # src/script/api/script_event_types.hpp # src/sl/oldloader_sl.cpp # src/smallmap_gui.cpp # src/station_cmd.cpp # src/toolbar_gui.cpp # src/town_gui.cpp # src/transparency_gui.cpp # src/vehicle_gui.cpp # src/widget.cpp # src/widget_type.h # src/widgets/dropdown.cpp # src/widgets/dropdown_func.h # src/widgets/dropdown_type.h # src/widgets/group_widget.h # src/widgets/vehicle_widget.h # src/window.cpp # src/window_gui.h # src/window_type.h
This commit is contained in:
@@ -105,7 +105,7 @@ struct BaseSetTextfileWindow : public TextfileWindow {
|
||||
this->LoadTextfile(textfile, BASESET_DIR);
|
||||
}
|
||||
|
||||
void SetStringParameters(int widget) const override
|
||||
void SetStringParameters(WidgetID widget) const override
|
||||
{
|
||||
if (widget == WID_TF_CAPTION) {
|
||||
SetDParam(0, content_type);
|
||||
@@ -179,7 +179,7 @@ struct GameOptionsWindow : Window {
|
||||
GameSettings *opt;
|
||||
bool reload;
|
||||
int gui_scale;
|
||||
static inline int active_tab = WID_GO_TAB_GENERAL;
|
||||
static inline WidgetID active_tab = WID_GO_TAB_GENERAL;
|
||||
|
||||
enum class QueryTextItem {
|
||||
None,
|
||||
@@ -217,7 +217,7 @@ struct GameOptionsWindow : Window {
|
||||
* @param selected_index Currently selected item
|
||||
* @return the built dropdown list, or nullptr if the widget has no dropdown menu.
|
||||
*/
|
||||
DropDownList BuildDropDownList(int widget, int *selected_index) const
|
||||
DropDownList BuildDropDownList(WidgetID widget, int *selected_index) const
|
||||
{
|
||||
DropDownList list;
|
||||
switch (widget) {
|
||||
@@ -322,7 +322,7 @@ struct GameOptionsWindow : Window {
|
||||
return list;
|
||||
}
|
||||
|
||||
void SetStringParameters(int widget) const override
|
||||
void SetStringParameters(WidgetID widget) const override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_GO_CURRENCY_DROPDOWN: {
|
||||
@@ -369,7 +369,7 @@ struct GameOptionsWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
void DrawWidget(const Rect &r, WidgetID widget) const override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_GO_BASE_GRF_DESCRIPTION:
|
||||
@@ -406,7 +406,7 @@ struct GameOptionsWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
void SetTab(int widget)
|
||||
void SetTab(WidgetID widget)
|
||||
{
|
||||
this->SetWidgetsLoweredState(false, WID_GO_TAB_GENERAL, WID_GO_TAB_GRAPHICS, WID_GO_TAB_SOUND);
|
||||
this->LowerWidget(widget);
|
||||
@@ -455,7 +455,7 @@ struct GameOptionsWindow : Window {
|
||||
if (changed) this->ReInit(0, 0, this->flags & WF_CENTERED);
|
||||
}
|
||||
|
||||
void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
|
||||
void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_GO_TEXT_SFX_VOLUME:
|
||||
@@ -475,7 +475,7 @@ struct GameOptionsWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override
|
||||
void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
|
||||
{
|
||||
if (widget >= WID_GO_BASE_GRF_TEXTFILE && widget < WID_GO_BASE_GRF_TEXTFILE + TFT_CONTENT_END) {
|
||||
if (BaseGraphics::GetUsedSet() == nullptr) return;
|
||||
@@ -676,7 +676,7 @@ struct GameOptionsWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
void OnDropdownSelect(int widget, int index) override
|
||||
void OnDropdownSelect(WidgetID widget, int index) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_GO_CURRENCY_DROPDOWN: // Currency
|
||||
@@ -2602,7 +2602,7 @@ struct GameSettingsWindow : Window {
|
||||
_circle_size = maxdim(GetSpriteSize(SPR_CIRCLE_FOLDED), GetSpriteSize(SPR_CIRCLE_UNFOLDED));
|
||||
}
|
||||
|
||||
void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
|
||||
void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_GS_OPTIONSPANEL:
|
||||
@@ -2670,7 +2670,7 @@ struct GameSettingsWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
void SetStringParameters(int widget) const override
|
||||
void SetStringParameters(WidgetID widget) const override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_GS_RESTRICT_DROPDOWN:
|
||||
@@ -2688,7 +2688,7 @@ struct GameSettingsWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
DropDownList BuildDropDownList(int widget) const
|
||||
DropDownList BuildDropDownList(WidgetID widget) const
|
||||
{
|
||||
DropDownList list;
|
||||
switch (widget) {
|
||||
@@ -2712,7 +2712,7 @@ struct GameSettingsWindow : Window {
|
||||
return list;
|
||||
}
|
||||
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
void DrawWidget(const Rect &r, WidgetID widget) const override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_GS_OPTIONSPANEL: {
|
||||
@@ -2783,7 +2783,7 @@ struct GameSettingsWindow : Window {
|
||||
this->last_clicked = pe;
|
||||
}
|
||||
|
||||
void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override
|
||||
void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_GS_EXPAND_ALL:
|
||||
@@ -3034,7 +3034,7 @@ struct GameSettingsWindow : Window {
|
||||
this->SetDirty();
|
||||
}
|
||||
|
||||
void OnDropdownSelect(int widget, int index) override
|
||||
void OnDropdownSelect(WidgetID widget, int index) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_GS_RESTRICT_DROPDOWN:
|
||||
@@ -3071,7 +3071,7 @@ struct GameSettingsWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
void OnDropdownClose(Point pt, int widget, int index, bool instant_close) override
|
||||
void OnDropdownClose(Point pt, WidgetID widget, int index, bool instant_close) override
|
||||
{
|
||||
if (widget != WID_GS_SETTING_DROPDOWN) {
|
||||
/* Normally the default implementation of OnDropdownClose() takes care of
|
||||
@@ -3120,7 +3120,7 @@ struct GameSettingsWindow : Window {
|
||||
this->SetWidgetDisabledState(WID_GS_COLLAPSE_ALL, all_folded);
|
||||
}
|
||||
|
||||
void OnEditboxChanged(int wid) override
|
||||
void OnEditboxChanged(WidgetID wid) override
|
||||
{
|
||||
if (wid == WID_GS_FILTER) {
|
||||
this->filter.string.SetFilterTerm(this->filter_editbox.text.buf);
|
||||
@@ -3283,7 +3283,7 @@ struct CustomCurrencyWindow : Window {
|
||||
this->SetWidgetDisabledState(WID_CC_YEAR_UP, _custom_currency.to_euro == MAX_YEAR);
|
||||
}
|
||||
|
||||
void SetStringParameters(int widget) const override
|
||||
void SetStringParameters(WidgetID widget) const override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_CC_RATE: SetDParam(0, 1); SetDParam(1, 1); break;
|
||||
@@ -3301,7 +3301,7 @@ struct CustomCurrencyWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
|
||||
void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
|
||||
{
|
||||
switch (widget) {
|
||||
/* Set the appropriate width for the up/down buttons. */
|
||||
@@ -3328,7 +3328,7 @@ struct CustomCurrencyWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override
|
||||
void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override
|
||||
{
|
||||
int line = 0;
|
||||
int len = 0;
|
||||
|
Reference in New Issue
Block a user