File diff r5115:7edde0aba70e → r5116:6ab72109f482
misc_gui.c
Show inline comments
 
@@ -1673,36 +1673,24 @@ static int32 ClickChangeDateCheat(int32 
 
{
 
	YearMonthDay ymd;
 
	ConvertDateToYMD(_date, &ymd);
 

	
 
	if ((ymd.year == MIN_YEAR && p2 == -1) || (ymd.year == MAX_YEAR && p2 == 1)) return _cur_year;
 

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

	
 
static int32 ClickAllowConvrail(int32 p1, int32 p2)
 
{
 
	Vehicle *v;
 
	SB(_railtypes[RAILTYPE_ELECTRIC].powered_railtypes, RAILTYPE_RAIL, 1, p1);
 

	
 
	FOR_ALL_VEHICLES(v) {
 
		if (v->type == VEH_Train && IsFrontEngine(v)) TrainConsistChanged(v);
 
	}
 
	return p1;
 
}
 

	
 

	
 
typedef int32 CheckButtonClick(int32, int32);
 

	
 
enum ce_flags {CE_CLICK = 1 << 0};
 

	
 
typedef byte ce_flags;
 

	
 
typedef struct CheatEntry {
 
	VarType type;          // type of selector
 
	ce_flags flags;        // selector flags
 
	StringID str;          // string with descriptive text
 
	void *variable;        // pointer to the variable
 
	bool *been_used;       // has this cheat been used before?
 
@@ -1711,25 +1699,24 @@ typedef struct CheatEntry {
 
} CheatEntry;
 

	
 
static const CheatEntry _cheats_ui[] = {
 
	{SLE_BOOL,CE_CLICK, STR_CHEAT_MONEY,          &_cheats.money.value,           &_cheats.money.been_used,           &ClickMoneyCheat,         0,  0},
 
	{SLE_UINT8,      0, STR_CHEAT_CHANGE_PLAYER,  &_local_player,                 &_cheats.switch_player.been_used,   &ClickChangePlayerCheat,  0, 11},
 
	{SLE_BOOL,       0, STR_CHEAT_EXTRA_DYNAMITE, &_cheats.magic_bulldozer.value, &_cheats.magic_bulldozer.been_used, NULL,                     0,  0},
 
	{SLE_BOOL,       0, STR_CHEAT_CROSSINGTUNNELS,&_cheats.crossing_tunnels.value,&_cheats.crossing_tunnels.been_used,NULL,                     0,  0},
 
	{SLE_BOOL,       0, STR_CHEAT_BUILD_IN_PAUSE, &_cheats.build_in_pause.value,  &_cheats.build_in_pause.been_used,  NULL,                     0,  0},
 
	{SLE_BOOL,       0, STR_CHEAT_NO_JETCRASH,    &_cheats.no_jetcrash.value,     &_cheats.no_jetcrash.been_used,     NULL,                     0,  0},
 
	{SLE_BOOL,       0, STR_CHEAT_SETUP_PROD,     &_cheats.setup_prod.value,      &_cheats.setup_prod.been_used,      NULL,                     0,  0},
 
	{SLE_UINT8,      0, STR_CHEAT_SWITCH_CLIMATE, &_opt.landscape,                &_cheats.switch_climate.been_used,  &ClickChangeClimateCheat,-1,  4},
 
	{SLE_INT32,      0, STR_CHEAT_CHANGE_DATE,    &_cur_year,                     &_cheats.change_date.been_used,     &ClickChangeDateCheat,   -1,  1},
 
	{SLE_BOOL,       0, STR_CHEAT_ALLOW_CONVRAIL, &_cheats.elrail.value,          &_cheats.elrail.been_used,          &ClickAllowConvrail,      0,  0},
 
};
 

	
 

	
 
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,   169, 0x0,        STR_NULL},
 
{      WWT_PANEL,   RESIZE_NONE,    14,     0,   399,    14,   169, 0x0,        STR_CHEATS_TIP},
 
{   WIDGETS_END},
 
};
 

	
 
extern void DrawPlayerIcon(PlayerID pid, int x, int y);