~ubuntu-branches/debian/squeeze/freeciv/squeeze

« back to all changes in this revision

Viewing changes to client/gui-ftwl/gui_text.c

  • Committer: Bazaar Package Importer
  • Author(s): Clint Adams, Karl Goetz, Clint Adams
  • Date: 2010-02-23 22:09:02 UTC
  • mfrom: (1.2.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20100223220902-kiyrmr9i4152cka5
Tags: 2.2.0-1
[ Karl Goetz ]
* Remove civserver files in /etc/ggzd/ (Closes: 523772, 517787)
* Adding ${misc:Depends} to all binary packages (lintian warnings)

[ Clint Adams ]
* New upstream version.
  - Drop data_dsc_use_bindir.diff (binary pathnames have changed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <stdarg.h>
21
21
#include <string.h>
22
22
 
 
23
/* utility */
23
24
#include "fcintl.h"
24
25
#include "log.h"
25
26
#include "support.h"
26
27
 
 
28
/* common */
27
29
#include "map.h"
28
30
#include "combat.h"
29
31
#include "government.h"
30
32
 
 
33
/* client */
31
34
#include "climisc.h"
32
 
#include "civclient.h"
 
35
#include "client_main.h"
33
36
#include "control.h"
34
37
#include "goto.h"
35
38
#include "text.h"
144
147
#ifdef DEBUG
145
148
  add_line(_("Location: (%d, %d) [%d]"),
146
149
           TILE_XY(ptile),
147
 
           ptile->continent);
148
 
#endif
149
 
  add_line("%s", tile_get_info_text(ptile));
 
150
           tile_continent(ptile));
 
151
#endif /* DEBUG */
 
152
  add_line("%s", tile_get_info_text(ptile, 0));
150
153
  if (count > 0) {
151
154
    add_line("%s",
152
 
             get_infrastructure_text(infrastructure));
 
155
             get_infrastructure_text(infrastructure, ptile->bases));
153
156
  }
154
157
  RETURN;
155
158
}
162
165
{
163
166
  struct tile backup = *ptile;
164
167
  int stats_before[3], stats_after[3];
 
168
  /* FIXME: use output_type_iterate! */
165
169
 
166
 
  stats_before[0] = get_output_tile(ptile, O_FOOD);
167
 
  stats_before[1] = get_output_tile(ptile, O_SHIELD);
168
 
  stats_before[2] = get_output_tile(ptile, O_TRADE);
 
170
  stats_before[0] = city_tile_output(NULL, ptile, FALSE, O_FOOD);
 
171
  stats_before[1] = city_tile_output(NULL, ptile, FALSE, O_SHIELD);
 
172
  stats_before[2] = city_tile_output(NULL, ptile, FALSE, O_TRADE);
169
173
 
170
174
  /* BEWARE UGLY HACK AHEAD */
171
175
 
181
185
    assert(0);
182
186
  }
183
187
 
184
 
  stats_after[0] = get_output_tile(ptile, O_FOOD);
185
 
  stats_after[1] = get_output_tile(ptile, O_SHIELD);
186
 
  stats_after[2] = get_output_tile(ptile, O_TRADE);
 
188
  stats_after[0] = city_tile_output(NULL, ptile, FALSE, O_FOOD);
 
189
  stats_after[1] = city_tile_output(NULL, ptile, FALSE, O_SHIELD);
 
190
  stats_after[2] = city_tile_output(NULL, ptile, FALSE, O_TRADE);
187
191
 
188
192
  ptile->terrain = backup.terrain;
189
193
  ptile->special = backup.special;
297
301
    add_line(_("Effect: the computer performs settler activities"));
298
302
  } else {
299
303
#if 0
300
 
  ttype = punit->tile->terrain;
 
304
  ttype = tile_terrain(punit->tile);
301
305
  tinfo = terrain_by_number(ttype);
302
306
  if ((tinfo->irrigation_result != T_LAST)
303
307
      && (tinfo->irrigation_result != ttype)) {
304
308
    my_snprintf(irrtext, sizeof(irrtext), irrfmt,
305
309
                terrain_name_translation(tinfo->irrigation_result));
306
310
  } else if (tile_has_special(punit->tile, S_IRRIGATION)
307
 
             && player_knows_techs_with_flag(game.player_ptr, TF_FARMLAND)) {
 
311
             && player_knows_techs_with_flag(client.conn.playing, TF_FARMLAND)) {
308
312
    sz_strlcpy(irrtext, _("Bu_ild Farmland"));
309
313
  }
310
314
  if ((tinfo->mining_result != T_LAST) && (tinfo->mining_result != ttype)) {
323
327
#endif
324
328
    add_line("tooltip for action %s isn't written yet",
325
329
             action);
326
 
    freelog(LOG_NORMAL, "warning: get_unit_action_tooltip: unknown action %s",
 
330
    freelog(LOG_VERBOSE,
 
331
            "warning: get_unit_action_tooltip: unknown action %s",
327
332
            action);
328
333
  }
329
334
  RETURN;
339
344
  INIT;
340
345
 
341
346
  if (strcmp(action, "city_buy") == 0) {
342
 
    const char *name;
343
 
 
344
 
    if (pcity->production.is_unit) {
345
 
      name = utype_name_translation(utype_by_number(pcity->production.value));
346
 
    } else {
347
 
      name = get_impr_name_ex(pcity, pcity->production.value);
348
 
    }
349
 
 
350
347
    add_line(_("Buy production"));
351
348
    add_line(_("Cost: %d (%d in treasury)"),
352
 
             city_buy_cost(pcity), game.player_ptr->economic.gold);
353
 
    add_line(_("Producting: %s (%d turns)"), name,
354
 
             city_turns_to_build(pcity, pcity->production, TRUE));
 
349
             city_production_buy_gold_cost(pcity),
 
350
             client.conn.playing->economic.gold);
 
351
    add_line(_("Producting: %s (%d turns)"),
 
352
             city_production_name_translation(pcity),
 
353
             city_production_turns_to_build(pcity, TRUE));
355
354
  } else {
356
355
    add_line("tooltip for action %s isn't written yet", action);
357
 
    freelog(LOG_NORMAL,
 
356
    freelog(LOG_VERBOSE,
358
357
            "warning: get_city_action_tooltip: unknown action %s", action);
359
358
  }
360
359
  RETURN;
395
394
{
396
395
  struct unit_type *ptype = unit_type(punit);
397
396
  struct city *pcity =
398
 
      player_find_city_by_id(game.player_ptr, punit->homecity);
 
397
      player_find_city_by_id(client.conn.playing, punit->homecity);
399
398
  INIT;
400
399
 
401
400
  add("%s", utype_name_translation(ptype));
427
426
    struct player *owner = unit_owner(punit);
428
427
    struct unit_type *ptype = unit_type(punit);
429
428
 
430
 
    if (owner == game.player_ptr) {
 
429
    if (owner == client.conn.playing) {
431
430
      struct city *pcity = player_find_city_by_id(owner, punit->homecity);
432
431
 
433
432
      if (pcity){