1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Remove holdable flag from spinner widget

This commit is contained in:
Ted John
2021-02-25 22:30:35 +00:00
parent f7650fdfbc
commit e000f06442
3 changed files with 1 additions and 31 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -878,29 +878,8 @@ namespace OpenRCT2::Scripting
static void Register(duk_context* ctx)
{
dukglue_set_base_class<ScWidget, ScSpinnerWidget>(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