mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-18 12:33:17 +01:00
add global macro for gResearchLastItemSubject
This commit is contained in:
@@ -164,7 +164,7 @@ void research_finish_item(sint32 entryIndex)
|
||||
rct_ride_entry *rideEntry, *rideEntry2;
|
||||
rct_scenery_set_entry *scenerySetEntry;
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, sint32) = entryIndex;
|
||||
gResearchLastItemSubject = (uint32)entryIndex;
|
||||
research_invalidate_related_windows();
|
||||
if (entryIndex >= 0x10000) {
|
||||
// Ride
|
||||
@@ -330,7 +330,7 @@ void sub_684AC3(){
|
||||
research_finish_item(research->entryIndex);
|
||||
}
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, sint32) = -1;
|
||||
gResearchLastItemSubject = (uint32)-1;
|
||||
gResearchProgressStage = 0;
|
||||
gResearchProgress = 0;
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ enum {
|
||||
#define gResearchPriorities RCT2_GLOBAL(RCT2_ADDRESS_ACTIVE_RESEARCH_TYPES, uint8)
|
||||
#define gResearchProgress RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS, uint16)
|
||||
#define gResearchProgressStage RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8)
|
||||
#define gResearchLastItemSubject RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32)
|
||||
#define gResearchExpectedMonth RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_EXPECTED_MONTH, uint8)
|
||||
#define gResearchExpectedDay RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_EXPECTED_DAY, uint8)
|
||||
#define gResearchNextCategory RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_CATEGORY, uint8)
|
||||
|
||||
@@ -304,7 +304,7 @@ void S6Exporter::Export()
|
||||
|
||||
_s6.active_research_types = gResearchPriorities;
|
||||
_s6.research_progress_stage = gResearchProgressStage;
|
||||
_s6.last_researched_item_subject = RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32);
|
||||
_s6.last_researched_item_subject = gResearchLastItemSubject;
|
||||
// pad_01357CF8
|
||||
_s6.next_research_item = gResearchNextItem;
|
||||
_s6.research_progress = gResearchProgress;
|
||||
|
||||
@@ -236,7 +236,7 @@ void S6Importer::Import()
|
||||
|
||||
gResearchPriorities = _s6.active_research_types;
|
||||
gResearchProgressStage = _s6.research_progress_stage;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32) = _s6.last_researched_item_subject;
|
||||
gResearchLastItemSubject = _s6.last_researched_item_subject;
|
||||
// pad_01357CF8
|
||||
gResearchNextItem = _s6.next_research_item;
|
||||
gResearchProgress = _s6.research_progress;
|
||||
|
||||
@@ -617,7 +617,7 @@ static void window_new_ride_mouseup(rct_window *w, int widgetIndex)
|
||||
window_close(w);
|
||||
break;
|
||||
case WIDX_LAST_DEVELOPMENT_BUTTON:
|
||||
news_item_open_subject(NEWS_ITEM_RESEARCH, RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, sint32));
|
||||
news_item_open_subject(NEWS_ITEM_RESEARCH, (int)gResearchLastItemSubject);
|
||||
break;
|
||||
case WIDX_RESEARCH_FUNDING_BUTTON:
|
||||
window_finances_research_open();
|
||||
@@ -739,7 +739,7 @@ static void window_new_ride_invalidate(rct_window *w)
|
||||
|
||||
if (_window_new_ride_current_tab == WINDOW_NEW_RIDE_PAGE_RESEARCH) {
|
||||
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_EMPTY;
|
||||
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32);
|
||||
uint32 typeId = gResearchLastItemSubject;
|
||||
if (typeId != 0xFFFFFFFF) {
|
||||
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_FLATBTN;
|
||||
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].image = typeId >= 0x10000 ? 5189 : 5191;
|
||||
|
||||
@@ -266,7 +266,7 @@ static void window_research_development_mouseup(rct_window *w, int widgetIndex)
|
||||
window_research_set_page(w, widgetIndex - WIDX_TAB_1);
|
||||
break;
|
||||
case WIDX_LAST_DEVELOPMENT_BUTTON:
|
||||
news_item_open_subject(NEWS_ITEM_RESEARCH, RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, sint32));
|
||||
news_item_open_subject(NEWS_ITEM_RESEARCH, (int)gResearchLastItemSubject);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -299,7 +299,7 @@ static void window_research_development_invalidate(rct_window *w)
|
||||
window_research_set_pressed_tab(w);
|
||||
|
||||
window_research_development_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_EMPTY;
|
||||
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32);
|
||||
uint32 typeId = gResearchLastItemSubject;
|
||||
if (typeId != 0xFFFFFFFF) {
|
||||
window_research_development_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_FLATBTN;
|
||||
window_research_development_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].image = typeId >= 0x10000 ? 5189 : 5191;
|
||||
@@ -380,7 +380,7 @@ void window_research_development_page_paint(rct_window *w, rct_drawpixelinfo *dp
|
||||
x = w->x + 10;
|
||||
y = w->y + w->widgets[WIDX_LAST_DEVELOPMENT_GROUP + baseWidgetIndex].top + 12;
|
||||
|
||||
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32);
|
||||
uint32 typeId = gResearchLastItemSubject;
|
||||
int lastDevelopmentFormat;
|
||||
if (typeId != 0xFFFFFFFF) {
|
||||
if (typeId >= 0x10000) {
|
||||
|
||||
@@ -89,7 +89,7 @@ void park_init()
|
||||
gParkRating = 0;
|
||||
_guestGenerationProbability = 0;
|
||||
gTotalRideValue = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, sint32) = -1;
|
||||
gResearchLastItemSubject = (uint32)-1;
|
||||
|
||||
for (i = 0; i < 20; i++)
|
||||
gMarketingCampaignDaysLeft[i] = 0;
|
||||
|
||||
Reference in New Issue
Block a user