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:
6
distribution/openrct2.d.ts
vendored
6
distribution/openrct2.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user