mirror of https://github.com/OpenRCT2/OpenRCT2.git
Added window_align_tabs
New cross window compatible version. For window_park and window_peep.
This commit is contained in:
parent
d3455b8f22
commit
5bdff85db1
16
src/window.c
16
src/window.c
|
@ -1495,4 +1495,18 @@ void RCT2_CALLPROC_WE_MOUSE_DOWN(int address, int widgetIndex, rct_window*w, rc
|
|||
" :[address] "+m" (address), [w] "+m" (w), [widget] "+m" (widget), [widgetIndex] "+m" (widgetIndex): : "eax", "esi", "edx", "edi"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/* Based on rct2: 0x6987ED and another version from window_park */
|
||||
void window_align_tabs( rct_window *w, uint8 start_tab_id, uint8 end_tab_id )
|
||||
int x = w->widgets[start_tab_id].left;
|
||||
int tab_width = w->widgets[start_tab_id].right - w->widgets[start_tab_id].left;
|
||||
|
||||
for (int i = start_tab_id; i < end_tab_id; ++i){
|
||||
if ( !(w->disabled_widgets & (1LL << i)) ){
|
||||
w->widgets[i].left = x;
|
||||
w->widgets[i].right = x + tab_width;
|
||||
x += tab_width + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue