1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Refactor freeze climate cheat

This commit is contained in:
Martin Černáč
2016-02-17 17:39:33 +01:00
parent 93484c7956
commit aff8cec48c
5 changed files with 8 additions and 18 deletions

View File

@@ -20,6 +20,7 @@ bool gCheatsBuildInPauseMode = false;
bool gCheatsIgnoreRideIntensity = false;
bool gCheatsDisableVandalism = false;
bool gCheatsNeverendingMarketing = false;
bool gCheatsFreezeClimate = false;
int park_rating_spinner_value;
@@ -383,7 +384,7 @@ void game_command_cheat(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* e
case CHEAT_10MINUTEINSPECTIONS: cheat_10_minute_inspections(); break;
case CHEAT_WINSCENARIO: scenario_success(); break;
case CHEAT_FORCEWEATHER: climate_force_weather(*edx); break;
case CHEAT_FREEZECLIMATE: toggle_climate_lock(); break;
case CHEAT_FREEZECLIMATE: gCheatsFreezeClimate = !gCheatsFreezeClimate; break;
case CHEAT_NEVERENDINGMARKETING: gCheatsNeverendingMarketing = !gCheatsNeverendingMarketing; break;
case CHEAT_OPENCLOSEPARK: park_set_open(park_is_open() ? 0 : 1); break;
case CHEAT_HAVEFUN: RCT2_GLOBAL(RCT2_ADDRESS_OBJECTIVE_TYPE, uint8) = OBJECTIVE_HAVE_FUN; break;
@@ -411,4 +412,6 @@ void cheats_reset()
gCheatsBuildInPauseMode = false;
gCheatsIgnoreRideIntensity = false;
gCheatsDisableVandalism = false;
gCheatsNeverendingMarketing = false;
gCheatsFreezeClimate = false;
}

View File

@@ -36,6 +36,7 @@ extern bool gCheatsBuildInPauseMode;
extern bool gCheatsIgnoreRideIntensity;
extern bool gCheatsDisableVandalism;
extern bool gCheatsNeverendingMarketing;
extern bool gCheatsFreezeClimate;
enum {
CHEAT_SANDBOXMODE,

View File

@@ -770,7 +770,7 @@ static void window_cheats_invalidate(rct_window *w)
widget_set_checkbox_value(w, WIDX_UNLOCK_ALL_PRICES, gCheatsUnlockAllPrices);
widget_set_checkbox_value(w, WIDX_FORCE_PARK_RATING, get_forced_park_rating() >= 0);
w->widgets[WIDX_SANDBOX_MODE].image = gCheatsSandboxMode ? STR_CHEAT_SANDBOX_MODE_DISABLE : STR_CHEAT_SANDBOX_MODE;
w->widgets[WIDX_FREEZE_CLIMATE].image = g_climate_locked ? STR_CHEAT_UNFREEZE_CLIMATE : STR_CHEAT_FREEZE_CLIMATE;
w->widgets[WIDX_FREEZE_CLIMATE].image = gCheatsFreezeClimate ? STR_CHEAT_UNFREEZE_CLIMATE : STR_CHEAT_FREEZE_CLIMATE;
widget_set_checkbox_value(w, WIDX_NEVERENDING_MARKETING, gCheatsNeverendingMarketing);
break;
case WINDOW_CHEATS_PAGE_RIDES:

View File

@@ -29,6 +29,7 @@
#include "../interface/window.h"
#include "../util/util.h"
#include "climate.h"
#include "../cheats.h"
enum {
THUNDER_STATUS_NULL = 0,
@@ -84,10 +85,6 @@ int climate_celsius_to_fahrenheit(int celsius)
return (celsius * 29) / 16 + 32;
}
// cheats
int g_climate_locked;
extern void toggle_climate_lock();
/**
* Set climate and determine start weather.
* rct2: 0x006C45ED
@@ -124,13 +121,6 @@ sint8 step_weather_level(sint8 cur_weather_level, sint8 next_weather_level) {
}
}
//for cheats
void toggle_climate_lock()
{
g_climate_locked = !g_climate_locked;
}
/**
* Weather & climate update iteration.
* Gradually changes the weather parameters towards their determined next values.
@@ -147,7 +137,7 @@ void climate_update()
cur_rain = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_RAIN_LEVEL, sint8),
next_rain = _climateNextRainLevel;
if (g_climate_locked) //for cheats
if (gCheatsFreezeClimate) //for cheats
return;
if (screen_flags & (~SCREEN_FLAGS_PLAYING)) // only normal play mode gets climate

View File

@@ -53,10 +53,6 @@ typedef struct {
extern const rct_weather climate_weather_data[6];
// cheats
extern int g_climate_locked;
void toggle_climate_lock();
int climate_celsius_to_fahrenheit(int celsius);
void climate_reset(int climate);
void climate_update();