newgrf_text.h
author bjarni
Mon, 14 Aug 2006 15:03:01 +0000
changeset 4262 4657d940a84c
parent 3821 2bb8a2643fdf
child 4305 c25b05028b71
permissions -rw-r--r--
(svn r5888) -Fix: [autoreplace] if vehicles breakdowns and service are turned off, the vehicles failed to enter any depots
now they will quickly go to a depot if set to be replaced
the tradeoff is that a vehicle set to be replaced and without a depot in the orders will forget about the orders and head for a depot. If the replace fails (lack of money), it will exit and try to head for the depot again
also all vehicles of that type will rush to the depots at once, risking causing traffic jams. This is because there is no way to even it out like normal depot visits offers
Tip: add a depot to the orders of all vehicles, set it to service only and it will always be skipped unless the vehicle is set to be replaced. This should help on the jam issue and if the replace fails, the vehicle will go though a whole round of the orders and make more money before trying again
3601
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     1
/* $Id$ */
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     2
#ifndef NEWGRF_TEXT_H
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     3
#define NEWGRF_TEXT_H
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     4
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     5
/** @file
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     6
 * Header of Action 04 "universal holder" structure and functions
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     7
 */
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     8
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     9
/**
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    10
 * Element of the linked list.
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    11
 * Each of those elements represent the string,
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    12
 * but according to a different lang.
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    13
 */
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    14
typedef struct GRFText {
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    15
	byte langid;
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    16
	char *text;
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    17
	struct GRFText *next;
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    18
} GRFText;
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    19
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    20
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    21
/**
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    22
 * Holder of the above structure.
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    23
 * Putting both grfid and stringid togueter allow us to avoid duplicates,
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    24
 * since it is NOT SUPPOSED to happen.
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    25
 */
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    26
typedef struct GRFTextEntry {
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    27
	uint32 grfid;
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    28
	uint16 stringid;
3821
2bb8a2643fdf (svn r4832) - NewGRF: add support for original string ID to newgrf text handling. So far, this is used for vehicles when no English or American translation is provided.
peter1138
parents: 3641
diff changeset
    29
	StringID def_string;
3601
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    30
	GRFText *textholder;
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    31
} GRFTextEntry;
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    32
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    33
3821
2bb8a2643fdf (svn r4832) - NewGRF: add support for original string ID to newgrf text handling. So far, this is used for vehicles when no English or American translation is provided.
peter1138
parents: 3641
diff changeset
    34
StringID AddGRFString(uint32 grfid, uint16 stringid, byte langid, bool new_scheme, const char *text_to_add, StringID def_string);
3601
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    35
StringID GetGRFStringID(uint32 grfid, uint16 stringid);
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    36
char *GetGRFString(char *buff, uint16 stringid);
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    37
void CleanUpStrings(void);
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    38
void SetCurrentGrfLangID(const char *iso_name);
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    39
ac6df06db648 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    40
#endif /* NEWGRF_TEXT_H */