mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-25 07:44:38 +01:00
fix various research issues and improve
This commit is contained in:
@@ -357,7 +357,6 @@
|
||||
<Filter>Source\Management</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||
<ClCompile Include="..\src\windows\staff_list.c">
|
||||
<Filter>Source\Windows</Filter>
|
||||
</ClCompile>
|
||||
@@ -369,9 +368,6 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||
<ClCompile Include="..\lib\libspeex\resample.c">
|
||||
<Filter>Libraries\lodepng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||
<ClCompile Include="..\lib\libspeex\resample.c">
|
||||
<Filter>Libraries\libspeex</Filter>
|
||||
@@ -393,6 +389,17 @@
|
||||
<Filter>Libraries\libspeex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||
<ClCompile Include="..\lib\libspeex\resample.c">
|
||||
<Filter>Libraries\lodepng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||
<ClCompile Include="..\lib\libspeex\resample.c">
|
||||
<Filter>Libraries\libspeex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\management\award.h">
|
||||
|
||||
@@ -507,6 +507,7 @@ void window_bubble_list_item(rct_window* w, int item_position);
|
||||
void window_align_tabs( rct_window *w, uint8 start_tab_id, uint8 end_tab_id );
|
||||
|
||||
void window_new_ride_init_vars();
|
||||
void window_new_ride_focus(ride_list_item rideItem);
|
||||
|
||||
void window_staff_list_init_vars();
|
||||
|
||||
|
||||
@@ -282,9 +282,8 @@ void news_item_add_to_queue(uint8 type, rct_string_id string_id, uint32 assoc)
|
||||
* rct2: 0x0066EBE6
|
||||
*
|
||||
**/
|
||||
void news_item_open_subject(int type, int subject) {
|
||||
|
||||
int eax;
|
||||
void news_item_open_subject(int type, int subject)
|
||||
{
|
||||
rct_peep* peep;
|
||||
rct_window* window;
|
||||
|
||||
@@ -301,14 +300,15 @@ void news_item_open_subject(int type, int subject) {
|
||||
window_finances_open();
|
||||
break;
|
||||
case NEWS_ITEM_RESEARCH:
|
||||
|
||||
if (subject >= 0x10000) {
|
||||
// Open ride list window
|
||||
RCT2_CALLPROC_EBPSAFE(0x006B3CFF);
|
||||
eax = (subject & 0xFF00) >> 8;
|
||||
eax += (subject & 0xFF) << 8;
|
||||
window_new_ride_open();
|
||||
|
||||
// Switch to right tab and scroll to ride location
|
||||
RCT2_CALLPROC_X(0x006B3EBA, eax, 0, subject, 0, 0, 0, 0);
|
||||
ride_list_item rideItem;
|
||||
rideItem.type = subject >> 8;
|
||||
rideItem.entry_index = subject & 0xFF;
|
||||
window_new_ride_focus(rideItem);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -322,13 +322,12 @@ void news_item_open_subject(int type, int subject) {
|
||||
RCT2_CALLPROC_X(0x006E1172, (subject & 0xFFFF), 0, subject, 0, 0, 0, 0);
|
||||
}
|
||||
RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6);
|
||||
// Open scenery window
|
||||
RCT2_CALLPROC_EBPSAFE(0x006E0FEF);
|
||||
window_scenery_open();
|
||||
}
|
||||
}
|
||||
|
||||
// Switch to new scenery tab
|
||||
RCT2_CALLPROC_X(0x006E1172, (subject & 0xFFFF), 0, subject, 0, 0, 0, 0);
|
||||
|
||||
break;
|
||||
case NEWS_ITEM_PEEPS:
|
||||
// Open guest list to right tab
|
||||
|
||||
@@ -33,6 +33,17 @@ extern rct_research_item *gResearchItems = (rct_research_item*)RCT2_RESEARCH_ITE
|
||||
// 0x00EE787C
|
||||
uint8 gResearchUncompletedCategories;
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006671AD, part of 0x00667132
|
||||
*/
|
||||
void research_reset_items()
|
||||
{
|
||||
gResearchItems[0].entryIndex = RESEARCHED_ITEMS_SEPERATOR;
|
||||
gResearchItems[1].entryIndex = RESEARCHED_ITEMS_END;
|
||||
gResearchItems[2].entryIndex = -3;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00684BAE
|
||||
@@ -107,7 +118,7 @@ static void research_next_design()
|
||||
researchItem = firstUnresearchedItem;
|
||||
for (;;) {
|
||||
researchItem++;
|
||||
if (researchItem->entryIndex == -2) {
|
||||
if (researchItem->entryIndex == RESEARCHED_ITEMS_END) {
|
||||
if (!ignoreActiveResearchTypes) {
|
||||
ignoreActiveResearchTypes = 1;
|
||||
researchItem = firstUnresearchedItem;
|
||||
|
||||
@@ -30,6 +30,7 @@ typedef struct {
|
||||
} rct_research_item;
|
||||
|
||||
#define RESEARCHED_ITEMS_SEPERATOR -1
|
||||
#define RESEARCHED_ITEMS_END -2
|
||||
|
||||
enum {
|
||||
RESEARCH_FUNDING_NONE,
|
||||
@@ -48,6 +49,7 @@ enum {
|
||||
extern rct_research_item *gResearchItems;
|
||||
extern uint8 gResearchUncompletedCategories;
|
||||
|
||||
void research_reset_items();
|
||||
void research_update_uncompleted_types();
|
||||
void research_update();
|
||||
|
||||
|
||||
@@ -260,7 +260,6 @@ static void window_game_top_toolbar_mouseup()
|
||||
if (!tool_set(w, WIDX_SCENERY, 0)) {
|
||||
RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6);
|
||||
window_scenery_open();
|
||||
//RCT2_CALLPROC_EBPSAFE(0x006E0FEF);
|
||||
}
|
||||
break;
|
||||
case WIDX_PATH:
|
||||
|
||||
@@ -242,6 +242,7 @@ static void* window_new_ride_events[] = {
|
||||
const int window_new_ride_tab_animation_loops[] = { 20, 32, 10, 72, 24, 28, 16 };
|
||||
const int window_new_ride_tab_animation_divisor[] = { 4, 8, 2, 4, 4, 4, 2 };
|
||||
|
||||
static void window_new_ride_set_page(rct_window *w, int page);
|
||||
static void window_new_ride_refresh_widget_sizing(rct_window *w);
|
||||
static ride_list_item window_new_ride_scroll_get_ride_list_item_at(rct_window *w, int x, int y);
|
||||
static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixelinfo *dpi, ride_list_item item, int x, int y, int width);
|
||||
@@ -428,6 +429,52 @@ void window_new_ride_open()
|
||||
window_new_ride_scroll_to_focused_ride(w);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006B3EBA
|
||||
*/
|
||||
void window_new_ride_focus(ride_list_item rideItem)
|
||||
{
|
||||
rct_window *w;
|
||||
rct_ride_type *rideType;
|
||||
|
||||
w = window_find_by_id(WC_CONSTRUCT_RIDE, 0);
|
||||
if (w == NULL)
|
||||
return;
|
||||
|
||||
rideType = GET_RIDE_ENTRY(rideItem.entry_index);
|
||||
window_new_ride_set_page(w, rideType->category[0]);
|
||||
|
||||
ride_list_item *listItem = (ride_list_item*)0x00F43523;
|
||||
while (listItem->type != RIDE_TYPE_NULL) {
|
||||
if (listItem->type == rideItem.type && listItem->entry_index == rideItem.type) {
|
||||
RCT2_GLOBAL(0x00F43825, uint8) = rideItem.type;
|
||||
RCT2_GLOBAL(0x00F43826, uint8) = rideItem.entry_index;
|
||||
w->new_ride.highlighted_ride_id = (rideItem.entry_index << 8) | rideItem.type;
|
||||
window_new_ride_scroll_to_focused_ride(w);
|
||||
}
|
||||
listItem++;
|
||||
}
|
||||
}
|
||||
|
||||
static void window_new_ride_set_page(rct_window *w, int page)
|
||||
{
|
||||
_window_new_ride_current_tab = page;
|
||||
w->frame_no = 0;
|
||||
w->new_ride.highlighted_ride_id = -1;
|
||||
w->new_ride.selected_ride_countdown = -1;
|
||||
window_new_ride_populate_list();
|
||||
if (page < WINDOW_NEW_RIDE_PAGE_RESEARCH) {
|
||||
w->new_ride.highlighted_ride_id = RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_RIDE_LIST_HIGHLIGHTED_ITEM, sint16)[page];
|
||||
if (w->new_ride.highlighted_ride_id == -1)
|
||||
w->new_ride.highlighted_ride_id = RCT2_GLOBAL(0x00F43523, sint16);
|
||||
}
|
||||
|
||||
window_new_ride_refresh_widget_sizing(w);
|
||||
window_invalidate(w);
|
||||
window_new_ride_scroll_to_focused_ride(w);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006B3DF1
|
||||
@@ -550,26 +597,8 @@ static void window_new_ride_mouseup()
|
||||
*/
|
||||
static void window_new_ride_mousedown(int widgetIndex, rct_window *w, rct_widget *widget)
|
||||
{
|
||||
int page;
|
||||
if (widgetIndex < WIDX_TAB_1 || widgetIndex > WIDX_TAB_7)
|
||||
return;
|
||||
|
||||
page = widgetIndex - WIDX_TAB_1;
|
||||
|
||||
_window_new_ride_current_tab = page;
|
||||
w->frame_no = 0;
|
||||
w->new_ride.highlighted_ride_id = -1;
|
||||
w->new_ride.selected_ride_countdown = -1;
|
||||
window_new_ride_populate_list();
|
||||
if (page < WINDOW_NEW_RIDE_PAGE_RESEARCH) {
|
||||
w->new_ride.highlighted_ride_id = RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_RIDE_LIST_HIGHLIGHTED_ITEM, sint16)[page];
|
||||
if (w->new_ride.highlighted_ride_id == -1)
|
||||
w->new_ride.highlighted_ride_id = RCT2_GLOBAL(0x00F43523, sint16);
|
||||
}
|
||||
|
||||
window_new_ride_refresh_widget_sizing(w);
|
||||
window_invalidate(w);
|
||||
window_new_ride_scroll_to_focused_ride(w);
|
||||
if (widgetIndex >= WIDX_TAB_1 && widgetIndex <= WIDX_TAB_7)
|
||||
window_new_ride_set_page(w, widgetIndex - WIDX_TAB_1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -773,16 +802,20 @@ static void window_new_ride_paint()
|
||||
y = w->y + window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_GROUP].top + 12;
|
||||
|
||||
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32);
|
||||
int lastDevelopmentFormat;
|
||||
if (typeId != 0xFFFFFFFF) {
|
||||
if (typeId >= 0x10000) {
|
||||
rct_ride_type *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, rct_ride_type*);
|
||||
stringId = rideEntry->var_008 & 0x1000 ?
|
||||
rideEntry->name :
|
||||
(typeId & 0xFF00) + 2;
|
||||
((typeId >> 8) & 0xFF) + 2;
|
||||
|
||||
lastDevelopmentFormat = STR_RESEARCH_RIDE_LABEL;
|
||||
} else {
|
||||
stringId = g_scenerySetEntries[typeId]->name;
|
||||
lastDevelopmentFormat = STR_RESEARCH_SCENERY_LABEL;
|
||||
}
|
||||
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 266, STR_RESEARCH_RIDE_LABEL, 0);
|
||||
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 266, lastDevelopmentFormat, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -197,7 +197,8 @@ static void* window_research_page_events[] = {
|
||||
static uint32 window_research_page_enabled_widgets[] = {
|
||||
(1 << WIDX_CLOSE) |
|
||||
(1 << WIDX_TAB_1) |
|
||||
(1 << WIDX_TAB_2),
|
||||
(1 << WIDX_TAB_2) |
|
||||
(1 << WIDX_LAST_DEVELOPMENT_BUTTON),
|
||||
|
||||
(1 << WIDX_CLOSE) |
|
||||
(1 << WIDX_TAB_1) |
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "../management/finance.h"
|
||||
#include "../management/marketing.h"
|
||||
#include "../management/news_item.h"
|
||||
#include "../management/research.h"
|
||||
#include "../peep/peep.h"
|
||||
#include "../ride/ride.h"
|
||||
#include "../scenario.h"
|
||||
@@ -76,9 +77,7 @@ void park_init()
|
||||
for (i = 0; i < 20; i++)
|
||||
RCT2_ADDRESS(0x01358102, uint8)[i] = 0;
|
||||
|
||||
RCT2_GLOBAL(0x01358844, uint32) = 0xFFFFFFFF;
|
||||
RCT2_GLOBAL(0x01358849, uint32) = 0xFFFFFFFE;
|
||||
RCT2_GLOBAL(0x0135884E, uint32) = 0xFFFFFFFD;
|
||||
research_reset_items();
|
||||
finance_init();
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
|
||||
Reference in New Issue
Block a user