mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-18 04:23:20 +01:00
Add a few more properties
This commit is contained in:
@@ -366,13 +366,35 @@ namespace OpenRCT2::Scripting
|
||||
static void Register(duk_context* ctx)
|
||||
{
|
||||
dukglue_set_base_class<ScWidget, ScListViewWidget>(ctx);
|
||||
dukglue_register_property(ctx, &ScListViewWidget::canSelect_get, &ScListViewWidget::canSelect_set, "canSelect");
|
||||
dukglue_register_property(ctx, &ScListViewWidget::isStriped_get, &ScListViewWidget::isStriped_set, "isStriped");
|
||||
dukglue_register_property(
|
||||
ctx, &ScListViewWidget::showColumnHeaders_get, &ScListViewWidget::showColumnHeaders_set, "showColumnHeaders");
|
||||
dukglue_register_property(ctx, &ScListViewWidget::highlightedCell_get, nullptr, "highlightedCell");
|
||||
dukglue_register_property(
|
||||
ctx, &ScListViewWidget::selectedCell_get, &ScListViewWidget::selectedCell_set, "selectedCell");
|
||||
}
|
||||
|
||||
private:
|
||||
bool canSelect_get() const
|
||||
{
|
||||
auto listView = GetListView();
|
||||
if (listView != nullptr)
|
||||
{
|
||||
return listView->CanSelect;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void canSelect_set(bool value)
|
||||
{
|
||||
auto listView = GetListView();
|
||||
if (listView != nullptr)
|
||||
{
|
||||
listView->CanSelect = value;
|
||||
}
|
||||
}
|
||||
|
||||
bool isStriped_get() const
|
||||
{
|
||||
auto listView = GetListView();
|
||||
@@ -392,6 +414,25 @@ namespace OpenRCT2::Scripting
|
||||
}
|
||||
}
|
||||
|
||||
bool showColumnHeaders_get() const
|
||||
{
|
||||
auto listView = GetListView();
|
||||
if (listView != nullptr)
|
||||
{
|
||||
return listView->ShowColumnHeaders;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void showColumnHeaders_set(bool value)
|
||||
{
|
||||
auto listView = GetListView();
|
||||
if (listView != nullptr)
|
||||
{
|
||||
listView->ShowColumnHeaders = value;
|
||||
}
|
||||
}
|
||||
|
||||
DukValue highlightedCell_get()
|
||||
{
|
||||
auto ctx = GetContext()->GetScriptEngine().GetContext();
|
||||
|
||||
Reference in New Issue
Block a user