changeset 100:ad97c7b4eaac draft

(svn r101) New cheat: switch climate
author dominik <dominik@openttd.org>
date Sat, 21 Aug 2004 13:21:09 +0000
parents 1b7a84264d50
children bfc0b9aa1bc1
files lang/english.txt misc_gui.c variables.h
diffstat 3 files changed, 25 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lang/english.txt
+++ b/lang/english.txt
@@ -1025,6 +1025,10 @@
 
 STR_CONFIG_PATCHES_QUERY_CAPT			:{WHITE}Change setting value
 
+STR_TEMPERATE_LANDSCAPE			:temperate landscape
+STR_SUB_ARCTIC_LANDSCAPE		:sub-arctic landscape
+STR_SUB_TROPICAL_LANDSCAPE	:sub-tropical landscape
+STR_TOYLAND_LANDSCAPE				:toyland landscape
 
 STR_CHEATS										:{WHITE}Cheats
 STR_CHEATS_TIP								:{BLACK}Checkboxes indicate if you have used this cheat before
@@ -1035,6 +1039,7 @@
 STR_CHEAT_CROSSINGTUNNELS			:{LTBLUE}Tunnels may cross each other: {ORANGE}{STRING}
 STR_CHEAT_BUILD_IN_PAUSE			:{LTBLUE}Build while in pause mode: {ORANGE}{STRING}
 STR_CHEAT_NO_JETCRASH					:{LTBLUE}Jetplanes will not crash (frequently) on small airports: {ORANGE} {STRING}
+STR_CHEAT_SWITCH_CLIMATE			:{LTBLUE}Switch climate: {ORANGE} {STRING}
 
 STR_SORT_BY_POPULATION					:{BLACK}Population
 
--- a/misc_gui.c
+++ b/misc_gui.c
@@ -1345,6 +1345,16 @@
 return _local_player;
 }
 
+// p1 -1 or +1 (down/up)
+int32 ClickChangeClimateCheat(int32 p1, int32 p2)
+{
+	_opt.landscape = p1;
+	GfxLoadSprites();
+	MarkWholeScreenDirty();
+	return _opt.landscape;
+}
+
+
 typedef int32 CheckButtonClick(int32, int32);
 static CheckButtonClick * const _cheat_button_proc[] = {
 	ClickMoneyCheat,
@@ -1415,8 +1425,9 @@
 	{CE_UINT8, 0, STR_CHEAT_CHANGE_PLAYER, 	&_local_player, 								&_cheats.switch_player.been_used,	&ClickChangePlayerCheat, 0, 11, 1},
 	{CE_BOOL, 0, STR_CHEAT_EXTRA_DYNAMITE,	&_cheats.magic_bulldozer.value,	&_cheats.magic_bulldozer.been_used},
 	{CE_BOOL, 0, STR_CHEAT_CROSSINGTUNNELS,	&_cheats.crossing_tunnels.value,&_cheats.crossing_tunnels.been_used},
-	{CE_BOOL, 0, STR_CHEAT_BUILD_IN_PAUSE,	&_cheats.build_in_pause.value,		&_cheats.build_in_pause.been_used},
+	{CE_BOOL, 0, STR_CHEAT_BUILD_IN_PAUSE,	&_cheats.build_in_pause.value,	&_cheats.build_in_pause.been_used},
 	{CE_BOOL, 0, STR_CHEAT_NO_JETCRASH,			&_cheats.no_jetcrash.value,			&_cheats.no_jetcrash.been_used},
+	{CE_UINT8, 0, STR_CHEAT_SWITCH_CLIMATE, 	&_opt.landscape, 						&_cheats.switch_climate.been_used,	&ClickChangeClimateCheat, 0, 3, 1},
 };
 
 
@@ -1470,13 +1481,17 @@
 				DrawStringCentered(x+35, y+1, STR_681A, 0);
 				
 				val = ReadCE(ce);
+
+				// set correct string for switch climate cheat
+				if(ce->str==STR_CHEAT_SWITCH_CLIMATE)
+					val += STR_TEMPERATE_LANDSCAPE;
+
 				SET_DPARAM16(0, val);
 				
 				// draw colored flag for change player cheat
 				if(ce->str==STR_CHEAT_CHANGE_PLAYER)
 					DrawPlayerIcon(_current_player, 156, y+2);
 
-				
 			}
 
 		DrawString(50, y+1, ce->str, 0);
--- a/variables.h
+++ b/variables.h
@@ -177,8 +177,9 @@
 	Cheat switch_player;			// change to another player
 	Cheat money;							// get rich
 	Cheat crossing_tunnels;		// allow tunnels that cross each other
-	Cheat	build_in_pause;			// build while in pause mode
-	Cheat	no_jetcrash;				// no jet will crash on small airports anymore
+	Cheat build_in_pause;			// build while in pause mode
+	Cheat no_jetcrash;				// no jet will crash on small airports anymore
+	Cheat switch_climate;
 } Cheats;
 
 VARDEF Cheats _cheats;