1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 12:03:07 +01:00

Merge pull request #555 from duncanspumpkin/weather_cheats

Added force sun/thunder cheat.
This commit is contained in:
Ted John
2014-11-05 21:05:36 +00:00
4 changed files with 35 additions and 4 deletions

View File

@@ -2759,9 +2759,9 @@ STR_2753 :???
STR_2754 :???
STR_2755 :???
STR_2756 :???
STR_2757 :???
STR_2758 :???
# New strings used in the cheats window previously these were ???
STR_2757 :Force Sun
STR_2758 :Force Thunder
STR_2759 :Zero Clearance
STR_2760 :+5K Money
STR_2761 :Pay For Entrance

View File

@@ -60,7 +60,9 @@ enum WINDOW_CHEATS_WIDGET_IDX {
WIDX_OPEN_CLOSE_PARK,
WIDX_DECREASE_GAME_SPEED,
WIDX_INCREASE_GAME_SPEED,
WIDX_ZERO_CLEARANCE
WIDX_ZERO_CLEARANCE,
WIDX_WEATHER_SUN,
WIDX_WEATHER_THUNDER
};
@@ -122,6 +124,8 @@ static rct_widget window_cheats_misc_widgets[] = {
{ WWT_CLOSEBOX, 1, XPL(0), WPL(0), YPL(2), HPL(2), 2771, STR_NONE}, // decrease game speed
{ WWT_CLOSEBOX, 1, XPL(1), WPL(1), YPL(2), HPL(2), 2772, STR_NONE}, // increase game speed
{ WWT_CLOSEBOX, 1, XPL(1), WPL(1), YPL(3), HPL(3), 2759, STR_NONE}, // Zero Clearance
{ WWT_CLOSEBOX, 1, XPL(0), WPL(0), YPL(4), HPL(4), 2757, STR_NONE}, // Sun
{ WWT_CLOSEBOX, 1, XPL(1), WPL(1), YPL(4), HPL(4), 2758, STR_NONE}, // Thunder
{ WIDGETS_END },
};
@@ -244,7 +248,7 @@ static void* window_cheats_page_events[] = {
static uint32 window_cheats_page_enabled_widgets[] = {
(1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_HIGH_MONEY) | (1 << WIDX_PARK_ENTRANCE_FEE),
(1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_HAPPY_GUESTS) | (1 << WIDX_TRAM_GUESTS),
(1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_FREEZE_CLIMATE) | (1 << WIDX_OPEN_CLOSE_PARK) | (1 << WIDX_DECREASE_GAME_SPEED) | (1 << WIDX_INCREASE_GAME_SPEED) | (1 << WIDX_ZERO_CLEARANCE),
(1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_FREEZE_CLIMATE) | (1 << WIDX_OPEN_CLOSE_PARK) | (1 << WIDX_DECREASE_GAME_SPEED) | (1 << WIDX_INCREASE_GAME_SPEED) | (1 << WIDX_ZERO_CLEARANCE) | (1 << WIDX_WEATHER_SUN) | (1 << WIDX_WEATHER_THUNDER),
};
static void window_cheats_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w);
@@ -377,6 +381,12 @@ static void window_cheats_misc_mouseup()
return;
}
break;
case WIDX_WEATHER_SUN:
climate_force_weather(WEATHER_SUNNY);
break;
case WIDX_WEATHER_THUNDER:
climate_force_weather(WEATHER_THUNDER);
break;
}
}

View File

@@ -154,6 +154,17 @@ void climate_update()
}
}
void climate_force_weather(uint8 weather){
gClimateNextWeather = 0;
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_WEATHER, sint8) = weather;
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_WEATHER_GLOOM, sint8) = climate_weather_data[weather].gloom_level;
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_RAIN_LEVEL, sint8) = climate_weather_data[weather].rain_level;
_climateCurrentWeatherEffect = climate_weather_data[weather].effect_level;
RCT2_GLOBAL(RCT2_ADDRESS_CLIMATE_UPDATE_TIMER, sint16) = 1920;
climate_update();
}
/**
* Calculates future weather development.

View File

@@ -30,6 +30,15 @@ enum {
CLIMATE_COLD
};
enum{
WEATHER_SUNNY,
WEATHER_PARTIALLY_CLOUDY,
WEATHER_CLOUDY,
WEATHER_RAIN,
WEATHER_HEAVY_RAIN,
WEATHER_THUNDER
};
typedef struct {
sint8 temp_delta;
sint8 effect_level;
@@ -49,5 +58,6 @@ int climate_celsius_to_fahrenheit(int celsius);
void climate_reset(int climate);
void climate_update();
void climate_update_sound();
void climate_force_weather(uint8 weather);
#endif