Changeset - r108:13cc37e88d12
[Not reviewed]
master
0 3 0
dominik - 20 years ago 2004-08-22 15:25:36
dominik@openttd.org
(svn r109) added/heavily modified patch by truesatan: cheat change date
3 files changed with 24 insertions and 1 deletions:
0 comments (0 inline, 0 general)
lang/english.txt
Show inline comments
 
@@ -1040,6 +1040,7 @@ STR_CHEAT_CROSSINGTUNNELS			:{LTBLUE}Tun
 
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_CHEAT_CHANGE_DATE					:{LTBLUE}Change date: {ORANGE} {DATE_SHORT}
 

	
 
STR_SORT_BY_POPULATION					:{BLACK}Population
 

	
misc_gui.c
Show inline comments
 
@@ -1356,11 +1356,27 @@ int32 ClickChangeClimateCheat(int32 p1, 
 
	return _opt.landscape;
 
}
 

	
 
extern void EnginesMonthlyLoop();
 

	
 
// p2 1 (increase) or -1 (decrease)
 
int32 ClickChangeDateCheat(int32 p1, int32 p2)
 
{
 
	YearMonthDay ymd;
 
	ConvertDayToYMD(&ymd, _date);
 

	
 
	if((ymd.year==0 && p2==-1) || (ymd.year==170 && p2==1)) return _cur_year;
 

	
 
	SetDate(ConvertYMDToDay(_cur_year + p2, ymd.month, ymd.day));
 
	EnginesMonthlyLoop();
 
	SetWindowDirty(FindWindowById(WC_STATUS_BAR, 0));
 
	return _cur_year;
 
}
 

	
 
typedef int32 CheckButtonClick(int32, int32);
 
static CheckButtonClick * const _cheat_button_proc[] = {
 
	ClickMoneyCheat,
 
	ClickChangePlayerCheat,
 
	ClickChangeDateCheat,
 
};
 

	
 

	
 
@@ -1429,7 +1445,8 @@ static const CheatEntry _cheats_ui[] = {
 
	{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_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, -1, 4, 1},
 
	{CE_UINT8, 0, STR_CHEAT_SWITCH_CLIMATE, &_opt.landscape, 								&_cheats.switch_climate.been_used,	&ClickChangeClimateCheat, -1, 4, 1},
 
	{CE_UINT8, 0, STR_CHEAT_CHANGE_DATE,		&_cur_year,			&_cheats.change_date.been_used,	&ClickChangeDateCheat, -1,1,1},
 
};
 

	
 

	
 
@@ -1489,6 +1506,10 @@ static void CheatsWndProc(Window *w, Win
 
					val += STR_TEMPERATE_LANDSCAPE;
 

	
 
				SET_DPARAM16(0, val);
 

	
 
				// display date for change date cheat
 
				if(ce->str==STR_CHEAT_CHANGE_DATE)
 
					SET_DPARAM16(0, _date);
 
				
 
				// draw colored flag for change player cheat
 
				if(ce->str==STR_CHEAT_CHANGE_PLAYER)
variables.h
Show inline comments
 
@@ -180,6 +180,7 @@ typedef struct Cheats {
 
	Cheat build_in_pause;			// build while in pause mode
 
	Cheat no_jetcrash;				// no jet will crash on small airports anymore
 
	Cheat switch_climate;
 
	Cheat change_date;				//changes date ingame
 
} Cheats;
 

	
 
VARDEF Cheats _cheats;
0 comments (0 inline, 0 general)