1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 03:23:15 +01:00

Fix #385, made widget_is_enabled return 1 if true

This commit is contained in:
adrian17
2014-08-30 14:31:36 +02:00
parent 7d336c440c
commit 4d29aaa6bd
3 changed files with 6 additions and 9 deletions

View File

@@ -530,11 +530,8 @@ static void input_leftmousedown(int x, int y, rct_window *w, int widgetIndex)
}
break;
default:
// comment check as it disables the rotate station/building button in construction window
// if (!widget_is_enabled(w, widgetIndex))
// break;
if (widget_is_disabled(w, widgetIndex))
break;
if (!widget_is_enabled(w, widgetIndex))
break;
sound_play_panned(SOUND_CLICK_1, w->x + (widget->left + widget->right) / 2);

View File

@@ -946,12 +946,12 @@ static void widget_draw_image(rct_drawpixelinfo *dpi, rct_window *w, int widgetI
int widget_is_enabled(rct_window *w, int widgetIndex)
{
return w->enabled_widgets & (1LL << widgetIndex);
return (w->enabled_widgets & (1LL << widgetIndex)) ? 1 : 0;
}
int widget_is_disabled(rct_window *w, int widgetIndex)
{
return w->disabled_widgets & (1LL << widgetIndex);
return (w->disabled_widgets & (1LL << widgetIndex)) ? 1 : 0;
}
int widget_is_pressed(rct_window *w, int widgetIndex)

View File

@@ -1150,7 +1150,7 @@ void window_draw_widgets(rct_window *w, rct_drawpixelinfo *dpi)
if ((w->flags & WF_TRANSPARENT) && !(w->flags & WF_5))
gfx_fill_rect(dpi, w->x, w->y, w->x + w->width - 1, w->y + w->height - 1, 0x2000000 | 51);
//some code missing here? Between 006EB18C and 006EB260
//todo: some code missing here? Between 006EB18C and 006EB260
widgetIndex = 0;
for (widget = w->widgets; widget->type != WWT_LAST; widget++) {
@@ -1162,7 +1162,7 @@ void window_draw_widgets(rct_window *w, rct_drawpixelinfo *dpi)
widgetIndex++;
}
//something missing here too? Between 006EC32B and 006EC369
//todo: something missing here too? Between 006EC32B and 006EC369
if (w->flags & WF_WHITE_BORDER_MASK) {
gfx_fill_rect_inset(dpi, w->x, w->y, w->x + w->width - 1, w->y + w->height - 1, 2, 0x10);