mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
add global macros for staff colours
This commit is contained in:
@@ -64,7 +64,7 @@ void game_command_update_staff_colour(int *eax, int *ebx, int *ecx, int *edx, in
|
||||
colour = (*edx >> 8) & 0xFF;
|
||||
|
||||
if (*ebx & GAME_COMMAND_FLAG_APPLY) {
|
||||
RCT2_ADDRESS(RCT2_ADDRESS_HANDYMAN_COLOUR, uint8)[staffType] = colour;
|
||||
gStaffColours[staffType] = colour;
|
||||
|
||||
FOR_ALL_PEEPS(spriteIndex, peep) {
|
||||
if (peep->type == PEEP_TYPE_STAFF && peep->staff_type == staffType) {
|
||||
@@ -257,7 +257,7 @@ void game_command_hire_new_staff_member(int* eax, int* ebx, int* ecx, int* edx,
|
||||
newPeep->pathfind_goal.z = 0xFF;
|
||||
newPeep->pathfind_goal.direction = 0xFF;
|
||||
|
||||
uint8 colour = RCT2_ADDRESS(RCT2_ADDRESS_HANDYMAN_COLOUR, uint8)[staff_type > 2 ? 2 : staff_type];
|
||||
uint8 colour = gStaffColours[staff_type > 2 ? 2 : staff_type];
|
||||
newPeep->tshirt_colour = colour;
|
||||
newPeep->trousers_colour = colour;
|
||||
|
||||
|
||||
@@ -52,6 +52,11 @@ enum STAFF_ORDERS{
|
||||
extern uint32 *gStaffPatrolAreas;
|
||||
extern uint8 *gStaffModes;
|
||||
|
||||
#define gStaffColours RCT2_ADDRESS(RCT2_ADDRESS_HANDYMAN_COLOUR, colour_t)
|
||||
#define gStaffHandymanColour RCT2_GLOBAL(RCT2_ADDRESS_HANDYMAN_COLOUR, colour_t)
|
||||
#define gStaffMechanicColour RCT2_GLOBAL(RCT2_ADDRESS_MECHANIC_COLOUR, colour_t)
|
||||
#define gStaffSecurityColour RCT2_GLOBAL(RCT2_ADDRESS_SECURITY_COLOUR, colour_t)
|
||||
|
||||
void game_command_update_staff_colour(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp);
|
||||
void game_command_hire_new_staff_member(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp);
|
||||
void game_command_set_staff_order(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp);
|
||||
|
||||
@@ -964,9 +964,9 @@ void S4Importer::ImportParkFlags()
|
||||
gGuestInitialThirst = _s4.guest_initial_thirst;
|
||||
|
||||
// Staff colours
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_HANDYMAN_COLOUR, uint8) = RCT1::GetColour(_s4.handman_colour);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MECHANIC_COLOUR, uint8) = RCT1::GetColour(_s4.mechanic_colour);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SECURITY_COLOUR, uint8) = RCT1::GetColour(_s4.security_guard_colour);
|
||||
gStaffHandymanColour = RCT1::GetColour(_s4.handman_colour);
|
||||
gStaffMechanicColour = RCT1::GetColour(_s4.mechanic_colour);
|
||||
gStaffSecurityColour = RCT1::GetColour(_s4.security_guard_colour);
|
||||
|
||||
// Flags
|
||||
gParkFlags = _s4.park_flags;
|
||||
|
||||
@@ -3673,7 +3673,7 @@ static void window_ride_maintenance_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
widget = &window_ride_maintenance_widgets[WIDX_LOCATE_MECHANIC];
|
||||
x = w->x + widget->left;
|
||||
y = w->y + widget->top;
|
||||
gfx_draw_sprite(dpi, (RCT2_GLOBAL(RCT2_ADDRESS_MECHANIC_COLOUR, uint8) << 24) | 0xA0000000 | 5196, x, y, 0);
|
||||
gfx_draw_sprite(dpi, (gStaffMechanicColour << 24) | 0xA0000000 | 5196, x, y, 0);
|
||||
|
||||
// Inspection label
|
||||
widget = &window_ride_maintenance_widgets[WIDX_INSPECTION_INTERVAL];
|
||||
|
||||
@@ -280,7 +280,7 @@ static void window_staff_list_mousedown(int widgetIndex, rct_window* w, rct_widg
|
||||
window_staff_list_cancel_tools(w);
|
||||
break;
|
||||
case WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER:
|
||||
window_dropdown_show_colour(w, widget, w->colours[1], RCT2_ADDRESS(RCT2_ADDRESS_HANDYMAN_COLOUR, uint8)[RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_STAFF_LIST_SELECTED_TAB, uint8)]);
|
||||
window_dropdown_show_colour(w, widget, w->colours[1], gStaffColours[RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_STAFF_LIST_SELECTED_TAB, uint8)]);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -497,7 +497,7 @@ void window_staff_list_invalidate(rct_window *w)
|
||||
if (tabIndex < 3) {
|
||||
window_staff_list_widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].type = WWT_COLOURBTN;
|
||||
window_staff_list_widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].image =
|
||||
((uint32)RCT2_ADDRESS(RCT2_ADDRESS_HANDYMAN_COLOUR, uint8)[tabIndex] << 19) +
|
||||
((uint32)gStaffColours[tabIndex] << 19) +
|
||||
0x600013C3;
|
||||
}
|
||||
if (_quick_fire_mode)
|
||||
@@ -542,7 +542,7 @@ void window_staff_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
i = (selectedTab == 0 ? w->list_information_type & 0x0FFFFFFFC : 0);
|
||||
i += RCT2_ADDRESS(RCT2_GLOBAL(0x00982710, int), int)[0] + 1;
|
||||
i |= 0x20000000;
|
||||
i |= RCT2_GLOBAL(RCT2_ADDRESS_HANDYMAN_COLOUR, uint8) << 19;
|
||||
i |= gStaffHandymanColour << 19;
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
i,
|
||||
@@ -550,11 +550,11 @@ void window_staff_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
window_staff_list_widgets[WIDX_STAFF_LIST_HANDYMEN_TAB].bottom - 6 + w->y, 0
|
||||
);
|
||||
|
||||
// Handymen tab image
|
||||
// Mechanic tab image
|
||||
i = (selectedTab == 1 ? w->list_information_type & 0x0FFFFFFFC : 0);
|
||||
i += RCT2_ADDRESS(RCT2_GLOBAL(0x00982718, int), int)[0] + 1;
|
||||
i |= 0x20000000;
|
||||
i |= RCT2_GLOBAL(RCT2_ADDRESS_MECHANIC_COLOUR, uint8) << 19;
|
||||
i |= gStaffMechanicColour << 19;
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
i,
|
||||
@@ -566,7 +566,7 @@ void window_staff_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
i = (selectedTab == 2 ? w->list_information_type & 0x0FFFFFFFC : 0);
|
||||
i += RCT2_ADDRESS(RCT2_GLOBAL(0x00982720, int), int)[0] + 1;
|
||||
i |= 0x20000000;
|
||||
i |= RCT2_GLOBAL(RCT2_ADDRESS_SECURITY_COLOUR, uint8) << 19;
|
||||
i |= gStaffSecurityColour << 19;
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
i,
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../network/network.h"
|
||||
#include "../network/twitch.h"
|
||||
#include "../peep/staff.h"
|
||||
#include "../scenario.h"
|
||||
#include "../title.h"
|
||||
#include "../sprites.h"
|
||||
@@ -802,7 +803,7 @@ static void window_top_toolbar_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
imgId = 5627;
|
||||
if (widget_is_pressed(w, WIDX_STAFF))
|
||||
imgId++;
|
||||
imgId |= (RCT2_GLOBAL(RCT2_ADDRESS_HANDYMAN_COLOUR, uint8) << 19) | 0xA0000000 | (RCT2_GLOBAL(RCT2_ADDRESS_MECHANIC_COLOUR, uint8) << 24);
|
||||
imgId |= (gStaffHandymanColour << 19) | 0xA0000000 | (gStaffMechanicColour << 24);
|
||||
gfx_draw_sprite(dpi, imgId, x, y, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../addresses.h"
|
||||
#include "../cheats.h"
|
||||
#include "../config.h"
|
||||
#include "../game.h"
|
||||
#include "../interface/colour.h"
|
||||
#include "../interface/window.h"
|
||||
@@ -29,14 +31,13 @@
|
||||
#include "../management/news_item.h"
|
||||
#include "../management/research.h"
|
||||
#include "../peep/peep.h"
|
||||
#include "../peep/staff.h"
|
||||
#include "../ride/ride.h"
|
||||
#include "../ride/ride_data.h"
|
||||
#include "../scenario.h"
|
||||
#include "../world/map.h"
|
||||
#include "park.h"
|
||||
#include "sprite.h"
|
||||
#include "../config.h"
|
||||
#include "../cheats.h"
|
||||
|
||||
uint8 *gParkRatingHistory = RCT2_ADDRESS(RCT2_ADDRESS_PARK_RATING_HISTORY, uint8);
|
||||
uint8 *gGuestsInParkHistory = RCT2_ADDRESS(RCT2_ADDRESS_GUESTS_IN_PARK_HISTORY, uint8);
|
||||
@@ -82,9 +83,9 @@ void park_init()
|
||||
|
||||
RCT2_GLOBAL(0x013CA740, uint8) = 0;
|
||||
gParkName = 777;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_HANDYMAN_COLOUR, uint8) = COLOUR_BRIGHT_RED;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MECHANIC_COLOUR, uint8) = COLOUR_LIGHT_BLUE;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SECURITY_COLOUR, uint8) = COLOUR_YELLOW;
|
||||
gStaffHandymanColour = COLOUR_BRIGHT_RED;
|
||||
gStaffMechanicColour = COLOUR_LIGHT_BLUE;
|
||||
gStaffSecurityColour = COLOUR_YELLOW;
|
||||
gNumGuestsInPark = 0;
|
||||
gNumGuestsInParkLastWeek = 0;
|
||||
gNumGuestsHeadingForPark = 0;
|
||||
|
||||
Reference in New Issue
Block a user