Changeset - r21:4ce330587487
[Not reviewed]
master
0 3 0
truelight - 20 years ago 2004-08-11 21:48:27
truelight@openttd.org
(svn r22) Add: Competitors menu under patches
Fix: I forgot to delete a local var from ai.c
3 files changed with 11 insertions and 8 deletions:
0 comments (0 inline, 0 general)
ai.c
Show inline comments
 
@@ -1487,14 +1487,12 @@ static void AiStateWantNewRoute(Player *
 
		p->ai.state = AIS_0;
 
		return;
 
	}
 

	
 
	i = 200;
 
	for(;;) {
 
		byte dis;
 

	
 
		r = (uint16)Random();
 
		
 
		if (r < 0x7626) {
 
			if (_patches.ai_disable_veh_train) continue;
 
			AiWantTrainRoute(p);
 
		} else if (r < 0xC4EA) {
lang/english.txt
Show inline comments
 
@@ -984,12 +984,13 @@ STR_CONFIG_PATCHES_SMOOTH_ECONOMY		:{LTB
 

	
 
STR_CONFIG_PATCHES_GUI					:{BLACK}Interface
 
STR_CONFIG_PATCHES_CONSTRUCTION			:{BLACK}Construction
 
STR_CONFIG_PATCHES_VEHICLES				:{BLACK}Vehicles
 
STR_CONFIG_PATCHES_STATIONS				:{BLACK}Stations
 
STR_CONFIG_PATCHES_ECONOMY				:{BLACK}Economy
 
STR_CONFIG_PATCHES_AI					:{BLACK}Competitors
 

	
 
STR_CONFIG_PATCHES_DISABLED				:disabled
 
STR_CONFIG_PATCHES_INT32				:{INT32}
 

	
 
STR_CONFIG_PATCHES_QUERY_CAPT			:{WHITE}Change setting value
 

	
settings_gui.c
Show inline comments
 
@@ -714,17 +714,12 @@ static const PatchEntry _patches_vehicle
 
	{PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_SHIPS, &_patches.max_ships, 0, 240, 10},
 

	
 
	{PE_UINT16, PF_0ISDIS, STR_CONFIG_PATCHES_SERVINT_TRAINS, &_patches.servint_trains, 30, 1200, 10},
 
	{PE_UINT16, PF_0ISDIS, STR_CONFIG_PATCHES_SERVINT_ROADVEH, &_patches.servint_roadveh, 30, 1200, 10},
 
	{PE_UINT16, PF_0ISDIS, STR_CONFIG_PATCHES_SERVINT_AIRCRAFT, &_patches.servint_aircraft, 30, 1200, 10},
 
	{PE_UINT16, PF_0ISDIS, STR_CONFIG_PATCHES_SERVINT_SHIPS, &_patches.servint_ships, 30, 1200, 10},
 

	
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_AI_BUILDS_TRAINS, &_patches.ai_disable_veh_train},
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_AI_BUILDS_ROADVEH, &_patches.ai_disable_veh_roadveh},
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_AI_BUILDS_AIRCRAFT, &_patches.ai_disable_veh_aircraft},
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_AI_BUILDS_SHIPS, &_patches.ai_disable_veh_ship},
 
};
 

	
 
static const PatchEntry _patches_stations[] = {
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_JOINSTATIONS, &_patches.join_stations},
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_FULLLOADANY, &_patches.full_load_any},
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_SELECTGOODS, &_patches.selectgoods},
 
@@ -745,23 +740,31 @@ static const PatchEntry _patches_economy
 
	{PE_INT32, PF_NOCOMMA, STR_CONFIG_PATCHES_COLORED_NEWS_DATE, &_patches.colored_news_date, 1900, 2200, 5},
 
	{PE_INT32, PF_NOCOMMA, STR_CONFIG_PATCHES_STARTING_DATE, &_patches.starting_date, 1920, 2100, 1},
 

	
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_SMOOTH_ECONOMY, &_patches.smooth_economy},
 
};
 

	
 
static const PatchEntry _patches_ai[] = {
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_AI_BUILDS_TRAINS, &_patches.ai_disable_veh_train},
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_AI_BUILDS_ROADVEH, &_patches.ai_disable_veh_roadveh},
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_AI_BUILDS_AIRCRAFT, &_patches.ai_disable_veh_aircraft},
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_AI_BUILDS_SHIPS, &_patches.ai_disable_veh_ship},
 
};
 

	
 
typedef struct PatchPage {
 
	const PatchEntry *entries;
 
	uint num;
 
} PatchPage;
 

	
 
static const PatchPage _patches_page[] = {
 
	{_patches_ui, lengthof(_patches_ui) },
 
	{_patches_construction, lengthof(_patches_construction) },
 
	{_patches_vehicles, lengthof(_patches_vehicles) },
 
	{_patches_stations, lengthof(_patches_stations) },
 
	{_patches_economy, lengthof(_patches_economy) },
 
	{_patches_ai, lengthof(_patches_ai) },
 
};
 

	
 
static int32 ReadPE(const PatchEntry*pe)
 
{
 
	switch(pe->type) {
 
	case PE_BOOL:   return *(bool*)pe->variable;
 
@@ -936,13 +939,13 @@ static void PatchesSelectionWndProc(Wind
 
					ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_CONFIG_PATCHES_QUERY_CAPT, 10, 100, WC_GAME_OPTIONS, 0);
 
				}
 
			}
 
			
 
			break;
 
		}
 
		case 4: case 5: case 6: case 7: case 8:
 
		case 4: case 5: case 6: case 7: case 8: case 9:
 
			WP(w,def_d).data_1 = e->click.widget - 4;
 
			DeleteWindowById(WC_QUERY_STRING, 0);
 
			SetWindowDirty(w);
 
			break;
 
		}
 
		break;
 
@@ -975,12 +978,13 @@ static const Widget _patches_selection_w
 

	
 
{   WWT_CLOSEBOX,     3,    10,    96,    16,    27, STR_CONFIG_PATCHES_GUI, 0},
 
{   WWT_CLOSEBOX,     3,    97,   183,    16,    27, STR_CONFIG_PATCHES_CONSTRUCTION, 0},
 
{   WWT_CLOSEBOX,     3,   184,   270,    16,    27, STR_CONFIG_PATCHES_VEHICLES, 0},
 
{   WWT_CLOSEBOX,     3,   271,   357,    16,    27, STR_CONFIG_PATCHES_STATIONS, 0},
 
{   WWT_CLOSEBOX,     3,    10,    96,    28,    39, STR_CONFIG_PATCHES_ECONOMY, 0},
 
{   WWT_CLOSEBOX,     3,    97,   183,    28,    39, STR_CONFIG_PATCHES_AI, 0},
 
{      WWT_LAST},
 
};
 

	
 
static const WindowDesc _patches_selection_desc = {
 
	WDP_CENTER, WDP_CENTER, 370, 321,
 
	WC_GAME_OPTIONS,0,
0 comments (0 inline, 0 general)