1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Close #13376: Open custom window at specified tab

This commit is contained in:
Sadret
2020-11-05 17:43:23 +01:00
committed by GitHub
parent eea57f2bfe
commit 2f4b1b9e3f
4 changed files with 11 additions and 4 deletions

View File

@@ -1,9 +1,10 @@
0.3.2+ (in development)
------------------------------------------------------------------------
- Feature: [#13057] Make GameAction flags accessible by plugins.
- Change: [#13346] Change FootpathScenery to FootpathAddition in all occurrences
- Fix: [#13334] Uninitialised variables in CustomTabDesc
- Fix: [#13342] Rename tabChange to onTabChange in WindowDesc interface
- Feature: [#13376] Open custom window at specified tab.
- Change: [#13346] Change FootpathScenery to FootpathAddition in all occurrences.
- Fix: [#13334] Uninitialised variables in CustomTabDesc.
- Fix: [#13342] Rename tabChange to onTabChange in WindowDesc interface.
- Improved: [#12917] Changed peep movement so that they stay more spread out over the full width of single tile paths.
0.3.2 (2020-11-01)

View File

@@ -1866,6 +1866,7 @@ declare global {
widgets?: Widget[];
colours?: number[];
tabs?: WindowTabDesc[];
tabIndex: number;
onClose?: () => void;
onUpdate?: () => void;

View File

@@ -244,6 +244,7 @@ namespace OpenRCT2::Ui::Windows
std::vector<CustomWidgetDesc> Widgets;
std::vector<colour_t> Colours;
std::vector<CustomTabDesc> Tabs;
std::optional<int32_t> TabIndex;
// Event handlers
DukValue OnClose;
@@ -271,6 +272,7 @@ namespace OpenRCT2::Ui::Windows
result.MaxHeight = GetOptionalInt(desc["maxHeight"]);
result.Title = language_convert_string(desc["title"].as_string());
result.Id = GetOptionalInt(desc["id"]);
result.TabIndex = GetOptionalInt(desc["tabIndex"]);
if (desc["widgets"].is_array())
{
@@ -392,6 +394,9 @@ namespace OpenRCT2::Ui::Windows
window->custom_info = new CustomWindowInfo(owner, desc);
window->enabled_widgets = (1 << WIDX_CLOSE);
// Set window tab
window->page = desc.TabIndex.value_or(0);
// Set window colours
window->colours[0] = COLOUR_GREY;
window->colours[1] = COLOUR_GREY;

View File

@@ -43,7 +43,7 @@
using namespace OpenRCT2;
using namespace OpenRCT2::Scripting;
static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 9;
static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 10;
struct ExpressionStringifier final
{