From 1b077af90e39cd05ba382b59d2053cbdeb9567b7 Mon Sep 17 00:00:00 2001 From: hexdec Date: Thu, 28 Aug 2014 01:48:49 +0200 Subject: [PATCH] Implemented window_staff_peep_fire. Added new window class WC_FIRE_PROMPT. --- src/window.h | 1 + src/window_staff_peep.c | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/window.h b/src/window.h index eda9d5e0e1..1098eba380 100644 --- a/src/window.h +++ b/src/window.h @@ -340,6 +340,7 @@ enum { WC_PEEP = 23, WC_GUEST_LIST = 24, WC_STAFF_LIST = 25, + WC_FIRE_PROMPT = 26, WC_PARK_INFORMATION = 27, WC_FINANCES = 28, WC_TITLE_MENU = 29, diff --git a/src/window_staff_peep.c b/src/window_staff_peep.c index 8131d8bab9..74c74c9642 100644 --- a/src/window_staff_peep.c +++ b/src/window_staff_peep.c @@ -264,7 +264,28 @@ void window_staff_peep_close() /** rct2: 0x6C0A77 */ void window_staff_peep_fire(rct_window* w) { - RCT2_CALLPROC_X(0x6C0A77, 0, 0, 0, 0, (int)w, 0, 0); + // Check if the confirm window already exists. + if (window_bring_to_front_by_id(0x1A, w->number)) { + return; + } + + // Find center of the screen. + int screen_height = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_HEIGHT, sint16); + int screen_width = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, sint16); + int x = screen_width/2 - 100; + int y = screen_height/2 - 50; + + rct_window* window_prompt = window_create(x, y, 200, 100, (uint32*)0x992C3C, 0x1A, 0); + window_prompt->widgets = (rct_widget*)0x9AFB4C; + window_prompt->enabled_widgets |= 0x4; + window_prompt->enabled_widgets |= 0x8; + window_prompt->enabled_widgets |= 0x10; + + window_init_scroll_widgets(window_prompt); + + window_prompt->flags |= 0x10; + window_prompt->number = w->number; + window_prompt->colours[0] = 0x9A; } /**