Author: jtn Date: Sat Mar 14 18:04:25 2015 New Revision: 28550 URL: http://svn.gna.org/viewcvs/freeciv?rev=28550&view=rev Log: Show armistice turn count as well as ceasefire turn count in terrain info popups.
See gna bug #23303. Modified: branches/S2_4/client/gui-sdl/mapview.c branches/S2_4/client/text.c Modified: branches/S2_4/client/gui-sdl/mapview.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_4/client/gui-sdl/mapview.c?rev=28550&r1=28549&r2=28550&view=diff ============================================================================== --- branches/S2_4/client/gui-sdl/mapview.c (original) +++ branches/S2_4/client/gui-sdl/mapview.c Sat Mar 14 18:04:25 2015 @@ -563,8 +563,8 @@ if (BORDERS_DISABLED != game.info.borders && !pCity) { const char *diplo_nation_plural_adjectives[DS_LAST] = - {Q_("?nation:Neutral"), Q_("?nation:Hostile"), - "" /* unused, DS_CEASEFIRE*/, + {"" /* unused, DS_ARMISTICE */, Q_("?nation:Hostile"), + "" /* unused, DS_CEASEFIRE */, Q_("?nation:Peaceful"), Q_("?nation:Friendly"), Q_("?nation:Mysterious")}; if (tile_owner(pTile) == client.conn.playing) { @@ -574,12 +574,18 @@ struct player_diplstate *ds = player_diplstate_get(client.conn.playing, tile_owner(pTile)); - if (DS_CEASEFIRE == ds->type){ + if (DS_CEASEFIRE == ds->type) { int turns = ds->turns_left; - cat_snprintf(buffer, sizeof(buffer), - PL_("\n%s territory (%d turn ceasefire)", - "\n%s territory (%d turn ceasefire)", turns), - nation_adjective_for_player(tile_owner(pTile)), turns); + cat_snprintf(buffer, sizeof(buffer), + PL_("\n%s territory (%d turn ceasefire)", + "\n%s territory (%d turn ceasefire)", turns), + nation_adjective_for_player(tile_owner(pTile)), turns); + } else if (DS_ARMISTICE == ds->type) { + int turns = ds->turns_left; + cat_snprintf(buffer, sizeof(buffer), + PL_("\n%s territory (%d turn armistice)", + "\n%s territory (%d turn armistice)", turns), + nation_adjective_for_player(tile_owner(pTile)), turns); } else { cat_snprintf(buffer, sizeof(buffer), _("\nTerritory of the %s %s"), diplo_nation_plural_adjectives[ds->type], @@ -597,8 +603,8 @@ struct player *pOwner = city_owner(pCity); /* bool barrack = FALSE, airport = FALSE, port = FALSE;*/ const char *diplo_city_adjectives[DS_LAST] = - {Q_("?city:Neutral"), Q_("?city:Hostile"), - "" /*unused, DS_CEASEFIRE */, Q_("?city:Peaceful"), + {Q_("?city:Neutral"), Q_("?city:Hostile"), + Q_("?city:Neutral"), Q_("?city:Peaceful"), Q_("?city:Friendly"), Q_("?city:Mysterious")}; cat_snprintf(buffer, sizeof(buffer), Modified: branches/S2_4/client/text.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_4/client/text.c?rev=28550&r1=28549&r2=28550&view=diff ============================================================================== --- branches/S2_4/client/text.c (original) +++ branches/S2_4/client/text.c Sat Mar 14 18:04:25 2015 @@ -138,13 +138,13 @@ struct city *pcity = tile_city(ptile); struct unit *punit = find_visible_unit(ptile); const char *diplo_nation_plural_adjectives[DS_LAST] = - {Q_("?nation:Neutral"), Q_("?nation:Hostile"), - Q_("?nation:Neutral"), + {"" /* unused, DS_ARMISTICE */, Q_("?nation:Hostile"), + "" /* unused, DS_CEASEFIRE */, Q_("?nation:Peaceful"), Q_("?nation:Friendly"), Q_("?nation:Mysterious"), Q_("?nation:Friendly(team)")}; const char *diplo_city_adjectives[DS_LAST] = - {Q_("?city:Neutral"), Q_("?city:Hostile"), - Q_("?nation:Neutral"), + {"" /* unused, DS_ARMISTICE */, Q_("?city:Hostile"), + "" /* unused, DS_CEASEFIRE */, Q_("?city:Peaceful"), Q_("?city:Friendly"), Q_("?city:Mysterious"), Q_("?city:Friendly(team)")}; static struct astring str = ASTRING_INIT; @@ -195,6 +195,16 @@ "Territory of %s (%s) (%d turn cease-fire)", turns), username, nation, turns); + } else if (ds->type == DS_ARMISTICE) { + int turns = ds->turns_left; + + astr_add_line(&str, + /* TRANS: "Territory of <username> (<nation + team>) + * (<number> turn armistice)" */ + PL_("Territory of %s (%s) (%d turn armistice)", + "Territory of %s (%s) (%d turn armistice)", + turns), + username, nation, turns); } else { int type = ds->type; @@ -232,6 +242,15 @@ * (<nation + team>, <number> turn cease-fire)" */ astr_add_line(&str, PL_("City: %s | %s (%s, %d turn cease-fire)", "City: %s | %s (%s, %d turn cease-fire)", + turns), + city_name(pcity), username, nation, turns); + } else if (ds->type == DS_ARMISTICE) { + int turns = ds->turns_left; + + /* TRANS: "City: <city name> | <username> + * (<nation + team>, <number> turn armistice)" */ + astr_add_line(&str, PL_("City: %s | %s (%s, %d turn armistice)", + "City: %s | %s (%s, %d turn armistice)", turns), city_name(pcity), username, nation, turns); } else { @@ -330,6 +349,16 @@ * <number> turn cease-fire)" */ astr_add_line(&str, PL_("Unit: %s | %s (%s, %d turn cease-fire)", "Unit: %s | %s (%s, %d turn cease-fire)", + turns), + utype_name_translation(ptype), + username, nation, turns); + } else if (ds->type == DS_ARMISTICE) { + int turns = ds->turns_left; + + /* TRANS: "Unit: <unit type> | <username> (<nation + team>, + * <number> turn armistice)" */ + astr_add_line(&str, PL_("Unit: %s | %s (%s, %d turn armistice)", + "Unit: %s | %s (%s, %d turn armistice)", turns), utype_name_translation(ptype), username, nation, turns); _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits