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:
Jonathan G Rennison
2024-01-02 14:31:56 +00:00
179 changed files with 2191 additions and 1827 deletions

View File

@@ -88,9 +88,9 @@ TextfileWindow::TextfileWindow(TextfileType file_type) : Window(&_textfile_desc)
this->CreateNestedTree();
this->vscroll = this->GetScrollbar(WID_TF_VSCROLLBAR);
this->hscroll = this->GetScrollbar(WID_TF_HSCROLLBAR);
this->FinishInitNested(file_type);
this->GetWidget<NWidgetCore>(WID_TF_CAPTION)->SetDataTip(STR_TEXTFILE_README_CAPTION + file_type, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS);
this->GetWidget<NWidgetStacked>(WID_TF_SEL_JUMPLIST)->SetDisplayedPlane(SZSP_HORIZONTAL);
this->FinishInitNested(file_type);
this->DisableWidget(WID_TF_NAVBACK);
this->DisableWidget(WID_TF_NAVFORWARD);
@@ -128,7 +128,7 @@ uint TextfileWindow::GetContentHeight()
return this->lines.back().bottom;
}
/* virtual */ void TextfileWindow::UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize)
/* virtual */ void TextfileWindow::UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize)
{
switch (widget) {
case WID_TF_BACKGROUND:
@@ -495,7 +495,7 @@ void TextfileWindow::NavigateToFile(std::string newfile, size_t line)
if (StrEndsWithIgnoreCase(this->filename, ".md")) this->AfterLoadMarkdown();
this->GetWidget<NWidgetStacked>(WID_TF_SEL_JUMPLIST)->SetDisplayedPlane(this->jumplist.empty() ? SZSP_HORIZONTAL : 0);
if (this->GetWidget<NWidgetStacked>(WID_TF_SEL_JUMPLIST)->SetDisplayedPlane(this->jumplist.empty() ? SZSP_HORIZONTAL : 0)) this->ReInit();
}
/**
@@ -518,7 +518,7 @@ void TextfileWindow::AfterLoadMarkdown()
}
}
/* virtual */ void TextfileWindow::OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count)
/* virtual */ void TextfileWindow::OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count)
{
switch (widget) {
case WID_TF_WRAPTEXT:
@@ -550,7 +550,7 @@ void TextfileWindow::AfterLoadMarkdown()
}
}
/* virtual */ void TextfileWindow::DrawWidget(const Rect &r, int widget) const
/* virtual */ void TextfileWindow::DrawWidget(const Rect &r, WidgetID widget) const
{
if (widget != WID_TF_BACKGROUND) return;
@@ -594,7 +594,7 @@ void TextfileWindow::AfterLoadMarkdown()
this->SetupScrollbars(true);
}
void TextfileWindow::OnDropdownSelect(int widget, int index)
void TextfileWindow::OnDropdownSelect(WidgetID widget, int index)
{
if (widget != WID_TF_JUMPLIST) return;
@@ -763,8 +763,7 @@ static void Xunzip(byte **bufp, size_t *sizep)
this->lines.clear();
this->jumplist.clear();
this->GetWidget<NWidgetStacked>(WID_TF_SEL_JUMPLIST)->SetDisplayedPlane(SZSP_HORIZONTAL);
this->ReInit();
if (this->GetWidget<NWidgetStacked>(WID_TF_SEL_JUMPLIST)->SetDisplayedPlane(SZSP_HORIZONTAL)) this->ReInit();
if (textfile == nullptr) return;