<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39385 >
Here is a preliminary patch. I don't know the code around this, but it seems to be well designed, so this should be all there is to it. It is a patch to client/cityrepdata.c in the S2_1 branch and it builds fine and seems to work Displays 0 when already bought.
Index: cityrepdata.c =================================================================== --- cityrepdata.c (revision 12955) +++ cityrepdata.c (arbetskopia) @@ -409,6 +409,14 @@ return buf; } +static const char *cr_entry_buy_cost(const struct city *pcity, + const void *data) +{ + static char buf[8]; + my_snprintf(buf, sizeof(buf), "%4d", city_buy_cost(pcity)); + return buf; +} + static const char *cr_entry_cma(const struct city *pcity, const void *data) { @@ -492,6 +500,8 @@ NULL, FUNC_TAG(waste) }, { TRUE, 15, 1, NULL, N_("?cma:Governor"), N_("Citizen Governor"), NULL, FUNC_TAG(cma) }, + { FALSE, 3, 1, NULL, N_("?buy:Cost"), N_("Buy Cost"), + NULL, FUNC_TAG(buy_cost) }, { TRUE, 0, 1, N_("Currently Building"), N_("(Stock,Target,Turns,Buy)"), N_("Currently Building"), NULL, FUNC_TAG(building) }
_______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev