mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Name rct_window's var_494: highlighted_item.
This commit is contained in:
@@ -264,7 +264,7 @@ typedef struct rct_window {
|
||||
uint16 frame_no; // 0x48E updated every tic for motion in windows sprites
|
||||
uint16 list_information_type; // 0x490 0 for none, Used as current position of marquee in window_peep
|
||||
sint16 var_492;
|
||||
uint32 var_494; // 0x494 highlighted item?
|
||||
uint32 highlighted_item; // 0x494
|
||||
uint8 var_498[0x14];
|
||||
sint16 selected_tab; // 0x4AC
|
||||
sint16 var_4AE;
|
||||
|
||||
@@ -155,7 +155,7 @@ static rct_window_event_list window_editor_inventions_list_drag_events = {
|
||||
|
||||
rct_research_item *_editorInventionsListDraggedItem;
|
||||
|
||||
#define WindowHighlightedItem(w) *((rct_research_item**)&(w->var_494))
|
||||
#define WindowHighlightedItem(w) *((rct_research_item**)&(w->highlighted_item))
|
||||
|
||||
static void window_editor_inventions_list_drag_open(rct_research_item *researchItem);
|
||||
static void move_research_item(rct_research_item *beforeItem);
|
||||
|
||||
@@ -419,7 +419,7 @@ void window_editor_object_selection_open()
|
||||
window->var_4AE = 0;
|
||||
window->selected_tab = 0;
|
||||
window->selected_list_item = -1;
|
||||
window->var_494 = 0xFFFFFFFF;
|
||||
window->highlighted_item = 0xFFFFFFFF;
|
||||
window->min_width = 600;
|
||||
window->min_height = 400;
|
||||
window->max_width = 1200;
|
||||
@@ -836,7 +836,7 @@ static void window_editor_object_selection_mouseup(rct_window *w, int widgetInde
|
||||
visible_list_refresh(w);
|
||||
|
||||
w->selected_list_item = -1;
|
||||
w->var_494 = 0xFFFFFFFF;
|
||||
w->highlighted_item = 0xFFFFFFFF;
|
||||
w->scrolls[0].v_top = 0;
|
||||
object_free_scenario_text();
|
||||
window_invalidate(w);
|
||||
@@ -856,7 +856,7 @@ static void window_editor_object_selection_mouseup(rct_window *w, int widgetInde
|
||||
visible_list_refresh(w);
|
||||
|
||||
w->selected_list_item = -1;
|
||||
w->var_494 = 0xFFFFFFFF;
|
||||
w->highlighted_item = 0xFFFFFFFF;
|
||||
w->scrolls[0].v_top = 0;
|
||||
object_free_scenario_text();
|
||||
window_invalidate(w);
|
||||
@@ -1051,7 +1051,7 @@ static void window_editor_object_selection_scroll_mouseover(rct_window *w, int s
|
||||
return;
|
||||
|
||||
w->selected_list_item = selectedObject;
|
||||
w->var_494 = (uint32)installedEntry;
|
||||
w->highlighted_item = (uint32)installedEntry;
|
||||
object_free_scenario_text();
|
||||
if (selectedObject != -1)
|
||||
object_get_scenario_text(installedEntry);
|
||||
@@ -1342,7 +1342,7 @@ static void window_editor_object_selection_paint(rct_window *w, rct_drawpixelinf
|
||||
if (w->selected_list_item == -1 || stex_entry == NULL)
|
||||
return;
|
||||
|
||||
highlightedEntry = (rct_object_entry*)w->var_494;
|
||||
highlightedEntry = (rct_object_entry*)w->highlighted_item;
|
||||
type = highlightedEntry->flags & 0x0F;
|
||||
|
||||
// Draw preview
|
||||
@@ -1458,7 +1458,7 @@ static void window_editor_object_selection_scrollpaint(rct_window *w, rct_drawpi
|
||||
|
||||
// Highlight background
|
||||
colour = 142;
|
||||
if (listItem->entry == (rct_object_entry*)w->var_494 && !(*listItem->flags & OBJECT_SELECTION_FLAG_6)) {
|
||||
if (listItem->entry == (rct_object_entry*)w->highlighted_item && !(*listItem->flags & OBJECT_SELECTION_FLAG_6)) {
|
||||
gfx_fill_rect(dpi, 0, y, w->width, y + 11, 0x2000031);
|
||||
colour = 14;
|
||||
}
|
||||
@@ -1515,7 +1515,7 @@ static void window_editor_object_set_page(rct_window *w, int page)
|
||||
|
||||
w->selected_tab = page;
|
||||
w->selected_list_item = -1;
|
||||
w->var_494 = 0xFFFFFFFF;
|
||||
w->highlighted_item = 0xFFFFFFFF;
|
||||
w->scrolls[0].v_top = 0;
|
||||
object_free_scenario_text();
|
||||
|
||||
|
||||
@@ -504,7 +504,7 @@ void window_guest_open(rct_peep* peep){
|
||||
window->frame_no = 0;
|
||||
window->list_information_type = 0;
|
||||
window->var_492 = 0;
|
||||
window->var_494 = 0;
|
||||
window->highlighted_item = 0;
|
||||
window_guest_disable_widgets(window);
|
||||
window->min_width = 192;
|
||||
window->min_height = 157;
|
||||
@@ -835,7 +835,7 @@ void window_guest_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dpi){
|
||||
int eax = 0;
|
||||
|
||||
if (w->page == WINDOW_GUEST_OVERVIEW){
|
||||
eax = w->var_494>>16;
|
||||
eax = w->highlighted_item>>16;
|
||||
eax &= 0xFFFC;
|
||||
}
|
||||
ebx += eax;
|
||||
@@ -1111,27 +1111,27 @@ void window_guest_overview_invalidate(rct_window *w)
|
||||
* rct2: 0x696F45
|
||||
*/
|
||||
void window_guest_overview_update(rct_window* w){
|
||||
int var_496 = w->var_494 >> 16;
|
||||
int var_496 = w->highlighted_item >> 16;
|
||||
var_496++;
|
||||
var_496 %= 24;
|
||||
w->var_494 &= 0x0000FFFF;
|
||||
w->var_494 |= var_496 << 16;
|
||||
w->highlighted_item &= 0x0000FFFF;
|
||||
w->highlighted_item |= var_496 << 16;
|
||||
|
||||
widget_invalidate(w, WIDX_TAB_1);
|
||||
widget_invalidate(w, WIDX_TAB_2);
|
||||
|
||||
w->list_information_type += 2;
|
||||
|
||||
if ((w->var_494 & 0xFFFF) == 0xFFFF)
|
||||
w->var_494 &= 0xFFFF0000;
|
||||
if ((w->highlighted_item & 0xFFFF) == 0xFFFF)
|
||||
w->highlighted_item &= 0xFFFF0000;
|
||||
else
|
||||
w->var_494++;
|
||||
w->highlighted_item++;
|
||||
|
||||
// Disable peep watching thought for multiplayer as its client specific
|
||||
if (network_get_mode() == NETWORK_MODE_NONE) {
|
||||
// Create the "I have the strangest feeling I am being watched thought"
|
||||
if ((w->var_494 & 0xFFFF) >= 3840) {
|
||||
if (!(w->var_494 & 0x3FF)) {
|
||||
if ((w->highlighted_item & 0xFFFF) >= 3840) {
|
||||
if (!(w->highlighted_item & 0x3FF)) {
|
||||
int random = util_rand() & 0xFFFF;
|
||||
if (random <= 0x2AAA) {
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
|
||||
@@ -1183,7 +1183,7 @@ rct_window *window_ride_open(int rideIndex)
|
||||
w->frame_no = 0;
|
||||
w->list_information_type = 0;
|
||||
w->var_492 = 0;
|
||||
w->var_494 = 0;
|
||||
w->highlighted_item = 0;
|
||||
window_ride_disable_tabs(w);
|
||||
w->min_width = 316;
|
||||
w->min_height = 180;
|
||||
@@ -3722,7 +3722,7 @@ static void window_ride_set_track_colour_scheme(rct_window *w, int x, int y)
|
||||
uint8 newColourScheme;
|
||||
int interactionType, z, direction;
|
||||
|
||||
newColourScheme = (uint8)(*((uint16*)&w->var_494));
|
||||
newColourScheme = (uint8)(*((uint16*)&w->highlighted_item));
|
||||
|
||||
rct_xy16 mapCoord = { 0 };
|
||||
get_map_coordinates_from_pos(x, y, VIEWPORT_INTERACTION_MASK_RIDE, &mapCoord.x, &mapCoord.y, &interactionType, &mapElement, NULL);
|
||||
@@ -3812,7 +3812,7 @@ static void window_ride_colour_mousedown(int widgetIndex, rct_window *w, rct_wid
|
||||
|
||||
ride = GET_RIDE(w->number);
|
||||
rideEntry = ride_get_entry(ride);
|
||||
colourSchemeIndex = *((uint16*)&w->var_494);
|
||||
colourSchemeIndex = *((uint16*)&w->highlighted_item);
|
||||
dropdownWidget = widget - 1;
|
||||
|
||||
switch (widgetIndex) {
|
||||
@@ -3952,20 +3952,20 @@ static void window_ride_colour_dropdown(rct_window *w, int widgetIndex, int drop
|
||||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_TRACK_COLOUR_SCHEME_DROPDOWN:
|
||||
*((uint16*)&w->var_494) = dropdownIndex;
|
||||
*((uint16*)&w->highlighted_item) = dropdownIndex;
|
||||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_TRACK_MAIN_COLOUR:
|
||||
game_do_command(0, (0 << 8) | 1, 0, (dropdownIndex << 8) | w->number, GAME_COMMAND_SET_RIDE_APPEARANCE, *((uint16*)&w->var_494), 0);
|
||||
game_do_command(0, (0 << 8) | 1, 0, (dropdownIndex << 8) | w->number, GAME_COMMAND_SET_RIDE_APPEARANCE, *((uint16*)&w->highlighted_item), 0);
|
||||
break;
|
||||
case WIDX_TRACK_ADDITIONAL_COLOUR:
|
||||
game_do_command(0, (1 << 8) | 1, 0, (dropdownIndex << 8) | w->number, GAME_COMMAND_SET_RIDE_APPEARANCE, *((uint16*)&w->var_494), 0);
|
||||
game_do_command(0, (1 << 8) | 1, 0, (dropdownIndex << 8) | w->number, GAME_COMMAND_SET_RIDE_APPEARANCE, *((uint16*)&w->highlighted_item), 0);
|
||||
break;
|
||||
case WIDX_TRACK_SUPPORT_COLOUR:
|
||||
game_do_command(0, (4 << 8) | 1, 0, (dropdownIndex << 8) | w->number, GAME_COMMAND_SET_RIDE_APPEARANCE, *((uint16*)&w->var_494), 0);
|
||||
game_do_command(0, (4 << 8) | 1, 0, (dropdownIndex << 8) | w->number, GAME_COMMAND_SET_RIDE_APPEARANCE, *((uint16*)&w->highlighted_item), 0);
|
||||
break;
|
||||
case WIDX_MAZE_STYLE_DROPDOWN:
|
||||
game_do_command(0, (4 << 8) | 1, 0, (dropdownIndex << 8) | w->number, GAME_COMMAND_SET_RIDE_APPEARANCE, *((uint16*)&w->var_494), 0);
|
||||
game_do_command(0, (4 << 8) | 1, 0, (dropdownIndex << 8) | w->number, GAME_COMMAND_SET_RIDE_APPEARANCE, *((uint16*)&w->highlighted_item), 0);
|
||||
break;
|
||||
case WIDX_ENTRANCE_STYLE_DROPDOWN:
|
||||
game_do_command(0, (6 << 8) | 1, 0, (window_ride_entrance_style_list[dropdownIndex] << 8) | w->number, GAME_COMMAND_SET_RIDE_APPEARANCE, 0, 0);
|
||||
@@ -4052,7 +4052,7 @@ static void window_ride_colour_invalidate(rct_window *w)
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint32) = ride->name_arguments;
|
||||
|
||||
// Track colours
|
||||
int colourScheme = *((uint16*)&w->var_494);
|
||||
int colourScheme = *((uint16*)&w->highlighted_item);
|
||||
trackColour = ride_get_track_colour(ride, colourScheme);
|
||||
|
||||
// Maze style
|
||||
@@ -4221,7 +4221,7 @@ static void window_ride_colour_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
if (widget->type != WWT_EMPTY)
|
||||
gfx_fill_rect(dpi, w->x + widget->left + 1, w->y + widget->top + 1, w->x + widget->right - 1, w->y + widget->bottom - 1, 12);
|
||||
|
||||
trackColour = ride_get_track_colour(ride, *((uint16*)&w->var_494));
|
||||
trackColour = ride_get_track_colour(ride, *((uint16*)&w->highlighted_item));
|
||||
|
||||
//
|
||||
if (rideEntry->shop_item == 0xFF) {
|
||||
|
||||
@@ -309,8 +309,7 @@ rct_window *window_staff_open(rct_peep* peep)
|
||||
w->page = 0;
|
||||
w->viewport_focus_coordinates.y = 0;
|
||||
w->frame_no = 0;
|
||||
|
||||
RCT2_GLOBAL((int*)w + 0x496, uint16) = 0; // missing, var_494 should perhaps be uint16?
|
||||
w->highlighted_item = 0;
|
||||
|
||||
window_staff_disable_widgets(w);
|
||||
|
||||
@@ -993,7 +992,7 @@ void window_staff_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
int eax = 0;
|
||||
|
||||
if (w->page == WINDOW_STAFF_OVERVIEW){
|
||||
eax = w->var_494 >> 16;
|
||||
eax = w->highlighted_item >> 16;
|
||||
eax &= 0xFFFC;
|
||||
}
|
||||
ebx += eax;
|
||||
|
||||
@@ -125,7 +125,7 @@ void window_scenarioselect_open()
|
||||
window->enabled_widgets = 0x04 | 0x10 | 0x20 | 0x40 | 0x80 | 0x100;
|
||||
window_init_scroll_widgets(window);
|
||||
window->viewport_focus_coordinates.var_480 = -1;
|
||||
window->var_494 = 0;
|
||||
window->highlighted_item = 0;
|
||||
|
||||
window_scenarioselect_init_tabs();
|
||||
|
||||
@@ -174,7 +174,7 @@ static void window_scenarioselect_mousedown(int widgetIndex, rct_window*w, rct_w
|
||||
{
|
||||
if (widgetIndex >= WIDX_TAB1 && widgetIndex <= WIDX_TAB5) {
|
||||
w->selected_tab = widgetIndex - 4;
|
||||
w->var_494 = 0;
|
||||
w->highlighted_item = 0;
|
||||
window_invalidate(w);
|
||||
window_event_resize_call(w);
|
||||
window_event_invalidate_call(w);
|
||||
@@ -248,8 +248,8 @@ static void window_scenarioselect_scrollmouseover(rct_window *w, int scrollIndex
|
||||
selected = scenario;
|
||||
break;
|
||||
}
|
||||
if (w->var_494 != (uint32)selected) {
|
||||
w->var_494 = (uint32)selected;
|
||||
if (w->highlighted_item != (uint32)selected) {
|
||||
w->highlighted_item = (uint32)selected;
|
||||
window_invalidate(w);
|
||||
}
|
||||
}
|
||||
@@ -285,7 +285,7 @@ static void window_scenarioselect_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
}
|
||||
|
||||
// Return if no scenario highlighted
|
||||
scenario = (rct_scenario_basic*)w->var_494;
|
||||
scenario = (rct_scenario_basic*)w->highlighted_item;
|
||||
if (scenario == NULL)
|
||||
return;
|
||||
|
||||
@@ -341,7 +341,7 @@ static void window_scenarioselect_scrollpaint(rct_window *w, rct_drawpixelinfo *
|
||||
if (y > dpi->y + dpi->height)
|
||||
continue;
|
||||
|
||||
highlighted = w->var_494 == (int)scenario;
|
||||
highlighted = w->highlighted_item == (int)scenario;
|
||||
|
||||
// Draw hover highlight
|
||||
if (highlighted)
|
||||
|
||||
Reference in New Issue
Block a user