mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-29 09:44:52 +01:00
Merge remote-tracking branch 'upstream/master'
Conflicts: src/addresses.h src/config.c
This commit is contained in:
@@ -48,14 +48,20 @@
|
||||
|
||||
#define RCT2_ADDRESS_APP_PATH 0x009AA214
|
||||
|
||||
#define RCT2_ADDRESS_CONFIG_SOFTWARE_BUFFERING 0x009AAC6E
|
||||
|
||||
#define RCT2_ADDRESS_CONFIG_SOUND_SW_BUFFER 0x009AAC6E
|
||||
#define RCT2_ADDRESS_CONFIG_MUSIC 0x009AAC72
|
||||
|
||||
#define RCT2_ADDRESS_CONFIG_FLAGS 0x009AAC74
|
||||
#define RCT2_ADDRESS_CONFIG_SOUND_QUALITY 0x009AAC77
|
||||
#define RCT2_ADDRESS_CONFIG_METRIC 0x009AAC78
|
||||
#define RCT2_ADDRESS_CONFIG_FAHRENHEIT 0x009AAC79
|
||||
#define RCT2_ADDRESS_CONFIG_TEMPERATURE 0x009AAC79
|
||||
#define RCT2_ADDRESS_CONFIG_KEYBOARD_SHORTCUTS 0x009AAC7A
|
||||
#define RCT2_ADDRESS_CONFIG_EDGE_SCROLLING 0x009AACBA
|
||||
#define RCT2_ADDRESS_CONFIG_CURRENCY 0x009AACBB
|
||||
#define RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS 0x009AACBD
|
||||
#define RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER 0x009AACBF
|
||||
|
||||
|
||||
#define RCT2_ADDRESS_EXPANSION_NAMES 0x009AACC0
|
||||
#define RCT2_ADDRESS_EXPANSION_FLAGS 0x009AB4C0
|
||||
@@ -178,8 +184,6 @@
|
||||
#define RCT2_ADDRESS_MECHANIC_COLOUR 0x01357BCE
|
||||
#define RCT2_ADDRESS_SECURITY_COLOUR 0x01357BCF
|
||||
|
||||
#define RCT2_ADDRESS_CURRENT_INTEREST_RATE 0x0135934A
|
||||
|
||||
#define RCT2_ADDRESS_MAP_SIZE 0x01358834
|
||||
#define RCT2_ADDRESS_PARK_SIZE 0x013580EA
|
||||
|
||||
|
||||
@@ -41,9 +41,9 @@ static const rct_weather_transition* climate_transitions[4];
|
||||
|
||||
static void climate_determine_future_weather();
|
||||
|
||||
int climate_celcius_to_fahrenheit(int celcius)
|
||||
int climate_celsius_to_fahrenheit(int celsius)
|
||||
{
|
||||
return (celcius * 29) / 16 + 32;
|
||||
return (celsius * 29) / 16 + 32;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,7 +41,7 @@ typedef struct {
|
||||
extern int gClimateNextWeather;
|
||||
extern const rct_weather climate_weather_data[6];
|
||||
|
||||
int climate_celcius_to_fahrenheit(int celcius);
|
||||
int climate_celsius_to_fahrenheit(int celsius);
|
||||
void climate_reset(int climate);
|
||||
void climate_update();
|
||||
|
||||
|
||||
26
src/config.c
26
src/config.c
@@ -100,6 +100,7 @@ void config_load()
|
||||
ReadFile(hFile, (void*)0x009AAC5C, 2155, &bytesRead, NULL);
|
||||
CloseHandle(hFile);
|
||||
|
||||
|
||||
//general configuration
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_EDGE_SCROLLING, sint8) = gGeneral_config.edge_scrolling;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CURRENCY, sint8) = gGeneral_config.currency_format; //i think this is curency
|
||||
@@ -127,6 +128,21 @@ void config_load()
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
if (RCT2_GLOBAL(0x009AB4C6, sint8) == 1)
|
||||
return;
|
||||
RCT2_GLOBAL(0x009AB4C6, sint8) = 1;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, sint8) = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_TEMPERATURE, sint8) = 1;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CURRENCY, sint8) = 1;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, sint16) = 0;
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS))
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, sint16) = (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, sint8) + 1) * 256;
|
||||
RCT2_GLOBAL(0x009AA00D, sint8) = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, sint8) = 0;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_MEM_TOTAL_PHYSICAL, uint32) > 0x4000000) {
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, sint8) = 1;
|
||||
@@ -136,12 +152,12 @@ void config_load()
|
||||
*/
|
||||
|
||||
|
||||
RCT2_GLOBAL(0x009AAC75, sint8) = RCT2_ADDRESS(0x009AF601, sint8)[RCT2_GLOBAL(0x009AAC77, sint8)];
|
||||
RCT2_GLOBAL(0x009AAC76, sint8) = RCT2_ADDRESS(0x009AF604, sint8)[RCT2_GLOBAL(0x009AAC77, sint8)];
|
||||
RCT2_GLOBAL(0x009AACBD, sint16) = 0;
|
||||
RCT2_GLOBAL(0x009AAC75, sint8) = RCT2_ADDRESS(0x009AF601, sint8)[RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, sint8)];
|
||||
RCT2_GLOBAL(0x009AAC76, sint8) = RCT2_ADDRESS(0x009AF604, sint8)[RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, sint8)];
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, sint16) = 0;
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS))
|
||||
RCT2_GLOBAL(0x009AACBD, sint16) = (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, sint8) + 1) * 256;
|
||||
RCT2_GLOBAL(0x009AA00D, sint8) = 0; //no idea what this does
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, sint16) = (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, sint8) + 1) * 256;
|
||||
RCT2_GLOBAL(0x009AA00D, sint8) = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
enum {
|
||||
CONFIG_FLAG_ALWAYS_SHOW_GRIDLINES = (1 << 0),
|
||||
CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS = (1 << 1),
|
||||
CONFIG_FLAG_DISABLE_SMOOTH_LANDSCAPE = (1 << 2)
|
||||
CONFIG_FLAG_DISABLE_SMOOTH_LANDSCAPE = (1 << 2),
|
||||
CONFIG_FLAG_SAVE_PLUGIN_DATA = (1 << 3)
|
||||
};
|
||||
|
||||
enum {
|
||||
|
||||
@@ -1410,7 +1410,7 @@ static void load_landscape()
|
||||
strcpy(esi, ".SC6");
|
||||
break;
|
||||
}
|
||||
strcpy((char*)0x009ABB37, (char*)0x0141EF68);
|
||||
strcpy((char*)RCT2_ADDRESS_SAVED_GAMES_PATH_2, (char*)0x0141EF68);
|
||||
|
||||
RCT2_CALLPROC_EBPSAFE(0x006758C0); // landscape_load
|
||||
if (1) {
|
||||
@@ -1546,7 +1546,7 @@ static void load_game()
|
||||
strcpy(esi, ".SV6");
|
||||
break;
|
||||
}
|
||||
strcpy((char*)0x009ABB37, (char*)0x0141EF68);
|
||||
strcpy((char*)RCT2_ADDRESS_SAVED_GAMES_PATH_2, (char*)0x0141EF68);
|
||||
|
||||
if (game_load_save()) {
|
||||
gfx_invalidate_screen();
|
||||
|
||||
@@ -284,7 +284,7 @@ void gfx_transpose_palette(int pal, unsigned char product)
|
||||
uint8* esi, *edi;
|
||||
|
||||
ebx = pal * 16;
|
||||
esi = (uint8*)(*((int*)(0x009EBD28 + ebx)));
|
||||
esi = (uint8*)(*((int*)(RCT2_ADDRESS_G1_ELEMENTS + ebx)));
|
||||
ebp = *((short*)(0x009EBD2C + ebx));
|
||||
eax = *((short*)(0x009EBD30 + ebx)) * 4;
|
||||
edi = (uint8*)0x01424680 + eax;
|
||||
|
||||
@@ -240,8 +240,8 @@ void osinterface_process_messages()
|
||||
}
|
||||
break;
|
||||
case SDL_MOUSEBUTTONUP:
|
||||
*((int*)0x01424318) = e.button.x;
|
||||
*((int*)0x0142431C) = e.button.y;
|
||||
RCT2_GLOBAL(0x01424318, int) = e.button.x;
|
||||
RCT2_GLOBAL(0x0142431C, int) = e.button.y;
|
||||
switch (e.button.button) {
|
||||
case SDL_BUTTON_LEFT:
|
||||
RCT2_CALLPROC_1(0x00406C96, int, 2);
|
||||
|
||||
@@ -74,7 +74,7 @@ void park_init()
|
||||
RCT2_GLOBAL(0x013573F2, sint16) = -1;
|
||||
RCT2_GLOBAL(0x013573F8, sint16) = -1;
|
||||
RCT2_GLOBAL(0x01357CF2, uint16) = 127;
|
||||
RCT2_GLOBAL(0x013573FF, uint8) = 2;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_RESEARCH_LEVEL, uint8) = 2;
|
||||
|
||||
RCT2_GLOBAL(0x013580F4, uint16) = 500;
|
||||
RCT2_GLOBAL(0x013580E9, uint8) = 128;
|
||||
|
||||
@@ -87,7 +87,7 @@ void peep_problem_warnings_update()
|
||||
uint16 guests_in_park = RCT2_GLOBAL(RCT2_ADDRESS_GUESTS_IN_PARK, uint16);
|
||||
int hunger_counter = 0, lost_counter = 0, noexit_counter = 0, thirst_counter = 0,
|
||||
litter_counter = 0, disgust_counter = 0, bathroom_counter = 0 ,vandalism_counter = 0;
|
||||
static int warning_throttle[6] = { 0, 0, 0, 0, 0, 0 };
|
||||
static int warning_throttle[7] = { 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_RIDE_COUNT, sint16) = ride_get_count(); // refactor this to somewhere else
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@ void scenario_load(char *path)
|
||||
sawyercoding_read_chunk(hFile, (uint8*)RCT2_ADDRESS_CURRENT_PARK_VALUE);
|
||||
|
||||
// Read more game data, including research items and rides
|
||||
sawyercoding_read_chunk(hFile, (uint8*)0x01358740);
|
||||
sawyercoding_read_chunk(hFile, (uint8*)RCT2_ADDRESS_COMPLETED_COMPANY_VALUE);
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
@@ -468,8 +468,8 @@ void scenario_load_and_play(rct_scenario_basic *scenario)
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, sint32) = ENCRYPT_MONEY(RCT2_GLOBAL(0x013573DC, sint32));
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069E869); // (loan related)
|
||||
|
||||
strcpy((char*)0x0135924A, s6Info->details);
|
||||
strcpy((char*)0x0135920A, s6Info->name);
|
||||
strcpy((char*)RCT2_ADDRESS_SCENARIO_DETAILS, s6Info->details);
|
||||
strcpy((char*)RCT2_ADDRESS_SCENARIO_NAME, s6Info->name);
|
||||
|
||||
if (RCT2_GLOBAL(0x009ADAE4, sint32) != -1) {
|
||||
char *ebp = RCT2_GLOBAL(0x009ADAE4, char*);
|
||||
@@ -495,9 +495,9 @@ void scenario_load_and_play(rct_scenario_basic *scenario)
|
||||
}
|
||||
|
||||
// Set the last saved game path
|
||||
strcpy((char*)0x009ABB37, (char*)0x009AB5DA);
|
||||
format_string((char*)0x009ABB37 + strlen((char*)0x009ABB37), RCT2_GLOBAL(0x0013573D4, uint16), (void*)0x0013573D8);
|
||||
strcat((char*)0x009ABB37, ".SV6");
|
||||
strcpy((char*)RCT2_ADDRESS_SAVED_GAMES_PATH_2, (char*)RCT2_ADDRESS_SAVED_GAMES_PATH);
|
||||
format_string((char*)RCT2_ADDRESS_SAVED_GAMES_PATH_2 + strlen((char*)RCT2_ADDRESS_SAVED_GAMES_PATH_2), RCT2_GLOBAL(0x0013573D4, uint16), (void*)0x0013573D8);
|
||||
strcat((char*)RCT2_ADDRESS_SAVED_GAMES_PATH_2, ".SV6");
|
||||
|
||||
memset((void*)0x001357848, 0, 56);
|
||||
RCT2_GLOBAL(0x0135832C, uint32) = 0;
|
||||
|
||||
@@ -79,6 +79,22 @@ enum {
|
||||
SPR_TAB_STATS_5 = SPR_TAB_STATS_0 + 5,
|
||||
SPR_TAB_STATS_6 = SPR_TAB_STATS_0 + 6,
|
||||
|
||||
SPR_PEEP_LARGE_FACE_VERY_VERY_UNHAPPY = 5284,
|
||||
SPR_PEEP_LARGE_FACE_VERY_UNHAPPY = 5285,
|
||||
SPR_PEEP_LARGE_FACE_UNHAPPY = 5286,
|
||||
SPR_PEEP_LARGE_FACE_NORMAL = 5287,
|
||||
SPR_PEEP_LARGE_FACE_HAPPY = 5288,
|
||||
SPR_PEEP_LARGE_FACE_VERY_HAPPY = 5289,
|
||||
SPR_PEEP_LARGE_FACE_VERY_VERY_HAPPY = 5290,
|
||||
SPR_PEEP_LARGE_FACE_TIRED = 5291,
|
||||
SPR_PEEP_LARGE_FACE_VERY_TIRED = 5292,
|
||||
SPR_PEEP_LARGE_FACE_SICK = 5293,
|
||||
SPR_PEEP_LARGE_FACE_VERY_SICK = 5294,
|
||||
|
||||
SPR_PEEP_LARGE_FACE_VERY_VERY_SICK = 5298,
|
||||
|
||||
SPR_PEEP_LARGE_FACE_ANGRY = 5314,
|
||||
|
||||
SPR_TAB_SHOPS_AND_STALLS_0 = 5351,
|
||||
SPR_TAB_SHOPS_AND_STALLS_1 = SPR_TAB_SHOPS_AND_STALLS_0 + 1,
|
||||
SPR_TAB_SHOPS_AND_STALLS_2 = SPR_TAB_SHOPS_AND_STALLS_0 + 2,
|
||||
@@ -140,6 +156,20 @@ enum {
|
||||
SPR_MOST_CONFUSING_LAYOUT = SPR_AWARD_MOST_UNTIDY + 15,
|
||||
SPR_BEST_GENTLE_RIDES = SPR_AWARD_MOST_UNTIDY + 16,
|
||||
|
||||
SPR_PEEP_SMALL_FACE_VERY_VERY_UNHAPPY = 5486,
|
||||
SPR_PEEP_SMALL_FACE_VERY_UNHAPPY = 5487,
|
||||
SPR_PEEP_SMALL_FACE_UNHAPPY = 5488,
|
||||
SPR_PEEP_SMALL_FACE_NORMAL = 5489,
|
||||
SPR_PEEP_SMALL_FACE_HAPPY = 5490,
|
||||
SPR_PEEP_SMALL_FACE_VERY_HAPPY = 5491,
|
||||
SPR_PEEP_SMALL_FACE_VERY_VERY_HAPPY = 5492,
|
||||
SPR_PEEP_SMALL_FACE_TIRED = 5493,
|
||||
SPR_PEEP_SMALL_FACE_VERY_TIRED = 5494,
|
||||
SPR_PEEP_SMALL_FACE_SICK = 5495,
|
||||
SPR_PEEP_SMALL_FACE_VERY_SICK = 5496,
|
||||
SPR_PEEP_SMALL_FACE_VERY_VERY_SICK = 5497,
|
||||
SPR_PEEP_SMALL_FACE_ANGRY = 5498,
|
||||
|
||||
SPR_LAND_TOOL_DECREASE = 5499,
|
||||
|
||||
SPR_LAND_TOOL_INCREASE = 5501,
|
||||
|
||||
@@ -218,6 +218,7 @@ enum {
|
||||
STR_ADJUST_WATER_TIP = 1160,
|
||||
|
||||
STR_OPTIONS = 1168,
|
||||
STR_SOUND_NONE = 1169,
|
||||
|
||||
STR_BUILD_FOOTPATH_TIP = 1173,
|
||||
STR_CANT_BUILD_FOOTPATH_HERE = 1176,
|
||||
@@ -280,6 +281,8 @@ enum {
|
||||
STR_SUMMARISED_GUESTS_TIP = 1753,
|
||||
STR_ADMISSION_PRICE = 1756,
|
||||
|
||||
STR_OFF = 1775,
|
||||
STR_ON = 1776,
|
||||
STR_MUSIC = 1777,
|
||||
|
||||
STR_ACTIONS = 1814,
|
||||
@@ -322,7 +325,7 @@ enum {
|
||||
|
||||
STR_SHOW_SUBJECT_TIP = 1937,
|
||||
|
||||
STR_CELCIUS_VALUE = 2216,
|
||||
STR_CELSIUS_VALUE = 2216,
|
||||
STR_FAHRENHEIT_VALUE = 2217,
|
||||
|
||||
STR_PARK_RATING_LABEL = 2220,
|
||||
@@ -330,14 +333,6 @@ enum {
|
||||
|
||||
STR_GUESTS_IN_PARK_LABEL = 2223,
|
||||
|
||||
STR_NUMBER_OF_RIDES_LABEL = 2321,
|
||||
STR_STAFF_LABEL = 2322,
|
||||
STR_PARK_SIZE_METRIC_LABEL = 2323,
|
||||
STR_PARK_SIZE_IMPERIAL_LABEL = 2324,
|
||||
|
||||
SPR_BUY_LAND_RIGHTS_TIP = 2325,
|
||||
SPR_BUY_CONSTRUCTION_RIGHTS_TIP = 2326,
|
||||
|
||||
STR_PARK_INFORMATION_TIP = 2233,
|
||||
STR_RECENT_MESSAGES = 2234,
|
||||
|
||||
@@ -360,19 +355,43 @@ enum {
|
||||
STR_CHANGE_VERTICAL_LAND_TIP = 2295,
|
||||
|
||||
STR_SOUND_QUALITY = 2317,
|
||||
STR_SOUND_LOW = 2318,
|
||||
STR_SOUND_MEDIUM = 2319,
|
||||
STR_SOUND_HIGH = 2320,
|
||||
STR_NUMBER_OF_RIDES_LABEL = 2321,
|
||||
STR_STAFF_LABEL = 2322,
|
||||
STR_PARK_SIZE_METRIC_LABEL = 2323,
|
||||
STR_PARK_SIZE_IMPERIAL_LABEL = 2324,
|
||||
SPR_BUY_LAND_RIGHTS_TIP = 2325,
|
||||
SPR_BUY_CONSTRUCTION_RIGHTS_TIP = 2326,
|
||||
STR_CURRENCY = 2328,
|
||||
STR_DISTANCE_AND_SPEED = 2329,
|
||||
STR_TEMPERATURE = 2330,
|
||||
STR_HEIGHT_LABELS = 2331,
|
||||
STR_UNITS = 2332,
|
||||
STR_SOUND = 2333,
|
||||
STR_POUNDS = 2334,
|
||||
STR_DOLLARS = 2335,
|
||||
STR_FRANC = 2336,
|
||||
STR_DEUTSCHMARK = 2337,
|
||||
STR_YEN = 2338,
|
||||
STR_PESETA = 2339,
|
||||
STR_LIRA = 2340,
|
||||
STR_GUILDERS = 2341,
|
||||
STR_KRONA = 2342,
|
||||
STR_EUROS = 2343,
|
||||
STR_IMPERIAL = 2344,
|
||||
STR_METRIC = 2345,
|
||||
STR_DISPLAY = 2346,
|
||||
//STR_UNITS = 2358,
|
||||
STR_REAL_VALUES = 2359,
|
||||
STR_DISPLAY_RESOLUTION = 2360,
|
||||
STR_TILE_SMOOTHING = 2361,
|
||||
STR_TILE_SMOOTHING_TIP = 2362,
|
||||
STR_GRIDLINES = 2363,
|
||||
STR_GRIDLINES_TIP = 2364,
|
||||
|
||||
STR_CELSIUS = 2366,
|
||||
STR_FAHRENHEIT = 2367,
|
||||
//STR_NONE = 2368,
|
||||
STR_LOW = 2369,
|
||||
STR_AVERAGE = 2370,
|
||||
@@ -494,6 +513,8 @@ enum {
|
||||
STR_UNABLE_TO_LOAD_FILE = 3010,
|
||||
STR_FILE_CONTAINS_INVALID_DATA = 3011,
|
||||
|
||||
STR_WHITE = 3055,
|
||||
STR_TRANSLUCENT = 3056,
|
||||
STR_CONSTRUCTION_MARKER = 3057,
|
||||
|
||||
STR_BEGINNER_PARKS = 3064,
|
||||
|
||||
@@ -211,20 +211,20 @@ static void window_game_bottom_toolbar_tooltip()
|
||||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_MONEY:
|
||||
*((int*)0x013CE952) = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, sint32);
|
||||
*((int*)0x013CE956) = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PARK_VALUE, sint32);
|
||||
RCT2_GLOBAL(0x013CE952, int) = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, sint32);
|
||||
RCT2_GLOBAL(0x013CE956, int) = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PARK_VALUE, sint32);
|
||||
widgetIndex = 0;
|
||||
break;
|
||||
case WIDX_PARK_RATING:
|
||||
*((short*)0x013CE952) = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PARK_RATING, sint16);
|
||||
RCT2_GLOBAL(0x013CE952, short) = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PARK_RATING, sint16);
|
||||
widgetIndex = 0;
|
||||
break;
|
||||
case WIDX_DATE:
|
||||
month = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, sint16) & 7;
|
||||
day = ((RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_TICKS, sint16) * days_in_month[month]) >> 16) & 0xFF;
|
||||
|
||||
*((short*)0x013CE952) = STR_DATE_DAY_1 + day;
|
||||
*((short*)0x013CE954) = STR_MONTH_MARCH + month;
|
||||
|
||||
RCT2_GLOBAL(0x013CE952, short) = STR_DATE_DAY_1 + day;
|
||||
RCT2_GLOBAL(0x013CE954, short) = STR_MONTH_MARCH + month;
|
||||
widgetIndex = 0;
|
||||
break;
|
||||
}
|
||||
@@ -386,10 +386,10 @@ static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo *dpi, r
|
||||
|
||||
// Draw money
|
||||
if (!(RCT2_GLOBAL(0x0013573E4, uint32) & 0x800)) {
|
||||
*((int*)0x013CE952) = DECRYPT_MONEY(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, sint32));
|
||||
RCT2_GLOBAL(0x013CE952, int) = DECRYPT_MONEY(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, sint32));
|
||||
gfx_draw_string_centred(
|
||||
dpi,
|
||||
(*((int*)0x013CE952) < 0 ? 1391 : 1390),
|
||||
(RCT2_GLOBAL(0x013CE952, int) < 0 ? 1391 : 1390),
|
||||
x, y - 3,
|
||||
(RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_OVER_WINDOWCLASS, rct_windowclass) == 2 && RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_OVER_WIDGETINDEX, sint32) == WIDX_MONEY ? 2 : w->colours[0] & 0x7F),
|
||||
(void*)0x013CE952
|
||||
@@ -403,7 +403,7 @@ static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo *dpi, r
|
||||
STR_NUM_GUESTS + RCT2_GLOBAL(0x013573FE, uint8),
|
||||
x, y,
|
||||
(RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_OVER_WINDOWCLASS, rct_windowclass) == 2 && RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_OVER_WIDGETINDEX, sint32) == WIDX_GUESTS ? 2 : w->colours[0] & 0x7F),
|
||||
(void*)0x01357844
|
||||
(void*)RCT2_ADDRESS_GUESTS_IN_PARK
|
||||
);
|
||||
|
||||
// Draw park rating
|
||||
@@ -456,7 +456,7 @@ static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo *dpi,
|
||||
y = window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].top + w->y + 2;
|
||||
|
||||
// Date
|
||||
*((short*)0x013CE952) = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, sint16);
|
||||
RCT2_GLOBAL(0x013CE952, short) = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, sint16);
|
||||
gfx_draw_string_centred(
|
||||
dpi,
|
||||
1845,
|
||||
@@ -471,12 +471,12 @@ static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo *dpi,
|
||||
y += 11;
|
||||
|
||||
temperature = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TEMPERATURE, sint8);
|
||||
format = STR_CELCIUS_VALUE;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FAHRENHEIT, uint8)) {
|
||||
temperature = climate_celcius_to_fahrenheit(temperature);
|
||||
format = STR_CELSIUS_VALUE;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_TEMPERATURE, uint8)) {
|
||||
temperature = climate_celsius_to_fahrenheit(temperature);
|
||||
format = STR_FAHRENHEIT_VALUE;
|
||||
}
|
||||
*((short*)0x013CE952) = temperature;
|
||||
RCT2_GLOBAL(0x013CE952, short) = temperature;
|
||||
gfx_draw_string_left(dpi, format, (void*)0x013CE952, 0, x, y + 6);
|
||||
x += 30;
|
||||
|
||||
|
||||
@@ -361,7 +361,7 @@ static void window_game_top_toolbar_dropdown()
|
||||
src++;
|
||||
} while (*src != '.' && *src != '\0');
|
||||
strcpy(src, ".SV6");
|
||||
strcpy(0x009ABB37, 0x0141EF68);
|
||||
strcpy(RCT2_ADDRESS_SAVED_GAMES_PATH_2, 0x0141EF68);
|
||||
|
||||
eax = 0;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & 8)
|
||||
@@ -482,6 +482,6 @@ static void window_game_top_toolbar_paint()
|
||||
imgId = 5627;
|
||||
if (widget_is_pressed(w, WIDX_STAFF))
|
||||
imgId++;
|
||||
imgId |= (RCT2_GLOBAL(0x01357BCD, uint8) << 19) | 0xA0000000 | (RCT2_GLOBAL(0x01357BCE, uint8) << 24);
|
||||
imgId |= (RCT2_GLOBAL(RCT2_ADDRESS_HANDYMAN_COLOUR, uint8) << 19) | 0xA0000000 | (RCT2_GLOBAL(RCT2_ADDRESS_MECHANIC_COLOUR, uint8) << 24);
|
||||
gfx_draw_sprite(dpi, imgId, x, y);
|
||||
}
|
||||
|
||||
@@ -539,10 +539,9 @@ static void window_guest_list_paint()
|
||||
|
||||
// Widgets
|
||||
window_draw_widgets(w, dpi);
|
||||
|
||||
// Tab 1 image
|
||||
i = (_window_guest_list_selected_tab == 0 ? w->var_490 & 0x0FFFFFFFC : 0);
|
||||
i += ((int*)*((int*)0x00982708))[0] + 1;
|
||||
i += RCT2_ADDRESS(RCT2_GLOBAL(0x00982708, int), int)[0] + 1;
|
||||
i |= 0xA1600000;
|
||||
gfx_draw_sprite(
|
||||
dpi,
|
||||
@@ -935,26 +934,27 @@ static void window_guest_list_find_groups()
|
||||
static int get_guest_face_sprite_small(rct_peep *peep)
|
||||
{
|
||||
int sprite;
|
||||
sprite = 0x157A;
|
||||
sprite = SPR_PEEP_SMALL_FACE_ANGRY;
|
||||
|
||||
if (peep->var_F3) return sprite;
|
||||
sprite = SPR_PEEP_SMALL_FACE_VERY_VERY_SICK;
|
||||
|
||||
sprite = 0x1579;
|
||||
if (peep->nausea > 200) return sprite;
|
||||
sprite--;
|
||||
sprite--; //VERY_SICK
|
||||
|
||||
if (peep->nausea > 170) return sprite;
|
||||
sprite--;
|
||||
sprite--; //SICK
|
||||
|
||||
if (peep->nausea > 140) return sprite;
|
||||
sprite = 0x1576;
|
||||
sprite = SPR_PEEP_SMALL_FACE_VERY_TIRED;
|
||||
|
||||
if (peep->energy < 46) return sprite;
|
||||
sprite--;
|
||||
sprite--; //TIRED
|
||||
|
||||
if (peep->energy < 70) return sprite;
|
||||
sprite = 0x156E;
|
||||
sprite = SPR_PEEP_SMALL_FACE_VERY_VERY_UNHAPPY;
|
||||
|
||||
//There are 7 different happiness based faces
|
||||
for (int i = 37; peep->happiness >= i; i += 37)
|
||||
{
|
||||
sprite++;
|
||||
@@ -969,26 +969,27 @@ static int get_guest_face_sprite_small(rct_peep *peep)
|
||||
*/
|
||||
static int get_guest_face_sprite_large(rct_peep* peep){
|
||||
int sprite;
|
||||
sprite = 5314;
|
||||
sprite = SPR_PEEP_LARGE_FACE_ANGRY;
|
||||
|
||||
if (peep->var_F3) return sprite;
|
||||
sprite = SPR_PEEP_LARGE_FACE_VERY_VERY_SICK;
|
||||
|
||||
sprite = 5298;
|
||||
if (peep->nausea > 200) return sprite;
|
||||
sprite = 0x14AE;
|
||||
sprite = SPR_PEEP_LARGE_FACE_VERY_SICK;
|
||||
|
||||
if (peep->nausea > 170) return sprite;
|
||||
sprite = 0x14AD;
|
||||
sprite = SPR_PEEP_LARGE_FACE_SICK;
|
||||
|
||||
if (peep->nausea > 140) return sprite;
|
||||
sprite = 0x14AC;
|
||||
sprite = SPR_PEEP_LARGE_FACE_VERY_TIRED;
|
||||
|
||||
if (peep->energy < 46) return sprite;
|
||||
sprite--;
|
||||
sprite--; //TIRED
|
||||
|
||||
if (peep->energy < 70) return sprite;
|
||||
sprite = 0x14A4;
|
||||
sprite = SPR_PEEP_LARGE_FACE_VERY_VERY_UNHAPPY;
|
||||
|
||||
//There are 7 different happiness based faces
|
||||
for (int i = 37; peep->happiness >= i; i += 37)
|
||||
{
|
||||
sprite++;
|
||||
|
||||
@@ -19,7 +19,11 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#include "addresses.h"
|
||||
#include "audio.h"
|
||||
#include "config.h"
|
||||
#include "gfx.h"
|
||||
#include "strings.h"
|
||||
#include "viewport.h"
|
||||
#include "widget.h"
|
||||
#include "window.h"
|
||||
#include "window_dropdown.h"
|
||||
@@ -103,6 +107,8 @@ static void window_options_mousedown();
|
||||
static void window_options_dropdown();
|
||||
static void window_options_update();
|
||||
static void window_options_paint();
|
||||
static void window_options_draw_dropdown_box(w, widget, num_items);
|
||||
static void window_options_update_height_markers();
|
||||
|
||||
static void* window_options_events[] = {
|
||||
window_options_emptysub,
|
||||
@@ -175,8 +181,8 @@ void window_options_open()
|
||||
(1 << WIDX_HEIGHT_LABELS_DROPDOWN) |
|
||||
(1 << WIDX_TILE_SMOOTHING_CHECKBOX) |
|
||||
(1 << WIDX_GRIDLINES_CHECKBOX) |
|
||||
(1 << WIDX_SOUND_SW_BUFFER_CHECKBOX);
|
||||
// TODO: missing .text:006BAD22 or dword ptr [esi+0Ch], 1
|
||||
(1 << WIDX_SOUND_SW_BUFFER_CHECKBOX) |
|
||||
(1ULL << WIDX_SAVE_PLUGIN_DATA_CHECKBOX); // doesn't seem to work?
|
||||
|
||||
window_init_scroll_widgets(w);
|
||||
w->colours[0] = 7;
|
||||
@@ -190,7 +196,64 @@ void window_options_open()
|
||||
*/
|
||||
static void window_options_mouseup()
|
||||
{
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BAFCA);
|
||||
short widgetIndex;
|
||||
rct_window *w;
|
||||
|
||||
__asm mov widgetIndex, dx
|
||||
__asm mov w, esi
|
||||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_CLOSE:
|
||||
window_close(w);
|
||||
break;
|
||||
case WIDX_HOTKEY_DROPDOWN:
|
||||
RCT2_CALLPROC_EBPSAFE(0x006E3884);
|
||||
break;
|
||||
case WIDX_SCREEN_EDGE_SCROLLING:
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_EDGE_SCROLLING, uint8) ^= 1;
|
||||
config_save();
|
||||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_REAL_NAME_CHECKBOX:
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) ^= PARK_FLAGS_SHOW_REAL_GUEST_NAMES;
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_SHOW_REAL_GUEST_NAMES)
|
||||
__asm xor al, al
|
||||
else
|
||||
__asm mov al, 1
|
||||
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069C52F);
|
||||
break;
|
||||
case WIDX_TILE_SMOOTHING_CHECKBOX:
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) ^= CONFIG_FLAG_DISABLE_SMOOTH_LANDSCAPE;
|
||||
config_save();
|
||||
gfx_invalidate_screen();
|
||||
break;
|
||||
case WIDX_GRIDLINES_CHECKBOX:
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) ^= CONFIG_FLAG_ALWAYS_SHOW_GRIDLINES;
|
||||
config_save();
|
||||
gfx_invalidate_screen();
|
||||
|
||||
if ((w = window_get_main()) != NULL) {
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & CONFIG_FLAG_ALWAYS_SHOW_GRIDLINES)
|
||||
w->viewport->flags |= VIEWPORT_FLAG_GRIDLINES;
|
||||
else
|
||||
w->viewport->flags &= ~VIEWPORT_FLAG_GRIDLINES;
|
||||
}
|
||||
break;
|
||||
case WIDX_SAVE_PLUGIN_DATA_CHECKBOX:
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) ^= CONFIG_FLAG_SAVE_PLUGIN_DATA;
|
||||
config_save();
|
||||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_SOUND_SW_BUFFER_CHECKBOX:
|
||||
pause_sounds();
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_SW_BUFFER, uint8) ^= 1;
|
||||
config_save();
|
||||
unpause_sounds();
|
||||
window_invalidate(w);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -199,8 +262,7 @@ static void window_options_mouseup()
|
||||
*/
|
||||
static void window_options_mousedown()
|
||||
{
|
||||
//RCT2_CALLPROC_EBPSAFE(0x006BB01B);
|
||||
int numItems, i;
|
||||
int num_items, i;
|
||||
sint64 device;
|
||||
short widgetIndex;
|
||||
rct_window *w;
|
||||
@@ -213,24 +275,16 @@ static void window_options_mousedown()
|
||||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_SOUND_DROPDOWN:
|
||||
numItems = RCT2_GLOBAL(RCT2_ADDRESS_NUM_DSOUND_DEVICES, uint32);
|
||||
if (numItems == 0)
|
||||
num_items = RCT2_GLOBAL(RCT2_ADDRESS_NUM_DSOUND_DEVICES, uint32);
|
||||
if (num_items == 0)
|
||||
break;
|
||||
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0x80,
|
||||
numItems,
|
||||
widget->right - widget->left - 3
|
||||
);
|
||||
window_options_draw_dropdown_box(w, widget, num_items);
|
||||
|
||||
// populate the list with the sound devices
|
||||
device = RCT2_GLOBAL(RCT2_ADDRESS_DSOUND_DEVICES, sint32) + 0x10;
|
||||
|
||||
for (i = 0; i < numItems; i++) {
|
||||
for (i = 0; i < num_items; i++) {
|
||||
gDropdownItemsFormat[i] = 1142;
|
||||
gDropdownItemsArgs[i] = 1170 | (device << 16);
|
||||
device += 0x210;
|
||||
@@ -239,28 +293,85 @@ static void window_options_mousedown()
|
||||
|
||||
break;
|
||||
case WIDX_HEIGHT_LABELS_DROPDOWN:
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BB517);
|
||||
window_options_draw_dropdown_box(w, widget, 2);
|
||||
|
||||
gDropdownItemsFormat[0] = 1142;
|
||||
gDropdownItemsFormat[1] = 1142;
|
||||
gDropdownItemsArgs[0] = STR_UNITS;
|
||||
gDropdownItemsArgs[1] = STR_REAL_VALUES;
|
||||
|
||||
gDropdownItemsChecked =
|
||||
(RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) &
|
||||
CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS) ? 1 : 2;
|
||||
|
||||
break;
|
||||
case WIDX_MUSIC_DROPDOWN:
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BB5A8);
|
||||
window_options_draw_dropdown_box(w, widget, 2);
|
||||
|
||||
gDropdownItemsFormat[0] = 1142;
|
||||
gDropdownItemsFormat[1] = 1142;
|
||||
gDropdownItemsArgs[0] = STR_OFF;
|
||||
gDropdownItemsArgs[1] = STR_ON;
|
||||
|
||||
gDropdownItemsChecked = 1 << RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_MUSIC, uint8);
|
||||
|
||||
break;
|
||||
case WIDX_SOUND_QUALITY_DROPDOWN:
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BB631);
|
||||
num_items = 3;
|
||||
window_options_draw_dropdown_box(w, widget, num_items);
|
||||
|
||||
for (i = 0; i < num_items; i++) {
|
||||
gDropdownItemsFormat[i] = 1142;
|
||||
gDropdownItemsArgs[i] = STR_SOUND_LOW + i; // low, medium, high
|
||||
}
|
||||
gDropdownItemsChecked = 1 << RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, uint8);
|
||||
|
||||
break;
|
||||
case WIDX_CURRENCY_DROPDOWN:
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BB494);
|
||||
num_items = 10;
|
||||
window_options_draw_dropdown_box(w, widget, num_items);
|
||||
|
||||
for (i = 0; i < num_items; i++) {
|
||||
gDropdownItemsFormat[i] = 1142;
|
||||
gDropdownItemsArgs[i] = STR_POUNDS + i; // all different currencies
|
||||
}
|
||||
gDropdownItemsChecked = 1 << (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CURRENCY, uint8) & 0x3F);
|
||||
|
||||
break;
|
||||
case WIDX_DISTANCE_DROPDOWN:
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BB3E6);
|
||||
window_options_draw_dropdown_box(w, widget, 2);
|
||||
|
||||
gDropdownItemsFormat[0] = 1142;
|
||||
gDropdownItemsFormat[1] = 1142;
|
||||
gDropdownItemsArgs[0] = STR_IMPERIAL;
|
||||
gDropdownItemsArgs[1] = STR_METRIC;
|
||||
|
||||
gDropdownItemsChecked = 1 << RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, uint8);
|
||||
|
||||
break;
|
||||
case WIDX_RESOLUTION_DROPDOWN:
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BB2AF);
|
||||
break;
|
||||
case WIDX_TEMPERATURE_DROPDOWN:
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BB21F);
|
||||
window_options_draw_dropdown_box(w, widget, 2);
|
||||
|
||||
gDropdownItemsFormat[0] = 1142;
|
||||
gDropdownItemsFormat[1] = 1142;
|
||||
gDropdownItemsArgs[0] = STR_CELSIUS;
|
||||
gDropdownItemsArgs[1] = STR_FAHRENHEIT;
|
||||
|
||||
gDropdownItemsChecked = 1 << RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_TEMPERATURE, uint8);
|
||||
|
||||
break;
|
||||
case WIDX_CONSTRUCTION_MARKER_DROPDOWN:
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BB18F);
|
||||
window_options_draw_dropdown_box(w, widget, 2);
|
||||
|
||||
gDropdownItemsFormat[0] = 1142;
|
||||
gDropdownItemsFormat[1] = 1142;
|
||||
gDropdownItemsArgs[0] = STR_WHITE;
|
||||
gDropdownItemsArgs[1] = STR_TRANSLUCENT;
|
||||
|
||||
gDropdownItemsChecked = 1 << RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER, uint8);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -271,18 +382,76 @@ static void window_options_mousedown()
|
||||
*/
|
||||
static void window_options_dropdown()
|
||||
{
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BB076);
|
||||
/*short widgetIndex;
|
||||
short dropdownIndex;
|
||||
short widgetIndex;
|
||||
rct_window *w;
|
||||
|
||||
__asm mov dropdownIndex, ax
|
||||
__asm mov widgetIndex, dx
|
||||
__asm mov w, esi
|
||||
|
||||
if (dropdownIndex == -1)
|
||||
return;
|
||||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_SOUND_DROPDOWN:
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BB757);
|
||||
__asm movzx ax, dropdownIndex // the switch replaces ax value
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BA9B5); // part of init audio
|
||||
window_invalidate(w);
|
||||
break;
|
||||
}*/
|
||||
case WIDX_HEIGHT_LABELS_DROPDOWN:
|
||||
// reset flag and set it to 1 if height as units is selected
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) &= ~CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS;
|
||||
|
||||
if (dropdownIndex == 0)
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) |= CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS;
|
||||
|
||||
window_options_update_height_markers();
|
||||
break;
|
||||
case WIDX_MUSIC_DROPDOWN:
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_MUSIC, uint8) = (uint8)dropdownIndex;
|
||||
config_save();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BCA9F);
|
||||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_SOUND_QUALITY_DROPDOWN:
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, uint8) = (uint8)dropdownIndex;
|
||||
|
||||
// TODO: no clue what this does (and if it's correct)
|
||||
RCT2_GLOBAL(0x009AAC75, uint8) = RCT2_GLOBAL(0x009AF601 + dropdownIndex, uint8);
|
||||
RCT2_GLOBAL(0x009AAC76, uint8) = RCT2_GLOBAL(0x009AF604 + dropdownIndex, uint8);
|
||||
|
||||
config_save();
|
||||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_CURRENCY_DROPDOWN:
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CURRENCY, uint8) = dropdownIndex | 0xC0;
|
||||
config_save();
|
||||
gfx_invalidate_screen();
|
||||
break;
|
||||
case WIDX_DISTANCE_DROPDOWN:
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, uint8) = (uint8)dropdownIndex;
|
||||
window_options_update_height_markers();
|
||||
break;
|
||||
case WIDX_RESOLUTION_DROPDOWN:
|
||||
__asm movzx ax, dropdownIndex // the switch replaces ax value
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BB37D);
|
||||
break;
|
||||
case WIDX_TEMPERATURE_DROPDOWN:
|
||||
if (dropdownIndex != RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_TEMPERATURE, uint8)) {
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_TEMPERATURE, uint8) = (uint8)dropdownIndex;
|
||||
config_save();
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
break;
|
||||
case WIDX_CONSTRUCTION_MARKER_DROPDOWN:
|
||||
if (dropdownIndex != RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER, uint8)) {
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER, uint8) = (uint8)dropdownIndex;
|
||||
config_save();
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -291,7 +460,103 @@ static void window_options_dropdown()
|
||||
*/
|
||||
static void window_options_update()
|
||||
{
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BAD48);
|
||||
sint32 format_args = RCT2_GLOBAL(0x009AF280, sint32);
|
||||
rct_window *w;
|
||||
|
||||
__asm mov w, esi
|
||||
|
||||
// sound devices
|
||||
if (format_args == -1 || RCT2_GLOBAL(RCT2_ADDRESS_NUM_DSOUND_DEVICES, sint32) == 0) {
|
||||
RCT2_GLOBAL(0x013CE952, uint16) = STR_SOUND_NONE;
|
||||
} else {
|
||||
format_args = RCT2_GLOBAL(RCT2_ADDRESS_DSOUND_DEVICES, uint32) + format_args * 0x210 + 16;
|
||||
RCT2_GLOBAL(0x013CE952, uint16) = 1170;
|
||||
RCT2_GLOBAL(0x013CE952 + 2, uint32) = format_args;
|
||||
}
|
||||
|
||||
// height: units/real values
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS))
|
||||
format_args = STR_UNITS;
|
||||
else
|
||||
format_args = STR_REAL_VALUES;
|
||||
|
||||
RCT2_GLOBAL(0x013CE952 + 6, uint16) = (uint16)format_args;
|
||||
|
||||
// music: on/off
|
||||
RCT2_GLOBAL(0x013CE952 + 8, uint16) = STR_OFF +
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_MUSIC, uint8);
|
||||
|
||||
// sound quality: low/medium/high
|
||||
RCT2_GLOBAL(0x013CE952 + 10, uint16) = STR_SOUND_LOW +
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_QUALITY, uint8);
|
||||
|
||||
// currency: pounds, dollars, etc. (10 total)
|
||||
RCT2_GLOBAL(0x013CE952 + 12, uint16) = STR_POUNDS +
|
||||
(RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CURRENCY, uint8) & 0x3F);
|
||||
|
||||
// distance: metric/imperial
|
||||
RCT2_GLOBAL(0x013CE952 + 14, uint16) = STR_IMPERIAL +
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, uint8);
|
||||
|
||||
// resolution
|
||||
RCT2_GLOBAL(0x013CE952 + 16, uint16) =
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_RESOLUTION_WIDTH, uint16);
|
||||
RCT2_GLOBAL(0x013CE952 + 18, uint16) =
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_RESOLUTION_HEIGHT, uint16);
|
||||
|
||||
// temperature: celsius/fahrenheit
|
||||
RCT2_GLOBAL(0x013CE952 + 20, uint16) = STR_CELSIUS +
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_TEMPERATURE, uint8);
|
||||
|
||||
// construction marker: celsius/fahrenheit
|
||||
window_options_widgets[WIDX_CONSTRUCTION_MARKER].image = STR_WHITE +
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER, uint8);
|
||||
|
||||
// sound software mixing buffer checkbox
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_SOUND_SW_BUFFER, uint8))
|
||||
w->pressed_widgets |= (1 << WIDX_SOUND_SW_BUFFER_CHECKBOX);
|
||||
else
|
||||
w->pressed_widgets &= ~(1 << WIDX_SOUND_SW_BUFFER_CHECKBOX);
|
||||
|
||||
// screen edge scrolling checkbox
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_EDGE_SCROLLING, uint8))
|
||||
w->pressed_widgets |= (1 << WIDX_SCREEN_EDGE_SCROLLING);
|
||||
else
|
||||
w->pressed_widgets &= ~(1 << WIDX_SCREEN_EDGE_SCROLLING);
|
||||
|
||||
// real name checkbox
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_SHOW_REAL_GUEST_NAMES)
|
||||
w->pressed_widgets |= (1 << WIDX_REAL_NAME_CHECKBOX);
|
||||
else
|
||||
w->pressed_widgets &= ~(1 << WIDX_REAL_NAME_CHECKBOX);
|
||||
|
||||
// landscape tile smoothing checkbox
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & CONFIG_FLAG_DISABLE_SMOOTH_LANDSCAPE))
|
||||
w->pressed_widgets &= ~(1 << WIDX_TILE_SMOOTHING_CHECKBOX);
|
||||
else
|
||||
w->pressed_widgets |= (1 << WIDX_TILE_SMOOTHING_CHECKBOX);
|
||||
|
||||
// show gridlines checkbox
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & CONFIG_FLAG_ALWAYS_SHOW_GRIDLINES))
|
||||
w->pressed_widgets |= (1 << WIDX_GRIDLINES_CHECKBOX);
|
||||
else
|
||||
w->pressed_widgets &= ~(1 << WIDX_GRIDLINES_CHECKBOX);
|
||||
|
||||
// save plugin data checkbox
|
||||
if ((RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & CONFIG_FLAG_SAVE_PLUGIN_DATA))
|
||||
w->pressed_widgets |= (1ULL << WIDX_SAVE_PLUGIN_DATA_CHECKBOX);
|
||||
else
|
||||
w->pressed_widgets &= ~(1ULL << WIDX_SAVE_PLUGIN_DATA_CHECKBOX);
|
||||
|
||||
// unknown park flag can disable real name checkbox
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x8000)
|
||||
w->disabled_widgets |= (1 << WIDX_REAL_NAME_CHECKBOX);
|
||||
|
||||
// save plugin data checkbox: visible or not
|
||||
if (RCT2_GLOBAL(0x00F42BDA, uint8) == 1)
|
||||
window_options_widgets[WIDX_SAVE_PLUGIN_DATA_CHECKBOX].type = WWT_EMPTY;
|
||||
else
|
||||
window_options_widgets[WIDX_SAVE_PLUGIN_DATA_CHECKBOX].type = WWT_CHECKBOX;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -329,4 +594,31 @@ static void window_options_paint()
|
||||
w->y + window_options_widgets[WIDX_MUSIC].top + 1);
|
||||
gfx_draw_string_left(dpi, STR_SOUND_QUALITY, w, 0, w->x + 10,
|
||||
w->y + window_options_widgets[WIDX_SOUND_QUALITY].top + 1);
|
||||
}
|
||||
|
||||
// helper function, all dropdown boxes have similar properties
|
||||
static void window_options_draw_dropdown_box(rct_window *w, rct_widget *widget, int num_items)
|
||||
{
|
||||
window_dropdown_show_text_custom_width(
|
||||
w->x + widget->left,
|
||||
w->y + widget->top,
|
||||
widget->bottom - widget->top + 1,
|
||||
w->colours[1],
|
||||
0x80,
|
||||
num_items,
|
||||
widget->right - widget->left - 3
|
||||
);
|
||||
}
|
||||
|
||||
static void window_options_update_height_markers()
|
||||
{
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS) {
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, uint16) = 0;
|
||||
} else { // use real values (metric or imperial)
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, uint16) =
|
||||
(RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, uint16) + 1) * 256;
|
||||
}
|
||||
|
||||
config_save();
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
@@ -1790,7 +1790,7 @@ static void window_park_objective_paint()
|
||||
x = w->x + window_park_objective_widgets[WIDX_PAGE_BACKGROUND].left + 4;
|
||||
y = w->y + window_park_objective_widgets[WIDX_PAGE_BACKGROUND].top + 7;
|
||||
strcpy((char*)0x009BC677, RCT2_ADDRESS(RCT2_ADDRESS_SCENARIO_DETAILS, char));
|
||||
*((short*)0x013CE952) = 3165;
|
||||
RCT2_GLOBAL(0x013CE952, short) = 3165;
|
||||
y += gfx_draw_string_left_wrapped(dpi, (void*)0x013CE952, x, y, 222, 1191, 0);
|
||||
y += 5;
|
||||
|
||||
@@ -1799,9 +1799,9 @@ static void window_park_objective_paint()
|
||||
y += 10;
|
||||
|
||||
// Objective
|
||||
*((short*)0x013CE952) = RCT2_GLOBAL(RCT2_ADDRESS_OBJECTIVE_NUM_GUESTS, uint16);
|
||||
*((short*)0x013CE954) = date_get_total_months(MONTH_OCTOBER, RCT2_GLOBAL(RCT2_ADDRESS_OBJECTIVE_YEAR, uint8));
|
||||
*((int*)0x013CE956) = RCT2_GLOBAL(RCT2_ADDRESS_OBJECTIVE_CURRENCY, sint32);
|
||||
RCT2_GLOBAL(0x013CE952, short) = RCT2_GLOBAL(RCT2_ADDRESS_OBJECTIVE_NUM_GUESTS, uint16);
|
||||
RCT2_GLOBAL(0x013CE954, short) = date_get_total_months(MONTH_OCTOBER, RCT2_GLOBAL(RCT2_ADDRESS_OBJECTIVE_YEAR, uint8));
|
||||
RCT2_GLOBAL(0x013CE956, int) = RCT2_GLOBAL(RCT2_ADDRESS_OBJECTIVE_CURRENCY, sint32);
|
||||
|
||||
gfx_draw_string_left_wrapped(dpi, (void*)0x013CE952, x, y, 221, 2385 + RCT2_GLOBAL(RCT2_ADDRESS_OBJECTIVE_TYPE, uint8), 0);
|
||||
y += 5;
|
||||
@@ -1813,7 +1813,7 @@ static void window_park_objective_paint()
|
||||
gfx_draw_string_left_wrapped(dpi, NULL, x, y, 222, 2789, 0);
|
||||
} else {
|
||||
// Objective completed
|
||||
*((int*)0x013CE952) = RCT2_GLOBAL(RCT2_ADDRESS_COMPLETED_COMPANY_VALUE, uint32);
|
||||
RCT2_GLOBAL(0x013CE952, int) = RCT2_GLOBAL(RCT2_ADDRESS_COMPLETED_COMPANY_VALUE, uint32);
|
||||
gfx_draw_string_left_wrapped(dpi, (void*)0x013CE952, x, y, 222, 2788, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ static void window_scenarioselect_paint()
|
||||
|
||||
x = (widget->left + widget->right) / 2 + w->x;
|
||||
y = (widget->top + widget->bottom) / 2 + w->y - 3;
|
||||
*((short*)(0x0013CE952 + 0)) = STR_BEGINNER_PARKS + i;
|
||||
RCT2_GLOBAL(0x013CE952 + 0, short) = STR_BEGINNER_PARKS + i;
|
||||
gfx_draw_string_centred_wrapped(dpi, (void*)0x013CE952, x, y, 87, 1193, 10);
|
||||
}
|
||||
|
||||
@@ -327,27 +327,27 @@ static void window_scenarioselect_paint()
|
||||
x = w->x + window_scenarioselect_widgets[WIDX_SCENARIOLIST].right + 4;
|
||||
y = w->y + window_scenarioselect_widgets[WIDX_TABCONTENT].top + 5;
|
||||
strcpy((char*)0x009BC677, scenario->name);
|
||||
*((short*)(0x0013CE952 + 0)) = 3165;
|
||||
RCT2_GLOBAL(0x013CE952 + 0, short) = 3165;
|
||||
gfx_draw_string_centred_clipped(dpi, 1193, (void*)0x013CE952, 0, x + 85, y, 170);
|
||||
y += 15;
|
||||
|
||||
// Scenario details
|
||||
strcpy((char*)0x009BC677, scenario->details);
|
||||
*((short*)(0x0013CE952 + 0)) = 3165;
|
||||
RCT2_GLOBAL(0x013CE952 + 0, short) = 3165;
|
||||
y += gfx_draw_string_left_wrapped(dpi, (void*)0x013CE952, x, y, 170, 1191, 0) + 5;
|
||||
|
||||
// Scenario objective
|
||||
*((short*)(0x0013CE952 + 0)) = scenario->objective_type + STR_OBJECTIVE_NONE;
|
||||
*((short*)(0x0013CE952 + 2)) = scenario->objective_arg_3;
|
||||
*((short*)(0x0013CE952 + 4)) = date_get_total_months(MONTH_OCTOBER, scenario->objective_arg_1);
|
||||
*((int*)(0x0013CE952 + 6)) = scenario->objective_arg_2;
|
||||
RCT2_GLOBAL(0x013CE952 + 0, short) = scenario->objective_type + STR_OBJECTIVE_NONE;
|
||||
RCT2_GLOBAL(0x013CE952 + 2, short) = scenario->objective_arg_3;
|
||||
RCT2_GLOBAL(0x013CE952 + 4, short) = date_get_total_months(MONTH_OCTOBER, scenario->objective_arg_1);
|
||||
RCT2_GLOBAL(0x013CE952 + 6, int) = scenario->objective_arg_2;
|
||||
y += gfx_draw_string_left_wrapped(dpi, (void*)0x013CE952, x, y, 170, STR_OBJECTIVE, 0) + 5;
|
||||
|
||||
// Scenario score
|
||||
if (scenario->flags & SCENARIO_FLAGS_COMPLETED) {
|
||||
strcpy((char*)0x009BC677, scenario->completed_by);
|
||||
*((short*)(0x0013CE952 + 0)) = 3165;
|
||||
*((int*)(0x0013CE952 + 2)) = scenario->company_value;
|
||||
RCT2_GLOBAL(0x013CE952 + 0, short) = 3165;
|
||||
RCT2_GLOBAL(0x013CE952 + 2, int) = scenario->company_value;
|
||||
y += gfx_draw_string_left_wrapped(dpi, (void*)0x013CE952, x, y, 170, STR_COMPLETED_BY_WITH_COMPANY_VALUE, 0);
|
||||
}
|
||||
}
|
||||
@@ -385,7 +385,7 @@ static void window_scenarioselect_scrollpaint()
|
||||
|
||||
// Draw scenario name
|
||||
strcpy((char*)0x009BC677, scenario->name);
|
||||
*((short*)0x013CE952) = 3165;
|
||||
RCT2_GLOBAL(0x013CE952, short) = 3165;
|
||||
gfx_draw_string_centred(dpi, highlighted ? 1193 : 1191, 210, y + 1, 0, (void*)0x013CE952);
|
||||
|
||||
// Check if scenario is completed
|
||||
@@ -395,8 +395,8 @@ static void window_scenarioselect_scrollpaint()
|
||||
|
||||
// Draw completion score
|
||||
strcpy((char*)0x009BC677, scenario->completed_by);
|
||||
*((short*)0x013CE952) = 2793;
|
||||
*((short*)0x013CE954) = 3165;
|
||||
RCT2_GLOBAL(0x013CE952, short) = 2793;
|
||||
RCT2_GLOBAL(0x013CE954, short) = 3165;
|
||||
gfx_draw_string_centred(dpi, highlighted ? 1193 : 1191, 210, y + 11, 0, (void*)0x013CE952);
|
||||
}
|
||||
|
||||
|
||||
@@ -216,12 +216,12 @@ static void window_water_paint()
|
||||
x = (window_water_widgets[WIDX_PREVIEW].left + window_water_widgets[WIDX_PREVIEW].right) / 2 + w->x;
|
||||
y = window_water_widgets[WIDX_PREVIEW].bottom + w->y + 5;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_WATER_RAISE_COST, uint32) != 0x80000000 && RCT2_GLOBAL(RCT2_ADDRESS_WATER_RAISE_COST, uint32) != 0)
|
||||
gfx_draw_string_centred(dpi, 984, x, y, 0, (void*)0x0141F738);
|
||||
gfx_draw_string_centred(dpi, 984, x, y, 0, (void*)RCT2_ADDRESS_WATER_RAISE_COST);
|
||||
y += 10;
|
||||
|
||||
// Draw lower cost amount
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_WATER_LOWER_COST, uint32) != 0x80000000 && RCT2_GLOBAL(RCT2_ADDRESS_WATER_LOWER_COST, uint32) != 0)
|
||||
gfx_draw_string_centred(dpi, 985, x, y, 0, (void*)0x0141F73C);
|
||||
gfx_draw_string_centred(dpi, 985, x, y, 0, (void*)RCT2_ADDRESS_WATER_LOWER_COST);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user