summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordominik <dominik@openttd.org>2004-08-21 13:21:09 +0000
committerdominik <dominik@openttd.org>2004-08-21 13:21:09 +0000
commit85012a519cd68368194a36309510bedfcee21403 (patch)
tree7cbc9b2d338b09294e2d77a7ef031186b3f81f92
parent287dcdc779bc41f728062ee3c1cd8097a9f9c7ed (diff)
downloadopenttd-85012a519cd68368194a36309510bedfcee21403.tar.xz
(svn r101) New cheat: switch climate
-rw-r--r--lang/english.txt5
-rw-r--r--misc_gui.c19
-rw-r--r--variables.h5
3 files changed, 25 insertions, 4 deletions
diff --git a/lang/english.txt b/lang/english.txt
index 417e44c15..e577bd521 100644
--- a/lang/english.txt
+++ b/lang/english.txt
@@ -1025,6 +1025,10 @@ STR_CONFIG_PATCHES_CURRENCY :{CURRENCY}
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_EXTRA_DYNAMITE :{LTBLUE}Magic bulldozer (remove industries, unmovabl
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
diff --git a/misc_gui.c b/misc_gui.c
index 4928c95b4..65def1a93 100644
--- a/misc_gui.c
+++ b/misc_gui.c
@@ -1345,6 +1345,16 @@ int32 ClickChangePlayerCheat(int32 p1, int32 p2)
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 @@ static const CheatEntry _cheats_ui[] = {
{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 @@ static void CheatsWndProc(Window *w, WindowEvent *e)
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);
diff --git a/variables.h b/variables.h
index 9e8f09484..e2a353ac4 100644
--- a/variables.h
+++ b/variables.h
@@ -177,8 +177,9 @@ typedef struct Cheats {
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;