diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index 421322eb84..d190ba67bd 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -2126,12 +2126,6 @@ declare global { type: 'spinner'; text?: string; - /** - * If true, the user can click and hold the decrement and increment - * button for repeated calls. - */ - isHoldable?: boolean; - onDecrement?: () => void; onIncrement?: () => void; onClick?: () => void; diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index 685994b1f8..673c90a224 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -77,7 +77,6 @@ namespace OpenRCT2::Ui::Windows bool IsDisabled{}; bool IsVisible{}; bool IsPressed{}; - bool IsHoldable{}; bool HasBorder{}; bool ShowColumnHeaders{}; bool IsStriped{}; @@ -181,7 +180,6 @@ namespace OpenRCT2::Ui::Windows } else if (result.Type == "spinner") { - result.IsHoldable = AsOrDefault(desc["isHoldable"], false); result.Text = ProcessString(desc["text"]); result.OnIncrement = desc["onIncrement"]; result.OnDecrement = desc["onDecrement"]; @@ -1123,8 +1121,7 @@ namespace OpenRCT2::Ui::Windows widget.flags |= WIDGET_FLAGS::IS_ENABLED; if (desc.IsDisabled) widget.flags |= WIDGET_FLAGS::IS_DISABLED; - if (desc.IsHoldable) - widget.flags |= WIDGET_FLAGS::IS_HOLDABLE; + widget.flags |= WIDGET_FLAGS::IS_HOLDABLE; widgetList.push_back(widget); // Add the increment button diff --git a/src/openrct2-ui/scripting/ScWidget.hpp b/src/openrct2-ui/scripting/ScWidget.hpp index 7be75bf5a0..cc719a8312 100644 --- a/src/openrct2-ui/scripting/ScWidget.hpp +++ b/src/openrct2-ui/scripting/ScWidget.hpp @@ -878,29 +878,8 @@ namespace OpenRCT2::Scripting static void Register(duk_context* ctx) { dukglue_set_base_class(ctx); - dukglue_register_property(ctx, &ScSpinnerWidget::isHoldable_get, &ScSpinnerWidget::isHoldable_set, "isHoldable"); dukglue_register_property(ctx, &ScSpinnerWidget::text_get, &ScSpinnerWidget::text_set, "text"); } - - private: - int32_t isHoldable_get() const - { - auto w = GetWindow(); - if (w != nullptr) - { - return WidgetIsHoldable(w, _widgetIndex); - } - return false; - } - - void isHoldable_set(int32_t value) - { - auto w = GetWindow(); - if (w != nullptr) - { - WidgetSetHoldable(w, _widgetIndex, value); - } - } }; class ScTextBoxWidget : public ScWidget