From 594dd34e84e78b03e1cdeb7cf262707fd714a5fa Mon Sep 17 00:00:00 2001 From: ludde Date: Sat, 16 Jul 2005 20:58:04 +0000 Subject: (svn r2594) Fix: [strgen] Misc updates to the string system. - Renamed the plural command to "P" instead of "PLURAL". Now write something like this to append an s on plural: {P "" s}. (You can optionally still add an argument index to explicitly specifiy which number that's used) - Removed the pluralized cargo strings from the string files. The new method is to use the plural specifier {P} - Added support for genders. First add "##gender der das die" on top, then use {G=der} on a cargoname/industry to set the gender, and to switch between genders do something like {G neu neu neue} {STRING} - Updated the swedish/english translation with P strings. --- aircraft_gui.c | 6 ++-- engine_gui.c | 6 ++-- industry_gui.c | 8 +++--- lang/english.txt | 85 +++++++++++++++++------------------------------------- lang/swedish.txt | 50 ++++++-------------------------- misc.c | 4 +-- roadveh_gui.c | 4 +-- ship_gui.c | 6 ++-- station_gui.c | 4 +-- strgen/strgen.c | 88 ++++++++++++++++++++++++++++++++++++++++++++++---------- strings.c | 35 ++++++++++++++++------ train_gui.c | 8 +++--- variables.h | 3 +- 13 files changed, 159 insertions(+), 148 deletions(-) diff --git a/aircraft_gui.c b/aircraft_gui.c index a235e68d9..33bbef5ed 100644 --- a/aircraft_gui.c +++ b/aircraft_gui.c @@ -245,7 +245,7 @@ static void AircraftRefitWndProc(Window *w, WindowEvent *e) int32 cost = DoCommandByTile(v->tile, v->index, WP(w,refit_d).cargo, DC_QUERY_COST, CMD_REFIT_AIRCRAFT); if (!CmdFailed(cost)) { SetDParam(2, cost); - SetDParam(0, _cargoc.names_long_p[WP(w,refit_d).cargo]); + SetDParam(0, _cargoc.names_long[WP(w,refit_d).cargo]); SetDParam(1, _aircraft_refit_capacity); DrawString(1, 137, STR_A041_NEW_CAPACITY_COST_OF_REFIT, 0); } @@ -377,10 +377,10 @@ static void AircraftDetailsWndProc(Window *w, WindowEvent *e) DrawString(60, y, STR_A011_BUILT_VALUE, 0); y += 10; - SetDParam(0, _cargoc.names_long_p[v->cargo_type]); + SetDParam(0, _cargoc.names_long[v->cargo_type]); SetDParam(1, v->cargo_cap); u = v->next; - SetDParam(2, _cargoc.names_long_p[u->cargo_type]); + SetDParam(2, _cargoc.names_long[u->cargo_type]); SetDParam(3, u->cargo_cap); DrawString(60, y, STR_A019_CAPACITY + (u->cargo_cap == 0), 0); y += 14; diff --git a/engine_gui.c b/engine_gui.c index f5817e4f0..72e939b5b 100644 --- a/engine_gui.c +++ b/engine_gui.c @@ -135,7 +135,7 @@ static void DrawTrainEngineInfo(int engine, int x, int y, int maxw) SetDParam(5, STR_8838_N_A); if (cap != 0) { SetDParam(6, cap << multihead); - SetDParam(5, _cargoc.names_long_p[rvi->cargo_type]); + SetDParam(5, _cargoc.names_long[rvi->cargo_type]); } DrawStringMultiCenter(x, y, STR_885B_COST_WEIGHT_T_SPEED_POWER, maxw); } @@ -217,7 +217,7 @@ static void DrawRoadVehEngineInfo(int engine, int x, int y, int maxw) SetDParam(2, rvi->running_cost * _price.roadveh_running >> 8); SetDParam(4, rvi->capacity); - SetDParam(3, _cargoc.names_long_p[rvi->cargo_type]); + SetDParam(3, _cargoc.names_long[rvi->cargo_type]); DrawStringMultiCenter(x, y, STR_902A_COST_SPEED_RUNNING_COST, maxw); } @@ -253,7 +253,7 @@ static void DrawShipEngineInfo(int engine, int x, int y, int maxw) const ShipVehicleInfo *svi = ShipVehInfo(engine); SetDParam(0, svi->base_cost * (_price.ship_base >> 3) >> 5); SetDParam(1, svi->max_speed * 10 >> 5); - SetDParam(2, _cargoc.names_long_p[svi->cargo_type]); + SetDParam(2, _cargoc.names_long[svi->cargo_type]); SetDParam(3, svi->capacity); SetDParam(4, svi->running_cost * _price.ship_running >> 8); DrawStringMultiCenter(x, y, STR_982E_COST_MAX_SPEED_CAPACITY, maxw); diff --git a/industry_gui.c b/industry_gui.c index 6c98343fc..7a8743807 100644 --- a/industry_gui.c +++ b/industry_gui.c @@ -301,8 +301,8 @@ static void IndustryViewWndProc(Window *w, WindowEvent *e) if (i->produced_cargo[0] != CT_INVALID) { DrawString(2, 117, STR_482A_PRODUCTION_LAST_MONTH, 0); + SetDParam(0, _cargoc.names_long[i->produced_cargo[0]]); SetDParam(1, i->total_production[0]); - SetDParam(0, _cargoc.names_long_s[i->produced_cargo[0]] + ((i->total_production[0]!=1)<<5)); SetDParam(2, i->pct_transported[0] * 100 >> 8); DrawString(4 + (NEED_ALTERB ? 30 : 0), 127, STR_482B_TRANSPORTED, 0); @@ -311,8 +311,8 @@ static void IndustryViewWndProc(Window *w, WindowEvent *e) DrawArrowButtons(5, 127, (WP(w,vp2_d).data_2 == 1 ? WP(w,vp2_d).data_3 : 0)); if (i->produced_cargo[1] != CT_INVALID) { + SetDParam(0, _cargoc.names_long[i->produced_cargo[1]]); SetDParam(1, i->total_production[1]); - SetDParam(0, _cargoc.names_long_s[i->produced_cargo[1]] + ((i->total_production[1]!=1)<<5)); SetDParam(2, i->pct_transported[1] * 100 >> 8); DrawString(4 + (NEED_ALTERB ? 30 : 0), 137, STR_482B_TRANSPORTED, 0); // Let's put out those buttons.. @@ -586,12 +586,12 @@ static void IndustryDirectoryWndProc(Window *w, WindowEvent *e) i = GetIndustry(_industry_sort[p]); SetDParam(0, i->index); if (i->produced_cargo[0] != 0xFF) { + SetDParam(1, _cargoc.names_long[i->produced_cargo[0]]); SetDParam(2, i->total_production[0]); - SetDParam(1, _cargoc.names_long_s[i->produced_cargo[0]] + ((i->total_production[0]!=1)<<5)); if (i->produced_cargo[1] != 0xFF) { + SetDParam(3, _cargoc.names_long[i->produced_cargo[1]]); SetDParam(4, i->total_production[1]); - SetDParam(3, _cargoc.names_long_s[i->produced_cargo[1]] + ((i->total_production[1]!=1)<<5)); SetDParam(5, i->pct_transported[0] * 100 >> 8); SetDParam(6, i->pct_transported[1] * 100 >> 8); DrawString(4, 28+n*10, STR_INDUSTRYDIR_ITEM_TWO, 0); diff --git a/lang/english.txt b/lang/english.txt index 4d7b03bf3..61124ae22 100644 --- a/lang/english.txt +++ b/lang/english.txt @@ -1,6 +1,7 @@ ##name English ##ownname English (UK) ##isocode en_GB +##plural 0 ##id 0x0000 STR_NULL : @@ -82,69 +83,37 @@ STR_004B_BATTERY :Battery STR_004C_PLASTIC :Plastic STR_004D_FIZZY_DRINK :Fizzy Drink STR_004E : -STR_004F_PASSENGER :{COMMA} passenger -STR_0050_TON_OF_COAL :{COMMA} tonne of coal -STR_0051_BAG_OF_MAIL :{COMMA} bag of mail +STR_004F_PASSENGER :{COMMA} passenger{P "" s} +STR_0050_TON_OF_COAL :{COMMA} tonne{P "" s} of coal +STR_0051_BAG_OF_MAIL :{COMMA} bag{P "" s} of mail STR_0052_OF_OIL :{VOLUME} of oil -STR_0053_ITEM_OF_LIVESTOCK :{COMMA} item of livestock -STR_0054_CRATE_OF_GOODS :{COMMA} crate of goods -STR_0055_TON_OF_GRAIN :{COMMA} tonne of grain -STR_0056_TON_OF_WOOD :{COMMA} tonne of wood -STR_0057_TON_OF_IRON_ORE :{COMMA} tonne of iron ore -STR_0058_TON_OF_STEEL :{COMMA} tonne of steel -STR_0059_BAG_OF_VALUABLES :{COMMA} bag of valuables -STR_005A_TON_OF_COPPER_ORE :{COMMA} tonne of copper ore -STR_005B_TON_OF_MAIZE :{COMMA} tonne of maize -STR_005C_TON_OF_FRUIT :{COMMA} tonne of fruit -STR_005D_BAG_OF_DIAMONDS :{COMMA} bag of diamonds -STR_005E_TON_OF_FOOD :{COMMA} tonne of food -STR_005F_TON_OF_PAPER :{COMMA} tonne of paper -STR_0060_BAG_OF_GOLD :{COMMA} bag of gold +STR_0053_ITEM_OF_LIVESTOCK :{COMMA} item{P "" s} of livestock +STR_0054_CRATE_OF_GOODS :{COMMA} crate{P "" s} of goods +STR_0055_TON_OF_GRAIN :{COMMA} tonne{P "" s} of grain +STR_0056_TON_OF_WOOD :{COMMA} tonne{P "" s} of wood +STR_0057_TON_OF_IRON_ORE :{COMMA} tonne{P "" s} of iron ore +STR_0058_TON_OF_STEEL :{COMMA} tonne{P "" s} of steel +STR_0059_BAG_OF_VALUABLES :{COMMA} bag{P "" s} of valuables +STR_005A_TON_OF_COPPER_ORE :{COMMA} tonne{P "" s} of copper ore +STR_005B_TON_OF_MAIZE :{COMMA} tonne{P "" s} of maize +STR_005C_TON_OF_FRUIT :{COMMA} tonne{P "" s} of fruit +STR_005D_BAG_OF_DIAMONDS :{COMMA} bag{P "" s} of diamonds +STR_005E_TON_OF_FOOD :{COMMA} tonne{P "" s} of food +STR_005F_TON_OF_PAPER :{COMMA} tonne{P "" s} of paper +STR_0060_BAG_OF_GOLD :{COMMA} bag{P "" s} of gold STR_0061_OF_WATER :{VOLUME} of water -STR_0062_TON_OF_WHEAT :{COMMA} tonne of wheat +STR_0062_TON_OF_WHEAT :{COMMA} tonne{P "" s} of wheat STR_0063_OF_RUBBER :{VOLUME} of rubber -STR_0064_TON_OF_SUGAR :{COMMA} tonne of sugar -STR_0065_TOY :{COMMA} toy -STR_0066_BAG_OF_CANDY :{COMMA} bag of sweets +STR_0064_TON_OF_SUGAR :{COMMA} tonne{P "" s} of sugar +STR_0065_TOY :{COMMA} toy{P "" s} +STR_0066_BAG_OF_CANDY :{COMMA} bag{P "" s} of sweets STR_0067_OF_COLA :{VOLUME} of cola -STR_0068_TON_OF_COTTON_CANDY :{COMMA} tonne of candyfloss -STR_0069_BUBBLE :{COMMA} bubble -STR_006A_TON_OF_TOFFEE :{COMMA} tonne of toffee -STR_006B_BATTERY :{COMMA} battery +STR_0068_TON_OF_COTTON_CANDY :{COMMA} tonne{P "" s} of candyfloss +STR_0069_BUBBLE :{COMMA} bubble{P "" s} +STR_006A_TON_OF_TOFFEE :{COMMA} tonne{P "" s} of toffee +STR_006B_BATTERY :{COMMA} batter{P y ies} STR_006C_OF_PLASTIC :{VOLUME} of plastic -STR_006D_FIZZY_DRINK :{COMMA} fizzy drink -STR_006E : -STR_006F_PASSENGERS :{COMMA} passengers -STR_0070_TONS_OF_COAL :{COMMA} tonnes of coal -STR_0071_BAGS_OF_MAIL :{COMMA} bags of mail -STR_0072_OF_OIL :{VOLUME} of oil -STR_0073_ITEMS_OF_LIVESTOCK :{COMMA} items of livestock -STR_0074_CRATES_OF_GOODS :{COMMA} crates of goods -STR_0075_TONS_OF_GRAIN :{COMMA} tonnes of grain -STR_0076_TONS_OF_WOOD :{COMMA} tonnes of wood -STR_0077_TONS_OF_IRON_ORE :{COMMA} tonnes of iron ore -STR_0078_TONS_OF_STEEL :{COMMA} tonnes of steel -STR_0079_BAGS_OF_VALUABLES :{COMMA} bags of valuables -STR_007A_TONS_OF_COPPER_ORE :{COMMA} tonnes of copper ore -STR_007B_TONS_OF_MAIZE :{COMMA} tonnes of maize -STR_007C_TONS_OF_FRUIT :{COMMA} tonnes of fruit -STR_007D_BAGS_OF_DIAMONDS :{COMMA} bags of diamonds -STR_007E_TONS_OF_FOOD :{COMMA} tonnes of food -STR_007F_TONS_OF_PAPER :{COMMA} tonnes of paper -STR_0080_BAGS_OF_GOLD :{COMMA} bags of gold -STR_0081_OF_WATER :{VOLUME} of water -STR_0082_TONS_OF_WHEAT :{COMMA} tonnes of wheat -STR_0083_OF_RUBBER :{VOLUME} of rubber -STR_0084_TONS_OF_SUGAR :{COMMA} tonnes of sugar -STR_0085_TOYS :{COMMA} toys -STR_0086_BAGS_OF_CANDY :{COMMA} bags of sweets -STR_0087_OF_COLA :{VOLUME} of cola -STR_0088_TONS_OF_COTTON_CANDY :{COMMA} tonnes of candyfloss -STR_0089_BUBBLES :{COMMA} bubbles -STR_008A_TONS_OF_TOFFEE :{COMMA} tonnes of toffee -STR_008B_BATTERIES :{COMMA} batteries -STR_008C_OF_PLASTIC :{VOLUME} of plastic -STR_008D_FIZZY_DRINKS :{COMMA} fizzy drinks +STR_006D_FIZZY_DRINK :{COMMA} fizzy drink{P "" s} STR_008E : STR_008F_PS :{TINYFONT}PS STR_0090_CL :{TINYFONT}CL diff --git a/lang/swedish.txt b/lang/swedish.txt index 523419f7c..6fb875d38 100644 --- a/lang/swedish.txt +++ b/lang/swedish.txt @@ -84,67 +84,35 @@ STR_004D_FIZZY_DRINK :l STR_004E : STR_004F_PASSENGER :{COMMA} passagerare STR_0050_TON_OF_COAL :{COMMA} ton kol -STR_0051_BAG_OF_MAIL :{COMMA} postsäck +STR_0051_BAG_OF_MAIL :{COMMA} postsäck{P "" ar} STR_0052_OF_OIL :{VOLUME} olja STR_0053_ITEM_OF_LIVESTOCK :{COMMA} boskap -STR_0054_CRATE_OF_GOODS :{COMMA} låda gods +STR_0054_CRATE_OF_GOODS :{COMMA} låd{P a or} gods STR_0055_TON_OF_GRAIN :{COMMA} ton spannmål STR_0056_TON_OF_WOOD :{COMMA} ton timmer STR_0057_TON_OF_IRON_ORE :{COMMA} ton järnmalm STR_0058_TON_OF_STEEL :{COMMA} ton stål -STR_0059_BAG_OF_VALUABLES :{COMMA} värdesäck +STR_0059_BAG_OF_VALUABLES :{COMMA} värdesäck{P "" ar} STR_005A_TON_OF_COPPER_ORE :{COMMA} ton kopparmalm STR_005B_TON_OF_MAIZE :{COMMA} ton majs STR_005C_TON_OF_FRUIT :{COMMA} ton frukt -STR_005D_BAG_OF_DIAMONDS :{COMMA} diamantsäck +STR_005D_BAG_OF_DIAMONDS :{COMMA} diamantsäck{P "" ar} STR_005E_TON_OF_FOOD :{COMMA} ton mat STR_005F_TON_OF_PAPER :{COMMA} ton papper -STR_0060_BAG_OF_GOLD :{COMMA} guldsäck +STR_0060_BAG_OF_GOLD :{COMMA} guldsäck{P "" ar} STR_0061_OF_WATER :{VOLUME} vatten STR_0062_TON_OF_WHEAT :{COMMA} ton vete STR_0063_OF_RUBBER :{VOLUME} gummi STR_0064_TON_OF_SUGAR :{COMMA} ton socker -STR_0065_TOY :{COMMA} leksak -STR_0066_BAG_OF_CANDY :{COMMA} godispåse +STR_0065_TOY :{COMMA} leksak{P "" er} +STR_0066_BAG_OF_CANDY :{COMMA} godispås{P e ar} STR_0067_OF_COLA :{VOLUME} kola STR_0068_TON_OF_COTTON_CANDY :{COMMA} ton spunnet socker -STR_0069_BUBBLE :{COMMA} bubbla +STR_0069_BUBBLE :{COMMA} bubbl{P a or} STR_006A_TON_OF_TOFFEE :{COMMA} ton knäck -STR_006B_BATTERY :{COMMA} batteri +STR_006B_BATTERY :{COMMA} batteri{P "" er} STR_006C_OF_PLASTIC :{VOLUME} plast STR_006D_FIZZY_DRINK :{COMMA} läsk -STR_006E : -STR_006F_PASSENGERS :{COMMA} passagerare -STR_0070_TONS_OF_COAL :{COMMA} ton kol -STR_0071_BAGS_OF_MAIL :{COMMA} postsäckar -STR_0072_OF_OIL :{VOLUME} olja -STR_0073_ITEMS_OF_LIVESTOCK :{COMMA} stycken boskap -STR_0074_CRATES_OF_GOODS :{COMMA} lådor gods -STR_0075_TONS_OF_GRAIN :{COMMA} ton spannmål -STR_0076_TONS_OF_WOOD :{COMMA} ton timmer -STR_0077_TONS_OF_IRON_ORE :{COMMA} ton järnmalm -STR_0078_TONS_OF_STEEL :{COMMA} ton stål -STR_0079_BAGS_OF_VALUABLES :{COMMA} värdesäckar -STR_007A_TONS_OF_COPPER_ORE :{COMMA} ton kopparmalm -STR_007B_TONS_OF_MAIZE :{COMMA} ton majs -STR_007C_TONS_OF_FRUIT :{COMMA} ton frukt -STR_007D_BAGS_OF_DIAMONDS :{COMMA} diamantsäckar -STR_007E_TONS_OF_FOOD :{COMMA} ton mat -STR_007F_TONS_OF_PAPER :{COMMA} ton papper -STR_0080_BAGS_OF_GOLD :{COMMA} guldsäckar -STR_0081_OF_WATER :{VOLUME} vatten -STR_0082_TONS_OF_WHEAT :{COMMA} ton vete -STR_0083_OF_RUBBER :{VOLUME} gummi -STR_0084_TONS_OF_SUGAR :{COMMA} ton socker -STR_0085_TOYS :{COMMA} leksaker -STR_0086_BAGS_OF_CANDY :{COMMA} godispåsar -STR_0087_OF_COLA :{VOLUME} kola -STR_0088_TONS_OF_COTTON_CANDY :{COMMA} ton spunnet socker -STR_0089_BUBBLES :{COMMA} bubblor -STR_008A_TONS_OF_TOFFEE :{COMMA} ton knäck -STR_008B_BATTERIES :{COMMA} batterier -STR_008C_OF_PLASTIC :{VOLUME} plast -STR_008D_FIZZY_DRINKS :{COMMA} läsk STR_008E : STR_008F_PS :{TINYFONT}PS STR_0090_CL :{TINYFONT}KL diff --git a/misc.c b/misc.c index 193c7fa22..f7b6c120a 100644 --- a/misc.c +++ b/misc.c @@ -430,8 +430,8 @@ void InitializeLandscapeVariables(bool only_constants) str = lpd->names[i]; _cargoc.names_s[i] = str; _cargoc.names_p[i] = (str += 0x20); - _cargoc.names_long_s[i] = (str += 0x20); - _cargoc.names_long_p[i] = (str += 0x20); + _cargoc.names_long[i] = (str += 0x20); +// _cargoc.names_long_p[i] = (str += 0x20); _cargoc.names_short[i] = (str += 0x20); _cargoc.weights[i] = lpd->weights[i]; diff --git a/roadveh_gui.c b/roadveh_gui.c index e715cd9f3..972770885 100644 --- a/roadveh_gui.c +++ b/roadveh_gui.c @@ -39,7 +39,7 @@ void DrawRoadVehPurchaseInfo(int x, int y, EngineID engine_number) y += 10; /* Cargo type + capacity */ - SetDParam(0, _cargoc.names_long_p[rvi->cargo_type]); + SetDParam(0, _cargoc.names_long[rvi->cargo_type]); SetDParam(1, rvi->capacity); SetDParam(2, STR_EMPTY); DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, 0); @@ -138,7 +138,7 @@ static void RoadVehDetailsWndProc(Window *w, WindowEvent *e) SetDParam(2, v->value); DrawString(34, 57, STR_9011_BUILT_VALUE, 0); - SetDParam(0, _cargoc.names_long_p[v->cargo_type]); + SetDParam(0, _cargoc.names_long[v->cargo_type]); SetDParam(1, v->cargo_cap); DrawString(34, 67, STR_9012_CAPACITY, 0); diff --git a/ship_gui.c b/ship_gui.c index f27bf458c..12943d85d 100644 --- a/ship_gui.c +++ b/ship_gui.c @@ -32,7 +32,7 @@ void DrawShipPurchaseInfo(int x, int y, EngineID engine_number) y += 10; /* Cargo type + capacity */ - SetDParam(0, _cargoc.names_long_p[svi->cargo_type]); + SetDParam(0, _cargoc.names_long[svi->cargo_type]); SetDParam(1, svi->capacity); SetDParam(2, svi->refittable ? STR_9842_REFITTABLE : STR_EMPTY); DrawString(x,y, STR_PURCHASE_INFO_CAPACITY, 0); @@ -87,7 +87,7 @@ static void ShipRefitWndProc(Window *w, WindowEvent *e) int32 cost = DoCommandByTile(v->tile, v->index, WP(w,refit_d).cargo, DC_QUERY_COST, CMD_REFIT_SHIP); if (!CmdFailed(cost)) { SetDParam(2, cost); - SetDParam(0, _cargoc.names_long_p[WP(w,refit_d).cargo]); + SetDParam(0, _cargoc.names_long[WP(w,refit_d).cargo]); SetDParam(1, v->cargo_cap); DrawString(1, 137, STR_9840_NEW_CAPACITY_COST_OF_REFIT, 0); } @@ -214,7 +214,7 @@ static void ShipDetailsWndProc(Window *w, WindowEvent *e) SetDParam(2, v->value); DrawString(74, 57, STR_9816_BUILT_VALUE, 0); - SetDParam(0, _cargoc.names_long_p[v->cargo_type]); + SetDParam(0, _cargoc.names_long[v->cargo_type]); SetDParam(1, v->cargo_cap); DrawString(74, 67, STR_9817_CAPACITY, 0); diff --git a/station_gui.c b/station_gui.c index 50c4c7e3e..df4d2b66e 100644 --- a/station_gui.c +++ b/station_gui.c @@ -372,7 +372,7 @@ static void DrawStationViewWindow(Window *w) if ( st->goods[i].enroute_from == station_id) { if (--pos < 0) { SetDParam(1, waiting); - SetDParam(0, _cargoc.names_long_s[i] + (waiting==1 ? 0 : 32)); + SetDParam(0, _cargoc.names_long[i]); DrawStringRightAligned(x + 234, y, STR_0009, 0); y += 10; } @@ -380,7 +380,7 @@ static void DrawStationViewWindow(Window *w) /* enroute */ if (--pos < 0) { SetDParam(1, waiting); - SetDParam(0, _cargoc.names_long_s[i] + (waiting==1 ? 0 : 32)); + SetDParam(0, _cargoc.names_long[i]); DrawStringRightAligned(x + 234, y, STR_000A_EN_ROUTE_FROM, 0); y += 10; } diff --git a/strgen/strgen.c b/strgen/strgen.c index 5cac8147c..5b3e95e5b 100644 --- a/strgen/strgen.c +++ b/strgen/strgen.c @@ -59,6 +59,9 @@ static uint32 _hash; static char _lang_name[32], _lang_ownname[32], _lang_isocode[16]; static byte _lang_pluralform; +static char _genders[8][8]; +static int _numgenders; + // for each plural value, this is the number of plural forms. static const byte _plural_form_counts[] = { 2,1,2,3,3,3,3,3,4 }; @@ -245,16 +248,28 @@ char *ParseWord(char **buf) // Forward declaration static int TranslateArgumentIdx(int arg, bool relative); +static void EmitWordList(char **words, int nw) +{ + int i,j; + + PutByte(nw); + for(i=0; icapacity != 0) { - SetDParam(0, _cargoc.names_long_p[rvi->cargo_type]); + SetDParam(0, _cargoc.names_long[rvi->cargo_type]); SetDParam(1, rvi->capacity << multihead); SetDParam(2, STR_9842_REFITTABLE); } @@ -101,7 +101,7 @@ void DrawTrainWagonPurchaseInfo(int x, int y, EngineID engine_number) y += 10; /* Cargo type + capacity */ - SetDParam(0, _cargoc.names_long_p[rvi->cargo_type]); + SetDParam(0, _cargoc.names_long[rvi->cargo_type]); SetDParam(1, rvi->capacity); SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY); DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, 0); @@ -730,7 +730,7 @@ static void RailVehicleRefitWndProc(Window *w, WindowEvent *e) int32 cost = DoCommandByTile(v->tile, v->index, WP(w,refit_d).cargo, DC_QUERY_COST, CMD_REFIT_RAIL_VEHICLE); if (!CmdFailed(cost)) { SetDParam(2, cost); - SetDParam(0, _cargoc.names_long_p[WP(w,refit_d).cargo]); + SetDParam(0, _cargoc.names_long[WP(w,refit_d).cargo]); SetDParam(1, _returned_refit_amount); DrawString(1, 137, STR_9840_NEW_CAPACITY_COST_OF_REFIT, 0); } @@ -1010,8 +1010,8 @@ static void TrainDetailsInfoTab(const Vehicle *v, int x, int y) static void TrainDetailsCapacityTab(const Vehicle *v, int x, int y) { if (v->cargo_cap != 0) { + SetDParam(0, _cargoc.names_long[v->cargo_type]); SetDParam(1, v->cargo_cap); - SetDParam(0, _cargoc.names_long_p[v->cargo_type]); DrawString(x, y, STR_013F_CAPACITY, 0); } } diff --git a/variables.h b/variables.h index 94140d9be..55502c3e2 100644 --- a/variables.h +++ b/variables.h @@ -379,8 +379,7 @@ VARDEF FILE *_log_file_fd; typedef struct { StringID names_s[NUM_CARGO]; StringID names_p[NUM_CARGO]; - StringID names_long_s[NUM_CARGO]; - StringID names_long_p[NUM_CARGO]; + StringID names_long[NUM_CARGO]; StringID names_short[NUM_CARGO]; byte weights[NUM_CARGO]; SpriteID sprites[NUM_CARGO]; -- cgit v1.2.3-70-g09d2