2020-02-14 23:36:24 +00:00
|
|
|
/*****************************************************************************
|
2026-01-05 14:42:59 +01:00
|
|
|
* Copyright (c) 2014-2026 OpenRCT2 developers
|
2020-02-14 23:36:24 +00:00
|
|
|
*
|
|
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
|
|
|
|
*
|
|
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
2020-02-23 15:33:01 +00:00
|
|
|
#pragma once
|
2020-02-14 23:36:24 +00:00
|
|
|
|
2020-04-24 15:58:01 +01:00
|
|
|
#ifdef ENABLE_SCRIPTING
|
2020-02-23 15:33:01 +00:00
|
|
|
|
2024-11-29 12:04:56 +09:00
|
|
|
#include <memory>
|
|
|
|
|
#include <optional>
|
|
|
|
|
#include <string_view>
|
2020-02-14 23:36:24 +00:00
|
|
|
|
|
|
|
|
namespace OpenRCT2::Ui::Windows
|
|
|
|
|
{
|
2020-05-06 20:39:57 +01:00
|
|
|
class CustomListView;
|
|
|
|
|
|
2023-01-21 19:57:17 +00:00
|
|
|
std::string GetWindowTitle(WindowBase* w);
|
|
|
|
|
void UpdateWindowTitle(WindowBase* w, std::string_view value);
|
|
|
|
|
void UpdateWindowTab(WindowBase* w, int32_t tabIndex);
|
2026-02-24 18:49:07 -03:00
|
|
|
void UpdateWidgetText(WindowBase* w, WidgetIndex widget, std::string_view value);
|
2023-01-21 19:57:17 +00:00
|
|
|
void UpdateWidgetItems(WindowBase* w, WidgetIndex widgetIndex, const std::vector<std::string>& items);
|
2026-01-28 10:06:45 +01:00
|
|
|
void UpdateWidgetColour(WindowBase* w, WidgetIndex widgetIndex, Drawing::Colour colour);
|
2023-01-21 19:57:17 +00:00
|
|
|
void UpdateWidgetSelectedIndex(WindowBase* w, WidgetIndex widgetIndex, int32_t selectedIndex);
|
|
|
|
|
std::vector<std::string> GetWidgetItems(WindowBase* w, WidgetIndex widgetIndex);
|
2026-01-28 10:06:45 +01:00
|
|
|
Drawing::Colour GetWidgetColour(WindowBase* w, WidgetIndex widgetIndex);
|
2023-01-21 19:57:17 +00:00
|
|
|
int32_t GetWidgetSelectedIndex(WindowBase* w, WidgetIndex widgetIndex);
|
|
|
|
|
WindowBase* FindCustomWindowByClassification(std::string_view classification);
|
|
|
|
|
std::optional<WidgetIndex> FindWidgetIndexByName(WindowBase* w, std::string_view name);
|
|
|
|
|
std::string GetWidgetName(WindowBase* w, WidgetIndex widgetIndex);
|
|
|
|
|
void SetWidgetName(WindowBase* w, WidgetIndex widgetIndex, std::string_view name);
|
|
|
|
|
std::string GetWidgetTooltip(WindowBase* w, WidgetIndex widgetIndex);
|
|
|
|
|
void SetWidgetTooltip(WindowBase* w, WidgetIndex widgetIndex, std::string_view tooltip);
|
|
|
|
|
CustomListView* GetCustomListView(WindowBase* w, WidgetIndex widgetIndex);
|
|
|
|
|
int32_t GetWidgetMaxLength(WindowBase* w, WidgetIndex widgetIndex);
|
|
|
|
|
void SetWidgetMaxLength(WindowBase* w, WidgetIndex widgetIndex, int32_t value);
|
2025-09-29 02:05:00 +10:00
|
|
|
void CloseWindowsOwnedByPlugin(std::shared_ptr<Scripting::Plugin> plugin);
|
|
|
|
|
WindowBase* WindowCustomOpen(JSContext* ctx, std::shared_ptr<Scripting::Plugin> owner, JSValue descVal);
|
2020-02-22 13:29:18 +00:00
|
|
|
} // namespace OpenRCT2::Ui::Windows
|
2020-02-23 15:33:01 +00:00
|
|
|
|
|
|
|
|
#endif
|