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:
@@ -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)
|
||||
|
||||
1
distribution/openrct2.d.ts
vendored
1
distribution/openrct2.d.ts
vendored
@@ -1866,6 +1866,7 @@ declare global {
|
||||
widgets?: Widget[];
|
||||
colours?: number[];
|
||||
tabs?: WindowTabDesc[];
|
||||
tabIndex: number;
|
||||
|
||||
onClose?: () => void;
|
||||
onUpdate?: () => void;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user