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

« back to all changes in this revision

Viewing changes to client/gui-sdl/menu.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:
30
30
#include "log.h"
31
31
 
32
32
/* common */
 
33
#include "game.h"
33
34
#include "unitlist.h"
34
35
 
35
36
/* client */
36
 
#include "civclient.h" /* client_state */
 
37
#include "client_main.h" /* client_state */
37
38
#include "control.h"
38
39
 
39
40
/* gui-sdl */
100
101
    case ID_UNIT_ORDER_ROAD:
101
102
      key_unit_road();
102
103
      break;
103
 
    case ID_UNIT_ORDER_TRADEROUTE:
104
 
      key_unit_traderoute();
 
104
    case ID_UNIT_ORDER_TRADE_ROUTE:
 
105
      key_unit_trade_route();
105
106
      break;
106
107
    case ID_UNIT_ORDER_IRRIGATE:
107
108
      key_unit_irrigate();
370
371
  
371
372
  /* No orders */
372
373
  /* TRANS: keyboard */
373
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("No orders"), _("Space"));
 
374
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("No Orders"), _("Space"));
374
375
  pBuf = create_themeicon(pTheme->ODone_Icon, Main.gui,
375
376
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
376
377
                           WF_WIDGET_HAS_INFO_LABEL));
409
410
  /* --------- */
410
411
 
411
412
  /* Diplomat|Spy Actions */
412
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Diplomat|Spy Actions"), "D");
 
413
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Diplomat/Spy Actions"), "D");
413
414
  pBuf = create_themeicon(pTheme->OSpy_Icon, Main.gui,
414
415
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
415
416
                           WF_WIDGET_HAS_INFO_LABEL));
421
422
  /* --------- */
422
423
 
423
424
  /* Disband */
424
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Disband"), "Shift+D");
 
425
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Disband Unit"), "Shift+D");
425
426
  pBuf = create_themeicon(pTheme->ODisband_Icon, Main.gui,
426
427
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
427
428
                           WF_WIDGET_HAS_INFO_LABEL));
434
435
  /* --------- */  
435
436
 
436
437
  /* Upgrade */
437
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Upgrade"), "Ctrl+U");
 
438
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Upgrade Unit"), "Shift+U");
438
439
  pBuf = create_themeicon(pTheme->Order_Icon, Main.gui,
439
440
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
440
441
                           WF_WIDGET_HAS_INFO_LABEL));
442
443
  pBuf->action = unit_order_callback;
443
444
  pBuf->string16 = create_str16_from_char(cBuf, adj_font(10));
444
445
  pBuf->key = SDLK_u;
445
 
  pBuf->mod = KMOD_CTRL;
 
446
  pBuf->mod = KMOD_SHIFT;
446
447
  add_to_gui_list(ID_UNIT_ORDER_UPGRADE, pBuf);
447
448
  /* --------- */
448
449
 
449
450
  /* Return to nearest city */
450
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Return to nearest city"), "Shift+G");
 
451
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Return to Nearest City"), "Shift+G");
451
452
  pBuf = create_themeicon(pTheme->OReturn_Icon, Main.gui,
452
453
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
453
454
                           WF_WIDGET_HAS_INFO_LABEL));
460
461
  /* --------- */
461
462
  
462
463
  /* Goto City */
463
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Goto City"), "Ctrl+G");
 
464
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Go to City"), "T");
464
465
  pBuf = create_themeicon(pTheme->OGotoCity_Icon, Main.gui,
465
466
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
466
467
                           WF_WIDGET_HAS_INFO_LABEL));
467
468
  set_wstate(pBuf, FC_WS_NORMAL);
468
469
  pBuf->action = unit_order_callback;
469
470
  pBuf->string16 = create_str16_from_char(cBuf, adj_font(10));
470
 
  pBuf->mod = KMOD_CTRL;
471
 
  pBuf->key = SDLK_l;
 
471
  pBuf->key = SDLK_t;
472
472
  add_to_gui_list(ID_UNIT_ORDER_GOTO_CITY, pBuf);
473
473
  /* --------- */
474
474
 
475
475
  /* Airlift */
476
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Airlift"), "Shift+L");
 
476
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Airlift to City"), "T");
477
477
  pBuf = create_themeicon(pTheme->Order_Icon, Main.gui,
478
478
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
479
479
                           WF_WIDGET_HAS_INFO_LABEL));
480
480
  set_wstate(pBuf, FC_WS_NORMAL);
481
481
  pBuf->action = unit_order_callback;
482
482
  pBuf->string16 = create_str16_from_char(cBuf, adj_font(10));
483
 
  pBuf->mod = KMOD_SHIFT;
484
 
  pBuf->key = SDLK_l;
 
483
  pBuf->key = SDLK_t;
485
484
  add_to_gui_list(ID_UNIT_ORDER_AIRLIFT, pBuf);
486
485
  /* --------- */
487
486
  
488
487
  /* Goto location */
489
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Goto location"), "G");
 
488
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Go to Tile"), "G");
490
489
  pBuf = create_themeicon(pTheme->OGoto_Icon, Main.gui,
491
490
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
492
491
                           WF_WIDGET_HAS_INFO_LABEL));
510
509
  /* --------- */
511
510
 
512
511
  /* Connect irrigation */
513
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Connect irrigation"), "Ctrl+Shift+I");
 
512
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Connect With Irrigation"), "Shift+I");
514
513
  pBuf = create_themeicon(pTheme->OAutoConnect_Icon, Main.gui,
515
514
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
516
515
                           WF_WIDGET_HAS_INFO_LABEL));
518
517
  pBuf->action = unit_order_callback;
519
518
  pBuf->string16 = create_str16_from_char(cBuf, adj_font(10));
520
519
  pBuf->key = SDLK_i;
521
 
  pBuf->mod = KMOD_CTRL | KMOD_SHIFT;
 
520
  pBuf->mod = KMOD_SHIFT;
522
521
  add_to_gui_list(ID_UNIT_ORDER_CONNECT_IRRIGATE, pBuf);
523
522
  /* --------- */
524
523
 
525
524
  /* Connect road */
526
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Connect road"), "Ctrl+Shift+R");
 
525
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Connect With Road"), "Shift+R");
527
526
  pBuf = create_themeicon(pTheme->OAutoConnect_Icon, Main.gui,
528
527
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
529
528
                           WF_WIDGET_HAS_INFO_LABEL));
531
530
  pBuf->action = unit_order_callback;
532
531
  pBuf->string16 = create_str16_from_char(cBuf, adj_font(10));
533
532
  pBuf->key = SDLK_r;
534
 
  pBuf->mod = KMOD_CTRL | KMOD_SHIFT;
 
533
  pBuf->mod = KMOD_SHIFT;
535
534
  add_to_gui_list(ID_UNIT_ORDER_CONNECT_ROAD, pBuf);
536
535
  /* --------- */
537
536
 
538
537
  /* Connect railroad */
539
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Connect railroad"), "Ctrl+Shift+L");
 
538
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Connect With Rail"), "Shift+L");
540
539
  pBuf = create_themeicon(pTheme->OAutoConnect_Icon, Main.gui,
541
540
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
542
541
                           WF_WIDGET_HAS_INFO_LABEL));
544
543
  pBuf->action = unit_order_callback;
545
544
  pBuf->string16 = create_str16_from_char(cBuf, adj_font(10));
546
545
  pBuf->key = SDLK_l;
547
 
  pBuf->mod = KMOD_CTRL | KMOD_SHIFT;
 
546
  pBuf->mod = KMOD_SHIFT;
548
547
  add_to_gui_list(ID_UNIT_ORDER_CONNECT_RAILROAD, pBuf);
549
548
  /* --------- */
550
549
 
551
550
  /* Auto-Explore */
552
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Auto-Explore"), "X");
 
551
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Auto Explore"), "X");
553
552
  pBuf = create_themeicon(pTheme->OAutoExp_Icon, Main.gui,
554
553
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
555
554
                           WF_WIDGET_HAS_INFO_LABEL));
562
561
  /* --------- */
563
562
 
564
563
  /* Auto-Attack / Auto-Settler */
565
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Auto-Attack"), "A");
 
564
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Auto Attack"), "A");
566
565
  len = strlen(cBuf);
567
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Auto-Settler"), "A");
 
566
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Auto Settler"), "A");
568
567
  len = MAX(len, strlen(cBuf));
569
568
  
570
569
  pBuf = create_themeicon(pTheme->OAutoSett_Icon, Main.gui,
583
582
  /* --------- */    
584
583
  
585
584
  /* Wake Up Others */
586
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Wake Up Others"), "Shift+W");
 
585
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Unsentry All On Tile"), "Shift+S");
587
586
  pBuf = create_themeicon(pTheme->OWakeUp_Icon, Main.gui,
588
587
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
589
588
                           WF_WIDGET_HAS_INFO_LABEL));
590
589
  set_wstate(pBuf, FC_WS_NORMAL);
591
590
  pBuf->action = unit_order_callback;
592
591
  pBuf->string16 = create_str16_from_char(cBuf, adj_font(10));
593
 
  pBuf->key = SDLK_w;
 
592
  pBuf->key = SDLK_s;
594
593
  pBuf->mod = KMOD_SHIFT;
595
594
  add_to_gui_list(ID_UNIT_ORDER_WAKEUP_OTHERS, pBuf);
596
595
  /* --------- */
597
596
 
598
597
  /* Unload */
599
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Unload Transporter"), "Shift+U");
 
598
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Unload All From Transporter"), "Shift+T");
600
599
  pBuf = create_themeicon(pTheme->OUnload_Icon, Main.gui,
601
600
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
602
601
                           WF_WIDGET_HAS_INFO_LABEL));
604
603
  pBuf->action = unit_order_callback;
605
604
  pBuf->string16 = create_str16_from_char(cBuf, adj_font(10));
606
605
  pBuf->mod = KMOD_SHIFT;
607
 
  pBuf->key = SDLK_u;
 
606
  pBuf->key = SDLK_t;
608
607
  add_to_gui_list(ID_UNIT_ORDER_UNLOAD_TRANSPORTER, pBuf);
609
608
  /* --------- */
610
609
 
611
610
  /* Load */
612
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Load"), "L");
 
611
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Load Unit"), "L");
613
612
  pBuf = create_themeicon(pTheme->OLoad_Icon, Main.gui,
614
613
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
615
614
                           WF_WIDGET_HAS_INFO_LABEL));
621
620
  /* --------- */
622
621
 
623
622
  /* Unload */
624
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Unload"), "U");
 
623
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Unload Unit"), "U");
625
624
  pBuf = create_themeicon(pTheme->OUnload_Icon, Main.gui,
626
625
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
627
626
                           WF_WIDGET_HAS_INFO_LABEL));
633
632
  /* --------- */
634
633
 
635
634
  /* Find Homecity */
636
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Find Homecity"), "H");
 
635
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Find Home City"), "H");
637
636
  pBuf = create_themeicon(pTheme->OHomeCity_Icon, Main.gui,
638
637
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
639
638
                           WF_WIDGET_HAS_INFO_LABEL));
658
657
  /* --------- */
659
658
 
660
659
  /* Sentry */
661
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Sentry"), "S");
 
660
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Sentry Unit"), "S");
662
661
  pBuf = create_themeicon(pTheme->OSentry_Icon, Main.gui,
663
662
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
664
663
                           WF_WIDGET_HAS_INFO_LABEL));
682
681
  /* --------- */
683
682
 
684
683
  /* Paradrop */
685
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Paradrop"), "P");
 
684
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Drop Paratrooper"), "P");
686
685
  pBuf = create_themeicon(pTheme->OParaDrop_Icon, Main.gui,
687
686
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
688
687
                           WF_WIDGET_HAS_INFO_LABEL));
718
717
  /* --------- */
719
718
 
720
719
  /* Fortify */
721
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Fortify"), "F");
 
720
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Fortify Unit"), "F");
722
721
  pBuf = create_themeicon(pTheme->OFortify_Icon, Main.gui,
723
722
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
724
723
                           WF_WIDGET_HAS_INFO_LABEL));
782
781
  pOrder_Irrigation_Button = pBuf;
783
782
  /* --------- */    
784
783
 
785
 
  /* Form Traderoute */
786
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Form Traderoute"), "R");
 
784
  /* Form Trade route */
 
785
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Establish Trade Route"), "R");
787
786
  pBuf = create_themeicon(pTheme->OTrade_Icon, Main.gui,
788
787
                          (WF_HIDDEN | WF_RESTORE_BACKGROUND |
789
788
                           WF_WIDGET_HAS_INFO_LABEL));
791
790
  pBuf->action = unit_order_callback;
792
791
  pBuf->string16 = create_str16_from_char(cBuf, adj_font(10));
793
792
  pBuf->key = SDLK_r;
794
 
  add_to_gui_list(ID_UNIT_ORDER_TRADEROUTE, pBuf);
 
793
  add_to_gui_list(ID_UNIT_ORDER_TRADE_ROUTE, pBuf);
795
794
 
796
795
  pOrder_Trade_Button = pBuf;
797
796
  /* --------- */    
836
835
  /* Add to City / Build New City */
837
836
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Add to City"), "B");
838
837
  len = strlen(cBuf);
839
 
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Build New City"), "B");
 
838
  my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Build City"), "B");
840
839
  len = MAX(len, strlen(cBuf));
841
840
      
842
841
  pBuf = create_themeicon(pTheme->OBuildCity_Icon, Main.gui,
949
948
      hide_group(pBeginOrderWidgetList, pEndOrderWidgetList);
950
949
    }
951
950
 
952
 
  } else if (!game.player_ptr) {
 
951
  } else if (NULL == client.conn.playing) {
953
952
    
954
953
    /* running state, but AI is playing */
955
954
    
1002
1001
      struct city *pHomecity;
1003
1002
      int time;
1004
1003
      struct tile *pTile = pUnit->tile;
 
1004
      struct city *pCity = tile_city(pTile);
 
1005
      struct terrain *pTerrain = tile_terrain(pTile);
 
1006
      struct base_type *pbase;
1005
1007
      
1006
1008
      if (!counter) {
1007
1009
        local_show(ID_UNIT_ORDER_GOTO);
1015
1017
       * get an eventual error message from the server if we try. */
1016
1018
 
1017
1019
      if (can_unit_add_or_build_city(pUnit)) {
1018
 
        if(pTile->city) {
 
1020
        if(pCity) {
1019
1021
          my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Add to City"), "B");
1020
1022
        } else {
1021
 
          my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Build New City"), "B");
 
1023
          my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Build City"), "B");
1022
1024
        }
1023
1025
        copy_chars_to_string16(pOrder_Build_AddTo_City_Button->string16, cBuf);
1024
1026
        clear_wflag(pOrder_Build_AddTo_City_Button, WF_HIDDEN);
1053
1055
        set_wflag(pOrder_Road_Button, WF_HIDDEN);
1054
1056
      }
1055
1057
      
1056
 
        /* unit_can_est_traderoute_here(pUnit) */
1057
 
      if (pTile->city && unit_has_type_flag(pUnit, F_TRADE_ROUTE)
 
1058
        /* unit_can_est_trade_route_here(pUnit) */
 
1059
      if (pCity && unit_has_type_flag(pUnit, F_TRADE_ROUTE)
1058
1060
        && (pHomecity = game_find_city_by_number(pUnit->homecity))
1059
 
        && can_cities_trade(pHomecity, pTile->city)) {
1060
 
        int revenue = get_caravan_enter_city_trade_bonus(pHomecity, pTile->city);
 
1061
        && can_cities_trade(pHomecity, pCity)) {
 
1062
        int revenue = get_caravan_enter_city_trade_bonus(pHomecity, pCity);
1061
1063
        
1062
 
        if (can_establish_trade_route(pHomecity, pTile->city)) {
 
1064
        if (can_establish_trade_route(pHomecity, pCity)) {
1063
1065
          my_snprintf(cBuf, sizeof(cBuf),
1064
 
                      _("Form Traderoute with %s ( %d R&G + %d trade ) (R)"),
 
1066
                      _("Establish Trade Route With %s ( %d R&G + %d trade ) (R)"),
1065
1067
                      city_name(pHomecity),
1066
1068
                      revenue,
1067
 
                      trade_between_cities(pHomecity, pTile->city));
 
1069
                      trade_between_cities(pHomecity, pCity));
1068
1070
        } else {
1069
1071
          revenue = (revenue + 2) / 3;
1070
1072
          my_snprintf(cBuf, sizeof(cBuf),
1071
 
                      _("Trade with %s ( %d R&G bonus ) (R)"),
 
1073
                      _("Trade With %s ( %d R&G bonus ) (R)"),
1072
1074
                      city_name(pHomecity),
1073
1075
                      revenue);
1074
1076
        }
1081
1083
      if (can_unit_do_activity(pUnit, ACTIVITY_IRRIGATE)) {
1082
1084
        time = tile_activity_time(ACTIVITY_IRRIGATE, pUnit->tile);
1083
1085
 
1084
 
        if (!strcmp(terrain_rule_name(pTile->terrain), "Forest") ||
1085
 
          !strcmp(terrain_rule_name(pTile->terrain), "Jungle")) {
 
1086
        if (!strcmp(terrain_rule_name(pTerrain), "Forest") ||
 
1087
          !strcmp(terrain_rule_name(pTerrain), "Jungle")) {
1086
1088
          /* set Crop Forest Icon */
1087
1089
          my_snprintf(cBuf, sizeof(cBuf),"%s %s (%s) %d %s",
1088
1090
                        _("Cut Down to"),
1089
 
                terrain_name_translation(pTile->terrain->irrigation_result)
 
1091
                terrain_name_translation(pTerrain->irrigation_result)
1090
1092
                        ,"I", time , PL_("turn", "turns", time));
1091
1093
          pOrder_Irrigation_Button->theme = pTheme->OCutDownForest_Icon;
1092
 
        }       else if (!strcmp(terrain_rule_name(pTile->terrain), "Swamp")) {
 
1094
        }       else if (!strcmp(terrain_rule_name(pTerrain), "Swamp")) {
1093
1095
          my_snprintf(cBuf, sizeof(cBuf),"%s %s (%s) %d %s",
1094
1096
                        _("Irrigate to"),
1095
 
                terrain_name_translation(pTile->terrain->irrigation_result)
 
1097
                terrain_name_translation(pTerrain->irrigation_result)
1096
1098
                        ,"I", time , PL_("turn", "turns", time));
1097
1099
          pOrder_Irrigation_Button->theme = pTheme->OIrrigation_Icon;
1098
1100
        } else {
1112
1114
      if (can_unit_do_activity(pUnit, ACTIVITY_MINE)) {
1113
1115
        time = tile_activity_time(ACTIVITY_MINE, pUnit->tile);
1114
1116
 
1115
 
   if (!strcmp(terrain_rule_name(pTile->terrain), "Forest")) {  
 
1117
        /* FIXME: THIS CODE IS WRONG */
 
1118
   if (!strcmp(terrain_rule_name(pTerrain), "Forest")) {  
1116
1119
          /* set Irrigate Icon -> make swamp */
1117
1120
          my_snprintf(cBuf, sizeof(cBuf),"%s %s (%s) %d %s",
1118
1121
                        _("Irrigate to"),
1119
 
                        terrain_name_translation(pTile->terrain->mining_result)
 
1122
                        terrain_name_translation(pTerrain->mining_result)
1120
1123
                        ,"M", time , PL_("turn", "turns", time));
1121
1124
          pOrder_Mine_Button->theme = pTheme->OIrrigation_Icon;
1122
 
   } else if (!strcmp(terrain_rule_name(pTile->terrain), "Jungle") ||
1123
 
              !strcmp(terrain_rule_name(pTile->terrain), "Plains") ||
1124
 
              !strcmp(terrain_rule_name(pTile->terrain), "Grassland") ||
1125
 
              !strcmp(terrain_rule_name(pTile->terrain), "Swamp")) {
 
1125
   } else if (!strcmp(terrain_rule_name(pTerrain), "Jungle") ||
 
1126
              !strcmp(terrain_rule_name(pTerrain), "Plains") ||
 
1127
              !strcmp(terrain_rule_name(pTerrain), "Grassland") ||
 
1128
              !strcmp(terrain_rule_name(pTerrain), "Swamp")) {
1126
1129
          /* set Forest Icon -> plant Forrest*/
1127
1130
          my_snprintf(cBuf, sizeof(cBuf),"%s (%s) %d %s",
1128
1131
                        _("Plant Forest"), "M", time , 
1147
1150
        time = tile_activity_time(ACTIVITY_TRANSFORM, pUnit->tile);
1148
1151
        my_snprintf(cBuf, sizeof(cBuf),"%s %s (%s) %d %s",
1149
1152
          _("Transform to"),
1150
 
          terrain_name_translation(pTile->terrain->transform_result),
 
1153
          terrain_name_translation(pTerrain->transform_result),
1151
1154
                        "M", time , 
1152
1155
                        PL_("turn", "turns", time));
1153
1156
        copy_chars_to_string16(pOrder_Transform_Button->string16, cBuf);
1156
1159
        set_wflag(pOrder_Transform_Button, WF_HIDDEN);
1157
1160
      }
1158
1161
 
1159
 
      if (!pTile->city && can_unit_do_activity(pUnit, ACTIVITY_FORTRESS)) {
 
1162
      pbase = get_base_by_gui_type(BASE_GUI_FORTRESS, pUnit, pUnit->tile);
 
1163
      if (!pCity && pbase) {
1160
1164
        local_show(ID_UNIT_ORDER_FORTRESS);
1161
1165
      } else {
1162
1166
        local_hide(ID_UNIT_ORDER_FORTRESS);
1168
1172
        local_hide(ID_UNIT_ORDER_FORTIFY);
1169
1173
      }
1170
1174
 
1171
 
      if (!pTile->city && can_unit_do_activity(pUnit, ACTIVITY_AIRBASE)) {
 
1175
      pbase = get_base_by_gui_type(BASE_GUI_AIRBASE, pUnit, pUnit->tile);
 
1176
      if (!pCity && pbase) {
1172
1177
        local_show(ID_UNIT_ORDER_AIRBASE);
1173
1178
      } else {
1174
1179
        local_hide(ID_UNIT_ORDER_AIRBASE);
1204
1209
        local_hide(ID_UNIT_ORDER_PILLAGE);
1205
1210
      }
1206
1211
 
1207
 
      if (pTile->city && can_unit_change_homecity(pUnit)
1208
 
        && pTile->city->id != pUnit->homecity) {
 
1212
      if (pCity && can_unit_change_homecity(pUnit)
 
1213
        && pCity->id != pUnit->homecity) {
1209
1214
        local_show(ID_UNIT_ORDER_HOMECITY);
1210
1215
      } else {
1211
1216
        local_hide(ID_UNIT_ORDER_HOMECITY);
1238
1243
      if (can_unit_do_autosettlers(pUnit)) {
1239
1244
        if (unit_has_type_flag(pUnit, F_SETTLERS)) {
1240
1245
          if(pOrder_Automate_Unit_Button->theme != pTheme->OAutoSett_Icon) {
1241
 
            my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Auto-Settler"), "A");
 
1246
            my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Auto Settler"), "A");
1242
1247
            pOrder_Automate_Unit_Button->theme = pTheme->OAutoSett_Icon;
1243
1248
            copy_chars_to_string16(pOrder_Automate_Unit_Button->string16, cBuf);
1244
1249
          }
1245
1250
        } else {
1246
1251
          if(pOrder_Automate_Unit_Button->theme != pTheme->OAutoAtt_Icon) {
1247
 
            my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Auto-Attack"), "A");
 
1252
            my_snprintf(cBuf, sizeof(cBuf),"%s (%s)", _("Auto Attack"), "A");
1248
1253
            pOrder_Automate_Unit_Button->theme = pTheme->OAutoAtt_Icon;
1249
1254
            copy_chars_to_string16(pOrder_Automate_Unit_Button->string16, cBuf);
1250
1255
          }
1291
1296
        local_hide(ID_UNIT_ORDER_NUKE);
1292
1297
      }
1293
1298
 
1294
 
/*      if (pTile->city && has_city_airport(pTile->city) && pTile->city->airlift) {*/
1295
 
      if (pTile->city && pTile->city->airlift) {      
 
1299
/*      if (pCity && has_city_airport(pCity) && pCity->airlift) {*/
 
1300
      if (pCity && pCity->airlift) {      
1296
1301
        local_show(ID_UNIT_ORDER_AIRLIFT);
1297
1302
        hide(ID_UNIT_ORDER_GOTO_CITY);
1298
1303
      } else {
1300
1305
        local_hide(ID_UNIT_ORDER_AIRLIFT);
1301
1306
      }
1302
1307
 
1303
 
      if (pTile->city && can_upgrade_unittype(game.player_ptr, unit_type(pUnit))) {
 
1308
      if (pCity && can_upgrade_unittype(client.conn.playing, unit_type(pUnit))) {
1304
1309
        local_show(ID_UNIT_ORDER_UPGRADE);
1305
1310
      } else {
1306
1311
        local_hide(ID_UNIT_ORDER_UPGRADE);