Merge pull request #1252 from Gymnasiast/ownership-editor

Added cheat to edit land ownership settings in-game
This commit is contained in:
Ted John 2015-06-07 13:34:33 +01:00
commit 0efd222eac
6 changed files with 42 additions and 7 deletions

View File

@ -3610,4 +3610,7 @@ STR_5273 :{SMALLFONT}{BLACK}Large Scenery
STR_5274 :{SMALLFONT}{BLACK}Footpath
STR_5275 :Search for Objects
STR_5276 :Enter the name of an object to search for
STR_5277 :Clear
STR_5277 :Clear
STR_5278 :Editable land rights
STR_5279 :Normal map window
STR_5280 :{SMALLFONT}{BLACK}Allow editing land ownership settings through the Map window

View File

@ -616,6 +616,9 @@ void window_cancel_textbox();
void window_update_textbox_caret();
void window_update_textbox();
//Cheat: in-game land ownership editor
void toggle_ingame_land_ownership_editor();
#ifdef _MSC_VER
#define window_get_register(w) \
__asm mov w, esi

View File

@ -1476,6 +1476,10 @@ enum {
STR_GIANT_SCREENSHOT = 5260,
STR_CHEAT_INGAME_LAND_OWNERSHIP_EDITOR = 5278,
STR_CHEAT_INGAME_LAND_OWNERSHIP_EDITOR_DISABLE = 5279,
STR_CHEAT_INGAME_LAND_OWNERSHIP_EDITOR_TIP = 5280,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
STR_COUNT = 32768
};

View File

@ -72,6 +72,7 @@ enum WINDOW_CHEATS_WIDGET_IDX {
WIDX_REMOVE_LITTER,
WIDX_WIN_SCENARIO,
WIDX_UNLOCK_ALL_PRICES,
WIDX_INGAME_LAND_OWNERSHIP_EDITOR,
WIDX_RENEW_RIDES = 8,
WIDX_REMOVE_SIX_FLAGS,
WIDX_MAKE_DESTRUCTIBLE,
@ -154,6 +155,7 @@ static rct_widget window_cheats_misc_widgets[] = {
{ WWT_CLOSEBOX, 1, XPL(0), WPL(0), YPL(5), HPL(5), STR_CHEAT_REMOVE_LITTER, STR_NONE}, // Remove litter
{ WWT_CLOSEBOX, 1, XPL(1), WPL(1), YPL(0), HPL(0), STR_CHEAT_WIN_SCENARIO, STR_NONE}, // Win scenario
{ WWT_CHECKBOX, 1, XPL(0), OWPL, YPL(8),OHPL(8), STR_CHEAT_UNLOCK_PRICES, STR_NONE}, // Unlock all prices
{ WWT_CLOSEBOX, 1, XPL(1), WPL(1), YPL(5), HPL(5), STR_CHEAT_INGAME_LAND_OWNERSHIP_EDITOR,STR_CHEAT_INGAME_LAND_OWNERSHIP_EDITOR_TIP},// In-game land ownership editor
{ WIDGETS_END },
};
static rct_widget window_cheats_rides_widgets[] = {
@ -170,7 +172,7 @@ static rct_widget window_cheats_rides_widgets[] = {
{ WWT_CLOSEBOX, 1, XPL(1), WPL(1), YPL(1), HPL(1), STR_CHEAT_MAKE_DESTRUCTABLE, STR_NONE}, // Make destructable
{ WWT_CLOSEBOX, 1, XPL(0), WPL(0), YPL(1), HPL(1), STR_CHEAT_FIX_ALL_RIDES, STR_NONE }, // Fix all rides
{ WWT_CHECKBOX, 2, XPL(0), OWPL, YPL(8),OHPL(8), STR_CHEAT_410_HILL_LIFT, STR_NONE }, // 410 km/h lift hill
{ WWT_CHECKBOX, 2, XPL(0), OWPL, YPL(6),OHPL(6), STR_BRAKES_FAILURE, STR_NONE }, // Disable brakes failure
{ WWT_CHECKBOX, 2, XPL(0), OWPL, YPL(6),OHPL(6), STR_CHEAT_DISABLE_BRAKES_FAILURE,STR_NONE }, // Disable brakes failure
{ WWT_CHECKBOX, 2, XPL(0), OWPL, YPL(7),OHPL(7), STR_CHEAT_DISABLE_BREAKDOWNS, STR_NONE }, // Disable all breakdowns
{ WIDGETS_END },
};
@ -329,7 +331,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_TAB_4) | (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_TAB_4) | (1 << WIDX_HAPPY_GUESTS) | (1 << WIDX_TRAM_GUESTS) | (1 << WIDX_NAUSEA_GUESTS),
(1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_FREEZE_CLIMATE) | (1 << WIDX_OPEN_CLOSE_PARK) | (1 << WIDX_ZERO_CLEARANCE) | (1 << WIDX_WEATHER_SUN) | (1 << WIDX_WEATHER_THUNDER) | (1 << WIDX_CLEAR_GRASS) | (1 << WIDX_MOWED_GRASS) | (1 << WIDX_WATER_PLANTS) | (1 << WIDX_FIX_VANDALISM) | (1 << WIDX_REMOVE_LITTER) | (1 << WIDX_WIN_SCENARIO) | (1 << WIDX_UNLOCK_ALL_PRICES),
(1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_FREEZE_CLIMATE) | (1 << WIDX_OPEN_CLOSE_PARK) | (1 << WIDX_ZERO_CLEARANCE) | (1 << WIDX_WEATHER_SUN) | (1 << WIDX_WEATHER_THUNDER) | (1 << WIDX_CLEAR_GRASS) | (1 << WIDX_MOWED_GRASS) | (1 << WIDX_WATER_PLANTS) | (1 << WIDX_FIX_VANDALISM) | (1 << WIDX_REMOVE_LITTER) | (1 << WIDX_WIN_SCENARIO) | (1 << WIDX_UNLOCK_ALL_PRICES) | (1 << WIDX_INGAME_LAND_OWNERSHIP_EDITOR),
(1 << WIDX_CLOSE) | (1 << WIDX_TAB_1) | (1 << WIDX_TAB_2) | (1 << WIDX_TAB_3) | (1 << WIDX_TAB_4) | (1 << WIDX_RENEW_RIDES) | (1 << WIDX_REMOVE_SIX_FLAGS) | (1 << WIDX_MAKE_DESTRUCTIBLE) | (1 << WIDX_FIX_ALL) | (1 << WIDX_FAST_LIFT_HILL) | (1 << WIDX_DISABLE_BRAKES_FAILURE) | (1 << WIDX_DISABLE_ALL_BREAKDOWNS)
};
@ -654,6 +656,12 @@ static void window_cheats_misc_mouseup()
window_invalidate_by_class(WC_RIDE);
window_invalidate_by_class(WC_PARK_INFORMATION);
break;
case WIDX_INGAME_LAND_OWNERSHIP_EDITOR:
toggle_ingame_land_ownership_editor();
w->widgets[widgetIndex].image = w->widgets[widgetIndex].image == STR_CHEAT_INGAME_LAND_OWNERSHIP_EDITOR ? STR_CHEAT_INGAME_LAND_OWNERSHIP_EDITOR_DISABLE : STR_CHEAT_INGAME_LAND_OWNERSHIP_EDITOR;
// To prevent tools from staying active after disabling cheat
window_close_by_class(WC_MAP);
break;
}
}

View File

@ -136,6 +136,10 @@ static void* window_map_events[] = {
window_map_scrollpaint
};
// Cheat: in-game land ownership editor
int g_ingame_land_ownership_editor;
extern void toggle_ingame_land_ownership_editor();
/**
*
* rct2: 0x0068C88A
@ -542,7 +546,8 @@ static void window_map_invalidate()
w->widgets[WIDX_CLOSE].right = w->width - 2 - 11 + 10;
w->widgets[WIDX_MAP].right = w->width - 4;
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR))
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) ||
g_ingame_land_ownership_editor)
w->widgets[WIDX_MAP].bottom = w->height - 1 - 72;
else if (w->selected_tab == 1)
w->widgets[WIDX_MAP].bottom = w->height - 1 - 44;
@ -588,7 +593,8 @@ static void window_map_invalidate()
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)) {
if ((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) ||
g_ingame_land_ownership_editor) {
// scenario editor: build park entrance selected, show rotate button
if ((RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) & INPUT_FLAG_TOOL_ACTIVE) &&
RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, uint8) == WC_MAP &&
@ -678,7 +684,8 @@ static void window_map_paint()
w->y + w->widgets[WIDX_PEOPLE_STARTING_POSITION].top + 18, 0);
}
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)) {
if (!((RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)
|| g_ingame_land_ownership_editor)) {
// render the map legend
if (w->selected_tab != 0) {
x = w->x + 4;
@ -978,3 +985,9 @@ static void window_map_center_on_view_point()
w_map->scrolls[0].v_top = dx;
widget_scroll_update_thumbs(w_map, WIDX_MAP);
}
// In-game land ownership editor cheat
void toggle_ingame_land_ownership_editor()
{
g_ingame_land_ownership_editor = !g_ingame_land_ownership_editor;
}

View File

@ -84,6 +84,10 @@ int climate_celsius_to_fahrenheit(int celsius)
return (celsius * 29) / 16 + 32;
}
// cheats
extern int g_climate_locked;
extern void toggle_climate_lock();
/**
* Set climate and determine start weather.
* rct2: 0x006C45ED
@ -489,4 +493,4 @@ static const rct_weather_transition* climate_transitions[] = {
climate_cold_transitions
};
#pragma endregion
#pragma endregion