Changeset - r1176:207d85469a1e
[Not reviewed]
master
0 4 0
miham - 19 years ago 2005-01-26 10:52:23
miham@openttd.org
(svn r1678) Added cheat option for setting production of raw-material product industries in game
4 files changed with 9 insertions and 10 deletions:
0 comments (0 inline, 0 general)
industry_gui.c
Show inline comments
 
@@ -266,13 +266,13 @@ static const WindowDesc * const _industr
 

	
 
void ShowBuildIndustryWindow(void)
 
{
 
	AllocateWindowDescFront(_industry_window_desc[_patches.build_rawmaterial_ind][_opt.landscape],0);
 
}
 

	
 
#define NEED_ALTERB	(_game_mode == GM_EDITOR && i->accepts_cargo[0] == CT_INVALID)
 
#define NEED_ALTERB	((_game_mode == GM_EDITOR || _cheats.setup_prod.value) && i->accepts_cargo[0] == CT_INVALID)
 
static void IndustryViewWndProc(Window *w, WindowEvent *e)
 
{
 
	// WP(w,vp2_d).data_1 is for the editbox line
 
	// WP(w,vp2_d).data_2 is for the clickline
 
	// WP(w,vp2_d).data_3 is for the click pos (left or right)
 

	
 
@@ -336,18 +336,14 @@ static void IndustryViewWndProc(Window *
 
			int line;
 
			int x;
 
			byte b;
 

	
 
			i = GetIndustry(w->window_number);
 

	
 
			// We should only work in editor
 
			if (_game_mode != GM_EDITOR)
 
				return;
 

	
 
			// And if the industry is raw-material producer
 
			if (i->accepts_cargo[0] != CT_INVALID)
 
			// We should work if needed..
 
			if (!NEED_ALTERB)
 
				return;
 

	
 
			x = e->click.pt.x;
 
			line = (e->click.pt.y - 127) / 10;
 
			if (e->click.pt.y >= 127 && IS_INT_INSIDE(line, 0, 2) && i->produced_cargo[line]) {
 
				if (IS_INT_INSIDE(x, 5, 25) ) {
lang/english.txt
Show inline comments
 
@@ -1087,12 +1087,13 @@ STR_CHEAT_CHANGE_PLAYER						:{LTBLUE}Pl
 
STR_CHEAT_EXTRA_DYNAMITE					:{LTBLUE}Magic bulldozer (remove industries, unmovables): {ORANGE}{STRING}
 
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_CHEAT_CHANGE_DATE						:{LTBLUE}Change date: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD						:{LTBLUE}Enable modifying production values: {ORANGE}{STRING}
 

	
 
STR_HEADING_FOR_WAYPOINT					:{LTBLUE}Heading for {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL					:{LTBLUE}Heading for {WAYPOINT}, {VELOCITY}
 

	
 
STR_GO_TO_WAYPOINT						:Go via {WAYPOINT}
 
STR_GO_NON_STOP_TO_WAYPOINT					:Go non-stop via {WAYPOINT}
misc_gui.c
Show inline comments
 
@@ -1611,22 +1611,23 @@ static const CheatEntry _cheats_ui[] = {
 
	{CE_CLICK, 0, STR_CHEAT_MONEY, 					&_cheats.money.value, 					&_cheats.money.been_used, 					&ClickMoneyCheat,					0, 0, 0},
 
	{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, NULL,											0, 0, 0},
 
	{CE_BOOL, 0, STR_CHEAT_CROSSINGTUNNELS,	&_cheats.crossing_tunnels.value,&_cheats.crossing_tunnels.been_used,NULL,											0, 0, 0},
 
	{CE_BOOL, 0, STR_CHEAT_BUILD_IN_PAUSE,	&_cheats.build_in_pause.value,	&_cheats.build_in_pause.been_used,	NULL,											0, 0, 0},
 
	{CE_BOOL, 0, STR_CHEAT_NO_JETCRASH,			&_cheats.no_jetcrash.value,			&_cheats.no_jetcrash.been_used,			NULL,											0, 0, 0},
 
	{CE_BOOL, 0, STR_CHEAT_SETUP_PROD,			&_cheats.setup_prod.value,			&_cheats.setup_prod.been_used,			NULL,											0, 0, 0},
 
	{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},
 
};
 

	
 

	
 
static const Widget _cheat_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,    14,     0,    10,     0,    13, STR_00C5,		STR_018B_CLOSE_WINDOW},
 
{    WWT_CAPTION,   RESIZE_NONE,    14,    11,   399,     0,    13, STR_CHEATS,	STR_018C_WINDOW_TITLE_DRAG_THIS},
 
{      WWT_PANEL,   RESIZE_NONE,    14,     0,   399,    14,   147, 0x0,					STR_NULL},
 
{     WWT_IMGBTN,   RESIZE_NONE,    14,     0,   399,    14,   147, 0x0,					STR_CHEATS_TIP},
 
{      WWT_PANEL,   RESIZE_NONE,    14,     0,   399,    14,   159, 0x0,					STR_NULL},
 
{     WWT_IMGBTN,   RESIZE_NONE,    14,     0,   399,    14,   159, 0x0,					STR_CHEATS_TIP},
 
{   WIDGETS_END},
 
};
 

	
 
extern void DrawPlayerIcon(int p, int x, int y);
 

	
 
static void CheatsWndProc(Window *w, WindowEvent *e)
 
@@ -1755,13 +1756,13 @@ static void CheatsWndProc(Window *w, Win
 
		WP(w,def_d).data_1 = 0;
 
		SetWindowDirty(w);
 
		break;
 
	}
 
}
 
static const WindowDesc _cheats_desc = {
 
	240, 22, 400, 148,
 
	240, 22, 400, 160,
 
	WC_CHEATS,0,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 
	_cheat_widgets,
 
	CheatsWndProc
 
};
 

	
variables.h
Show inline comments
 
@@ -205,12 +205,13 @@ typedef struct Cheats {
 
	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 switch_climate;
 
	Cheat change_date;				//changes date ingame
 
	Cheat setup_prod;				//setup raw-material production in game
 
} Cheats;
 

	
 
VARDEF Cheats _cheats;
 

	
 
typedef struct Paths {
 
	char *personal_dir;  // includes cfg file and save folder
0 comments (0 inline, 0 general)