Remove custom window widget limit

This commit is contained in:
Ted John 2022-02-12 22:58:40 +00:00
parent da89a4e413
commit 05b589fb93
1 changed files with 17 additions and 2 deletions

View File

@ -841,11 +841,15 @@ static void WidgetDrawImage(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetind
bool WidgetIsDisabled(rct_window* w, rct_widgetindex widgetIndex)
{
if (w->classification == WC_CUSTOM)
return w->widgets[widgetIndex].flags & WIDGET_FLAGS::IS_DISABLED;
return (w->disabled_widgets & (1LL << widgetIndex)) != 0;
}
bool WidgetIsHoldable(rct_window* w, rct_widgetindex widgetIndex)
{
if (w->classification == WC_CUSTOM)
return w->widgets[widgetIndex].flags & WIDGET_FLAGS::IS_HOLDABLE;
return (w->hold_down_widgets & (1LL << widgetIndex)) != 0;
}
@ -856,10 +860,21 @@ bool WidgetIsVisible(rct_window* w, rct_widgetindex widgetIndex)
bool WidgetIsPressed(rct_window* w, rct_widgetindex widgetIndex)
{
if (w->pressed_widgets & (1LL << widgetIndex))
if (w->classification == WC_CUSTOM)
{
return true;
if (w->widgets[widgetIndex].flags & WIDGET_FLAGS::IS_PRESSED)
{
return true;
}
}
else
{
if (w->pressed_widgets & (1LL << widgetIndex))
{
return true;
}
}
if (input_get_state() == InputState::WidgetPressed || input_get_state() == InputState::DropdownActive)
{
if (!(input_test_flag(INPUT_FLAG_WIDGET_PRESSED)))