mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 11:33:03 +01:00
Merge branch 'ddevrien-master'
This commit is contained in:
@@ -48,11 +48,15 @@
|
||||
|
||||
#define RCT2_ADDRESS_APP_PATH 0x009AA214
|
||||
|
||||
#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_CONSTRUCTION_MARKER 0x009AACBF
|
||||
|
||||
#define RCT2_ADDRESS_EXPANSION_NAMES 0x009AACC0
|
||||
#define RCT2_ADDRESS_EXPANSION_FLAGS 0x009AB4C0
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ void config_load()
|
||||
return;
|
||||
RCT2_GLOBAL(0x009AB4C6, sint8) = 1;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, sint8) = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FAHRENHEIT, sint8) = 1;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_TEMPERATURE, sint8) = 1;
|
||||
RCT2_GLOBAL(0x009AACBB, sint8) = 1;
|
||||
RCT2_GLOBAL(0x009AACBD, sint16) = 0;
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS))
|
||||
|
||||
@@ -280,6 +280,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 +324,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 +332,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 +354,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 +512,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,
|
||||
|
||||
@@ -471,9 +471,9 @@ 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;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#include "addresses.h"
|
||||
#include "config.h"
|
||||
#include "strings.h"
|
||||
#include "widget.h"
|
||||
#include "window.h"
|
||||
@@ -103,6 +104,7 @@ 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_events[] = {
|
||||
window_options_emptysub,
|
||||
@@ -199,8 +201,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 +214,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 +232,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;
|
||||
}
|
||||
}
|
||||
@@ -329,4 +379,18 @@ 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
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user