Changeset - r5116:6ab72109f482
[Not reviewed]
master
0 39 0
KUDr - 18 years ago 2006-11-17 19:31:44
kudr@openttd.org
(svn r7195) -Feature: [FS#297, optional elrails] New patches/vehicles option 'disable electrified railways'.
(original patch by maedhros, ideas: peter1138, Darkvater, Rubidium, Patrick, Eddi|zuHause, ..)
39 files changed with 127 insertions and 39 deletions:
0 comments (0 inline, 0 general)
elrail.c
Show inline comments
 
@@ -61,6 +61,9 @@
 
#include "rail_map.h"
 
#include "table/sprites.h"
 
#include "table/elrail_data.h"
 
#include "vehicle.h"
 
#include "train.h"
 
#include "gui.h"
 

	
 
static inline TLG GetTLG(TileIndex t)
 
{
 
@@ -360,6 +363,8 @@ static void DrawCatenaryOnBridge(const T
 

	
 
void DrawCatenary(const TileInfo *ti)
 
{
 
	if (_patches.disable_elrails) return;
 

	
 
	switch (GetTileType(ti->tile)) {
 
		case MP_RAILWAY:
 
			if (IsRailDepot(ti->tile)) {
 
@@ -385,3 +390,55 @@ void DrawCatenary(const TileInfo *ti)
 
	}
 
	DrawCatenaryRailway(ti);
 
}
 

	
 
int32 SettingsDisableElrail(int32 p1)
 
{
 
	EngineID e_id;
 
	Vehicle* v;
 
	Player *p;
 
	bool disable = (p1 != 0);
 

	
 
	/* we will now walk through all electric train engines and change their railtypes if it is the wrong one*/
 
	const RailType old_railtype = disable ? RAILTYPE_ELECTRIC : RAILTYPE_RAIL;
 
	const RailType new_railtype = disable ? RAILTYPE_RAIL : RAILTYPE_ELECTRIC;
 

	
 
	/* walk through all train engines */
 
	for (e_id = 0; e_id < NUM_TRAIN_ENGINES; e_id++)
 
	{
 
		const RailVehicleInfo *rv_info = RailVehInfo(e_id);
 
		Engine *e = GetEngine(e_id);
 
		/* if it is an electric rail engine and its railtype is the wrong one */
 
		if (rv_info->engclass == 2 && e->railtype == old_railtype) {
 
			/* change it to the proper one */
 
			e->railtype = new_railtype;
 
		}
 
	}
 

	
 
	/* when disabling elrails, make sure that all existing trains can run on
 
	*  normal rail too */
 
	if (disable) {
 
		FOR_ALL_VEHICLES(v) {
 
			if (v->type == VEH_Train && v->u.rail.railtype == RAILTYPE_ELECTRIC) {
 
				/* this railroad vehicle is now compatible only with elrail,
 
				*  so add there also normal rail compatibility */
 
				v->u.rail.compatible_railtypes |= (1 << RAILTYPE_RAIL);
 
				v->u.rail.railtype = RAILTYPE_RAIL;
 
				SETBIT(v->u.rail.flags, VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL);
 
			}
 
		}
 
	}
 

	
 
	/* setup total power for trains */
 
	FOR_ALL_VEHICLES(v) {
 
		/* power is cached only for front engines */
 
		if (v->type == VEH_Train && IsFrontEngine(v)) TrainPowerChanged(v);
 
	}
 

	
 
	FOR_ALL_PLAYERS(p) p->avail_railtypes = GetPlayerRailtypes(p->index);
 

	
 
	/* This resets the _last_built_railtype, which will be invalid for electric
 
	* rails. It may have unintended consequences if that function is ever
 
	* extended, though. */
 
	ReinitGuiAfterToggleElrail(disable);
 
	return 0;
 
}
gui.h
Show inline comments
 
@@ -35,9 +35,10 @@ void ShowLastNewsMessage(void);
 
void ShowMessageOptions(void);
 
void ShowMessageHistory(void);
 

	
 
/* traintoolb_gui.c */
 
/* rail_gui.c */
 
void ShowBuildRailToolbar(RailType railtype, int button);
 
void PlaceProc_BuyLand(TileIndex tile);
 
void ReinitGuiAfterToggleElrail(bool disable);
 

	
 
/* train_gui.c */
 
void ShowTrainViewWindow(const Vehicle *v);
lang/american.txt
Show inline comments
 
@@ -1140,7 +1140,6 @@ STR_CHEAT_NO_JETCRASH                   
 
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_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Allow electric engines to run on normal rail
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Heading for {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Heading for {WAYPOINT}, {VELOCITY}
lang/brazilian_portuguese.txt
Show inline comments
 
@@ -1140,7 +1140,6 @@ STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Aviões a jato não irão ter acidentes em aeroportos pequenos: {ORANGE} {STRING}
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Mudar de clima: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Alterar data: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Ativar modificação de valores de produção: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Permite Trens elétricos em trilho normal
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Dirigindo-se para {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Dirigindo-se para {WAYPOINT}, {VELOCITY}
lang/catalan.txt
Show inline comments
 
@@ -1140,7 +1140,6 @@ STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Els avions a reacció no tindran (freqüents) accidents en els aeroports petits: {ORANGE} {STRING}
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Canviar clima: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Canviar data: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Activar modificació de valors de producció: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Deixar que els trens elèctrics circulin per rails normals
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Cap a {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Cap a {WAYPOINT}, a {VELOCITY}
lang/czech.txt
Show inline comments
 
@@ -1197,7 +1197,6 @@ STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Letadla nebudou na malých letištích (tak casto) havarovat: {ORANGE} {STRING}
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Zmenit podnebí: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Zmenit datum: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Povolit zmenu produkce prumyslu: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Povolit elektrickým lokomotivám vyjet na normální koleje
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Mirim do {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Mirim do {WAYPOINT}, {VELOCITY}
lang/danish.txt
Show inline comments
 
@@ -1140,7 +1140,6 @@ STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Jetfly vil ikke styrte (ofte) i små lufthavne: {ORANGE} {STRING}
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Skift klima: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Ændre dato: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Aktiver modifikation af produktion: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Tillad elektriske tog at køre på almindelige skinner
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Retning mod {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Retning mod {WAYPOINT}, {VELOCITY}
lang/dutch.txt
Show inline comments
 
@@ -1142,7 +1142,6 @@ STR_CHEAT_NO_JETCRASH                   
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Verander klimaat: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Verander datum: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Sta aanpassen productiewaarden toe: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Sta elektrische locomotieven toe op normale rails
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Op weg naar {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Op weg naar {WAYPOINT}, {VELOCITY}
lang/english.txt
Show inline comments
 
@@ -1095,6 +1095,7 @@ STR_CONFIG_PATCHES_SERVINT_SHIPS        
 
STR_CONFIG_PATCHES_SERVINT_SHIPS_DISABLED                       :{LTBLUE}Default service interval for ships: {ORANGE}disabled
 
STR_CONFIG_PATCHES_NOSERVICE                                    :{LTBLUE}Disable servicing when breakdowns set to none: {ORANGE}{STRING1}
 
STR_CONFIG_PATCHES_WAGONSPEEDLIMITS                             :{LTBLUE}Enable wagon speed limits: {ORANGE}{STRING1}
 
STR_CONFIG_PATCHES_DISABLE_ELRAILS                              :{LTBLUE}Disable electric rails: {ORANGE}{STRING1}
 

	
 
STR_CONFIG_PATCHES_COLORED_NEWS_YEAR                            :{LTBLUE}Coloured news appears in: {ORANGE}{STRING1}
 
STR_CONFIG_PATCHES_STARTING_YEAR                                :{LTBLUE}Starting year: {ORANGE}{STRING1}
 
@@ -1143,7 +1144,6 @@ STR_CHEAT_NO_JETCRASH                   
 
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}{STRING1}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Allow electric engines to run on normal rail
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Heading for {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Heading for {WAYPOINT}, {VELOCITY}
lang/estonian.txt
Show inline comments
 
@@ -1197,7 +1197,6 @@ STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Reaktiivlennukid ei kuku alla (tihti) väikestel lennuväljadel: {ORANGE} {STRING}
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Vaheta kliimat: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Muuda kuupäeva: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Luba muutuvad tootmisväärtused: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Luba elektrirongidel sõita tavalisel raudteel
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Suudub kontrollpunti: {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Suundub {WAYPOINT}, {VELOCITY}
lang/finnish.txt
Show inline comments
 
@@ -1140,7 +1140,6 @@ STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Suihkukoneet eivät syöksy (usein) pienille lentokentille: {ORANGE} {STRING}
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Vaihda ilmastoa: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Muuta päiväystä: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Muuntuvat tuotantoarvot: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Salli sähköveturien kulkeminen tavallisella rautatiellä.
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Kohde: {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Kohde: {WAYPOINT}, {VELOCITY}
lang/french.txt
Show inline comments
 
@@ -1141,7 +1141,6 @@ STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Les jets ne s'écrasent plus (fréquemment) sur les petits aéroports: {ORANGE} {STRING}
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Changer de climat : {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Changer la date: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Permettre la modification des valeurs de production : {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Autoriser les locomotives électriques à circuler sur des voies non-électrifiées
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}En route pour {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}En route pour {WAYPOINT}, {VELOCITY}
lang/german.txt
Show inline comments
 
@@ -1141,7 +1141,6 @@ STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Flugzeuge stürzen auf kleinen Flughäfen nicht häufiger ab: {ORANGE} {STRING}
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Wechsle Klima: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Ändere Datum: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Aktiviere Veränderung der Produktionswerte: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Erlaube E-Loks auf normalen Gleisen zu fahren
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Fahre zu {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Fahre zu {WAYPOINT}, {VELOCITY}
lang/hungarian.txt
Show inline comments
 
@@ -1206,7 +1206,6 @@ STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Jet-repülõgépek nem fognak (gyakran) lezuhanni a kisebb repülõtereken: {ORANGE} {STRING}
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Klíma változtatás: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Dátum módosítás: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}A nyersanyagüzemek termelése változtatható: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Közlekedhessenek elektromos mozdonyok hagyományos síneken
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Úton {WAYPOINT} felé
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Úton {WAYPOINT} felé, {VELOCITY}
lang/icelandic.txt
Show inline comments
 
@@ -1110,7 +1110,6 @@ STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Þotur brotlenda ekki (oft) á litlum flugvöllum: {ORANGE} {STRING}
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Skipta um loftslag: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Breyta dagsetningu: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Leyfa breytingar á verðmæti framleiðslu: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Leyfa rafdrifnum lestum að nota venjuleg spor
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Á leiðinni til {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Á leiðinni til {WAYPOINT}, {VELOCITY}
lang/italian.txt
Show inline comments
 
@@ -1142,7 +1142,6 @@ STR_CHEAT_NO_JETCRASH                   
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Cambia paesaggio: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Cambia data: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Permetti la modifica dei valori di produzione: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Permetti l'uso di locomotori elettrici sui binari normali
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Direzione {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Direzione {WAYPOINT}, {VELOCITY}
lang/norwegian.txt
Show inline comments
 
@@ -1137,7 +1137,6 @@ STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Jetfly vil ikke krasje (hele tiden) på små flyplasser: {ORANGE} {STRING}
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Bytt klima: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Bytt dato: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Tillat endring av produksjonsmengder: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Tillat elektriske lokomotiv å kjøre på vanlige skinner
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Har kurs mot {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Har kurs mot {WAYPOINT}, {VELOCITY}
lang/polish.txt
Show inline comments
 
@@ -1227,7 +1227,6 @@ STR_CHEAT_NO_JETCRASH                   
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Zmien klimat: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Zmien date: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Pozwol modyfikowac wielkosc produkcji przedsiebiorstw: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Pozwol lokomotywom elektrycznym pracowac na zwyklych torach
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Zmierza do {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Zmierza do {WAYPOINT}, {VELOCITY}
lang/portuguese.txt
Show inline comments
 
@@ -1140,7 +1140,6 @@ STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Aviões a jacto não irão ter acidentes em aeroportos pequenos: {ORANGE} {STRING}
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Mudar de clima: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Alterar data: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Activar modificação de valores de produção: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Permitir comboios eléctricos em carris normais
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Dirige-se a {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Dirige-se a {WAYPOINT}, {VELOCITY}
lang/romanian.txt
Show inline comments
 
@@ -1106,7 +1106,6 @@ STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Avioanele cu reactie nu se vor prãbusi (frecvent) pe aeroporturile mici: {ORANGE} {STRING}
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Schimbã peisajul: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Schimbã data: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Activeaza accesul la valorile de productie: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Permite motoarealor electrice sã ruleze pe sine normale
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Merge spre {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Merge spre {WAYPOINT}, {VELOCITY}
lang/slovak.txt
Show inline comments
 
@@ -1206,7 +1206,6 @@ STR_CHEAT_NO_JETCRASH                   
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Zmenit klimu: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Zmenit datum: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Povolit zmenu objemu vyroby: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Umoznit pouzitie el. rusnov na normalnych tratiach
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Smeruje do {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Smeruje do {WAYPOINT}, {VELOCITY}
lang/spanish.txt
Show inline comments
 
@@ -1141,7 +1141,6 @@ STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Los Jets no se estrellarán (frecuentemente) en aeropuertos pequeños: {ORANGE} {STRING}
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Cambiar clima: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Cambiar fecha: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Activar modificación de los valores de producción: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Permitir locomotoras eléctricas sobre railes normales
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Hacia {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Hacia {WAYPOINT}, {VELOCITY}
lang/swedish.txt
Show inline comments
 
@@ -1140,7 +1140,6 @@ STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Jetplan kommer inte att störta (frekvent) på små flygplatser: {ORANGE} {STRING}
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Byt klimat: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Byt datum: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Aktivera modifierande produceringsvärden: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Tillåt elektriska lok att använda vanlig räls
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}På väg mot {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}På väg mot {WAYPOINT}, {VELOCITY}
lang/turkish.txt
Show inline comments
 
@@ -1139,7 +1139,6 @@ STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Jetler kücük havalimanlarinda düsmesin: {ORANGE} {STRING}
 
STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}iklimi degistir: {ORANGE} {STRING}
 
STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Tarihi degistir: {ORANGE} {DATE_SHORT}
 
STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Üretim degerlerini degistir: {ORANGE}{STRING}
 
STR_CHEAT_ALLOW_CONVRAIL                                        :{LTBLUE}Elektrikli trenler normal raylarda da gidebilsin
 

	
 
STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Gidiyor -> {WAYPOINT}
 
STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Gidiyor -> {WAYPOINT}, {VELOCITY}
main_gui.c
Show inline comments
 
@@ -46,7 +46,7 @@ static int _rename_id;
 
static int _rename_what;
 

	
 
static byte _terraform_size = 1;
 
static RailType _last_built_railtype;
 
RailType _last_built_railtype;
 
static int _scengen_town_size = 2; // depress medium-sized towns per default
 

	
 
extern void GenerateIndustries(void);
 
@@ -2448,3 +2448,4 @@ void InitializeMainGui(void)
 
	/* Clean old GUI values */
 
	_last_built_railtype = 0;
 
}
 

	
misc_gui.c
Show inline comments
 
@@ -1682,18 +1682,6 @@ static int32 ClickChangeDateCheat(int32 
 
	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};
 
@@ -1720,7 +1708,6 @@ static const CheatEntry _cheats_ui[] = {
 
	{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},
 
};
 

	
 

	
openttd.c
Show inline comments
 
@@ -606,6 +606,8 @@ static void MakeNewGameDone(void)
 
	_current_player = _local_player;
 
	DoCommandP(0, (_patches.autorenew << 15 ) | (_patches.autorenew_months << 16) | 4, _patches.autorenew_money, NULL, CMD_SET_AUTOREPLACE);
 

	
 
	SettingsDisableElrail(_patches.disable_elrails);
 

	
 
	MarkWholeScreenDirty();
 
}
 

	
 
@@ -1536,5 +1538,19 @@ bool AfterLoadGame(void)
 
		ConvertNameArray();
 
	}
 

	
 
	/* from version 38 we have optional elrails */
 
	if (CheckSavegameVersion(38)) {
 
		/* old game - before elrails made optional */
 
		if (CheckSavegameVersion(24)) {
 
			/* very old game - before elrail was introduced */
 
			_patches.disable_elrails = true; // disable elrails
 
		} else {
 
			/* game with mandatory elrails (r4150+) */
 
			_patches.disable_elrails = false; // enable elrails
 
		}
 
	}
 
	/* do the same as when elrails were enabled/disabled manually just now */
 
	SettingsDisableElrail(_patches.disable_elrails);
 

	
 
	return true;
 
}
rail.h
Show inline comments
 
@@ -465,4 +465,7 @@ void DrawDefaultWaypointSprite(int x, in
 
void DrawCatenary(const TileInfo *ti);
 

	
 
uint GetRailFoundation(Slope tileh, TrackBits bits);
 

	
 
int32 SettingsDisableElrail(int32 p1); ///< _patches.disable_elrail callback
 

	
 
#endif /* RAIL_H */
rail_cmd.c
Show inline comments
 
@@ -883,6 +883,9 @@ static int32 DoConvertRail(TileIndex til
 
	// tile is already of requested type?
 
	if (GetRailType(tile) == totype) return CMD_ERROR;
 

	
 
	// 'hidden' elrails can't be downgraded to normal rail when elrails are disabled
 
	if (_patches.disable_elrails && totype == RAILTYPE_RAIL && GetRailType(tile) == RAILTYPE_ELECTRIC) return CMD_ERROR;
 

	
 
	// change type.
 
	if (exec) {
 
		TrackBits tracks;
rail_gui.c
Show inline comments
 
@@ -22,6 +22,7 @@
 
#include "variables.h"
 
#include "newgrf_callbacks.h"
 
#include "newgrf_station.h"
 
#include "train.h"
 

	
 
static RailType _cur_railtype;
 
static bool _remove_button_clicked;
 
@@ -1150,3 +1151,20 @@ void InitializeRailGui(void)
 
	_railstation.platlength = 1;
 
	_railstation.dragdrop = true;
 
}
 

	
 
void ReinitGuiAfterToggleElrail(bool disable)
 
{
 
	extern RailType _last_built_railtype;
 
	if (disable && _last_built_railtype == RAILTYPE_ELECTRIC) {
 
		Window *w;
 
		_last_built_railtype = _cur_railtype = RAILTYPE_RAIL;
 
		w = FindWindowById(WC_BUILD_TOOLBAR, 0);
 
		if (w != NULL && w->wndproc == BuildRailToolbWndProc) {
 
			SetupRailToolbar(_cur_railtype, w);
 
			SetWindowDirty(w);
 
		}
 
	}
 
	MarkWholeScreenDirty();
 
}
 

	
 

	
road_cmd.c
Show inline comments
 
@@ -430,6 +430,9 @@ int32 DoConvertStreetRail(TileIndex tile
 

	
 
	if (GetRailTypeCrossing(tile) == totype) return CMD_ERROR;
 

	
 
	// 'hidden' elrails can't be downgraded to normal rail when elrails are disabled
 
	if (_patches.disable_elrails && totype == RAILTYPE_RAIL && GetRailTypeCrossing(tile) == RAILTYPE_ELECTRIC) return CMD_ERROR;
 

	
 
	if (exec) {
 
		SetRailTypeCrossing(tile, totype);
 
		MarkTileDirtyByTile(tile);
saveload.c
Show inline comments
 
@@ -30,7 +30,7 @@
 
#include "variables.h"
 
#include <setjmp.h>
 

	
 
const uint16 SAVEGAME_VERSION = 37;
 
const uint16 SAVEGAME_VERSION = 38;
 
uint16 _sl_version;       /// the major savegame version identifier
 
byte   _sl_minor_version; /// the minor savegame version, DO NOT USE!
 

	
settings.c
Show inline comments
 
@@ -38,6 +38,7 @@
 
#include "newgrf.h"
 
#include "genworld.h"
 
#include "date.h"
 
#include "rail.h"
 
#ifdef WITH_FREETYPE
 
#include "gfx.h"
 
#include "fontcache.h"
 
@@ -1320,6 +1321,7 @@ const SettingDesc _patch_settings[] = {
 
	 SDT_VAR(Patches, servint_aircraft,  SLE_UINT16, 0,D0,   100,     5,     800, 0, STR_CONFIG_PATCHES_SERVINT_AIRCRAFT,     InValidateDetailsWindow),
 
	SDT_BOOL(Patches, no_servicing_if_no_breakdowns, 0, 0, false,                    STR_CONFIG_PATCHES_NOSERVICE,            NULL),
 
	SDT_BOOL(Patches, wagon_speed_limits,            0, 0,  true,                    STR_CONFIG_PATCHES_WAGONSPEEDLIMITS,     NULL),
 
	SDT_CONDBOOL(Patches, disable_elrails, 38, SL_MAX_VERSION, 0, 0, false,          STR_CONFIG_PATCHES_DISABLE_ELRAILS,      SettingsDisableElrail),
 

	
 
	/***************************************************************************/
 
	/* Station section of the GUI-configure patches window */
settings_gui.c
Show inline comments
 
@@ -646,6 +646,7 @@ static const char *_patches_vehicles[] =
 
	"servint_aircraft",
 
	"no_servicing_if_no_breakdowns",
 
	"wagon_speed_limits",
 
	"disable_elrails",
 
};
 

	
 
typedef struct PatchEntry {
station_cmd.c
Show inline comments
 
@@ -1358,6 +1358,9 @@ int32 DoConvertStationRail(TileIndex til
 

	
 
	if (GetRailType(tile) == totype) return CMD_ERROR;
 

	
 
	// 'hidden' elrails can't be downgraded to normal rail when elrails are disabled
 
	if (_patches.disable_elrails && totype == RAILTYPE_RAIL && GetRailType(tile) == RAILTYPE_ELECTRIC) return CMD_ERROR;
 

	
 
	if (exec) {
 
		SetRailType(tile, totype);
 
		MarkTileDirtyByTile(tile);
train_cmd.c
Show inline comments
 
@@ -192,6 +192,13 @@ void TrainConsistChanged(Vehicle* v)
 
				v->u.rail.compatible_railtypes |= GetRailTypeInfo(u->u.rail.railtype)->powered_railtypes;
 
			}
 

	
 
			/* Some electric engines can be allowed to run on normal rail. It happens to all
 
			 * existing electric engines when elrails are disabled and then re-enabled */
 
			if (HASBIT(u->u.rail.flags, VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL)) {
 
				u->u.rail.railtype = RAILTYPE_RAIL;
 
				u->u.rail.compatible_railtypes |= (1 << RAILTYPE_RAIL);
 
			}
 

	
 
			// max speed is the minimum of the speed limits of all vehicles in the consist
 
			if (!(rvi_u->flags & RVI_WAGON) || _patches.wagon_speed_limits)
 
				if (rvi_u->max_speed != 0 && !UsesWagonOverride(u))
tunnelbridge_cmd.c
Show inline comments
 
@@ -772,6 +772,9 @@ int32 DoConvertTunnelBridgeRail(TileInde
 

	
 
		if (GetRailType(tile) == totype) return CMD_ERROR;
 

	
 
		// 'hidden' elrails can't be downgraded to normal rail when elrails are disabled
 
		if (_patches.disable_elrails && totype == RAILTYPE_RAIL && GetRailType(tile) == RAILTYPE_ELECTRIC) return CMD_ERROR;
 

	
 
		endtile = CheckTunnelBusy(tile, &length);
 
		if (endtile == INVALID_TILE) return CMD_ERROR;
 

	
variables.h
Show inline comments
 
@@ -125,6 +125,7 @@ typedef struct Patches {
 
	bool no_servicing_if_no_breakdowns; // dont send vehicles to depot when breakdowns are disabled
 
	bool link_terraform_toolbar;        // display terraform toolbar when displaying rail, road, water and airport toolbars
 
	bool reverse_scroll;                // Right-Click-Scrolling scrolls in the opposite direction
 
	bool disable_elrails;               // when true, the elrails are disabled
 
	bool measure_tooltip;               // Show a permanent tooltip when dragging tools
 
	byte liveries;                      // Options for displaying company liveries, 0=none, 1=self, 2=all
 
	bool prefer_teamchat;               // Choose the chat message target with <ENTER>, true=all players, false=your team
 
@@ -240,7 +241,7 @@ typedef struct Cheats {
 
	Cheat switch_climate;
 
	Cheat change_date;      // changes date ingame
 
	Cheat setup_prod;       // setup raw-material production in game
 
	Cheat elrail;           // allow electric engines to be powered on conventional rail
 
	Cheat dummy;            // empty cheat (enable running el-engines on normal rail)
 
} Cheats;
 

	
 
VARDEF Cheats _cheats;
vehicle.h
Show inline comments
 
@@ -95,6 +95,9 @@ enum {
 

	
 
	// used to mark train as lost because PF can't find the route
 
	VRF_NO_PATH_TO_DESTINATION = 5,
 

	
 
	// used to mark that electric train engine is allowed to run on normal rail
 
	VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL = 6,
 
};
 

	
 
typedef struct VehicleAir {
0 comments (0 inline, 0 general)