summaryrefslogtreecommitdiff
path: root/town_gui.c
diff options
context:
space:
mode:
authorludde <ludde@openttd.org>2005-07-15 18:30:13 +0000
committerludde <ludde@openttd.org>2005-07-15 18:30:13 +0000
commit3486e7e9d5d24e2e0595b7a8d517581b926b85cd (patch)
tree77cbbb71361c4ceb1306dc06c65b6364221d6c2f /town_gui.c
parent157addf5e9d85e513355edb97d513443ba9c131f (diff)
downloadopenttd-3486e7e9d5d24e2e0595b7a8d517581b926b85cd.tar.xz
(svn r2580) Change: Added {INDUSTRY} command for printing industry names instead of the old {TOWN} {STRING} way.
- The formatting of the industry name can be controlled with the string STR_INDUSTRY_FORMAT. Change: Changed several occurences of {STRING1} into {TOWN} to get rid of townnametype being used directly.
Diffstat (limited to 'town_gui.c')
-rw-r--r--town_gui.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/town_gui.c b/town_gui.c
index 46782e5a7..49bddab1c 100644
--- a/town_gui.c
+++ b/town_gui.c
@@ -257,8 +257,8 @@ static void TownViewWndProc(Window *w, WindowEvent *e)
ShowTownAuthorityWindow(w->window_number);
break;
case 8: /* rename */
- SetDParam(0, t->townnameparts);
- ShowQueryString(t->townnametype, STR_2007_RENAME_TOWN, 31, 130, w->window_class, w->window_number);
+ SetDParam(0, w->window_number);
+ ShowQueryString(STR_TOWN, STR_2007_RENAME_TOWN, 31, 130, w->window_class, w->window_number);
break;
case 9: /* expand town */
ExpandTown(t);
@@ -365,13 +365,12 @@ static uint16 _last_town_idx;
static int CDECL TownNameSorter(const void *a, const void *b)
{
char buf1[64];
- const Town *t;
uint16 val;
int r;
+ int32 argv[1];
- t = GetTown(*(const uint16*)a);
- SetDParam(0, t->townnameparts);
- GetString(buf1, t->townnametype);
+ argv[0] = *(const uint16*)a;
+ GetStringWithArgs(buf1, STR_TOWN, argv);
/* If 'b' is the same town as in the last round, use the cached value
* We do this to speed stuff up ('b' is called with the same value a lot of
@@ -379,9 +378,8 @@ static int CDECL TownNameSorter(const void *a, const void *b)
val = *(const uint16*)b;
if (val != _last_town_idx) {
_last_town_idx = val;
- t = GetTown(val);
- SetDParam(0, t->townnameparts);
- GetString(_bufcache, t->townnametype);
+ argv[0] = val;
+ GetStringWithArgs(_bufcache, STR_TOWN, argv);
}
r = strcmp(buf1, _bufcache);