Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] (PR#8496) (un)load commands for gtk and xaw
Home

[Freeciv-Dev] (PR#8496) (un)load commands for gtk and xaw

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8496) (un)load commands for gtk and xaw
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 12 Apr 2004 10:47:16 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8496 >

This patch adds load and unload commands to the menus in gtk and xaw 
clients.  They have no keyboard shortcuts.

jason

Index: client/gui-gtk/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/menu.c,v
retrieving revision 1.82
diff -u -r1.82 menu.c
--- client/gui-gtk/menu.c       1 Apr 2004 23:46:25 -0000       1.82
+++ client/gui-gtk/menu.c       12 Apr 2004 17:46:36 -0000
@@ -112,6 +112,8 @@
   MENU_ORDER_SENTRY,
   MENU_ORDER_PILLAGE,
   MENU_ORDER_HOMECITY,
+  MENU_ORDER_UNLOAD_TRANSPORTER,
+  MENU_ORDER_LOAD,
   MENU_ORDER_UNLOAD,
   MENU_ORDER_WAKEUP_OTHERS,
   MENU_ORDER_AUTO_SETTLER,   /* shared with AUTO_ATTACK */
@@ -377,9 +379,15 @@
    case MENU_ORDER_HOMECITY:
     key_unit_homecity();
     break;
-   case MENU_ORDER_UNLOAD:
+  case MENU_ORDER_UNLOAD_TRANSPORTER:
     key_unit_unload_all();
     break;
+  case MENU_ORDER_LOAD:
+    request_unit_load(get_unit_in_focus(), NULL);
+    break;
+  case MENU_ORDER_UNLOAD:
+    request_unit_unload(get_unit_in_focus());
+    break;
    case MENU_ORDER_WAKEUP_OTHERS:
     key_unit_wakeup_others();
     break;
@@ -700,8 +708,12 @@
        NULL,                   0,                                      
"<Separator>"   },
   { "/" N_("Orders") "/" N_("Make _Homecity"),         "h",
        orders_menu_callback,   MENU_ORDER_HOMECITY                             
        },
-  { "/" N_("Orders") "/" N_("_Unload"),                        "u",
-       orders_menu_callback,   MENU_ORDER_UNLOAD                               
        },
+  { "/" N_("Orders") "/" N_("_Unload Transporter"),    "u",
+       orders_menu_callback,   MENU_ORDER_UNLOAD_TRANSPORTER                   
                },
+  { "/" N_("Orders") "/" N_("Load"), "",
+    orders_menu_callback, MENU_ORDER_LOAD},
+  { "/" N_("Orders") "/" N_("Unload"), "",
+    orders_menu_callback, MENU_ORDER_UNLOAD},
   { "/" N_("Orders") "/" N_("Wake up o_thers"),                "<shift>w",
        orders_menu_callback,   MENU_ORDER_WAKEUP_OTHERS                        
        },
   { "/" N_("Orders") "/sep3",                          NULL,
@@ -1135,8 +1147,14 @@
                          can_unit_do_activity(punit, ACTIVITY_PILLAGE));
       menus_set_sensitive("<main>/_Orders/Make _Homecity",
                          can_unit_change_homecity(punit));
-      menus_set_sensitive("<main>/_Orders/_Unload",
+      menus_set_sensitive("<main>/_Orders/_Unload Transporter",
                          get_transporter_capacity(punit)>0);
+      menus_set_sensitive("<main>/_Orders/Load",
+       can_unit_load(punit, find_transporter_for_unit(punit,
+                                                      punit->x, punit->y)));
+      menus_set_sensitive("<main>/_Orders/Unload",
+       (can_unit_unload(punit, find_unit_by_id(punit->transported_by))
+        && can_unit_exist_at_tile(punit, punit->x, punit->y)));
       menus_set_sensitive("<main>/_Orders/Wake up o_thers", 
                          is_unit_activity_on_tile(ACTIVITY_SENTRY,
                                                    punit->x, punit->y));
Index: client/gui-xaw/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/menu.c,v
retrieving revision 1.60
diff -u -r1.60 menu.c
--- client/gui-xaw/menu.c       1 Apr 2004 23:46:25 -0000       1.60
+++ client/gui-xaw/menu.c       12 Apr 2004 17:46:36 -0000
@@ -176,7 +176,10 @@
     { { N_("Pillage"), 0              },     "P", MENU_ORDER_PILLAGE, 0 },
     { { 0                             },      "", MENU_SEPARATOR_LINE, 0 },
     { { N_("Make Homecity"), 0        },     "h", MENU_ORDER_HOMECITY, 0 },
-    { { N_("Unload"), 0               },     "u", MENU_ORDER_UNLOAD, 0 },
+    { { N_("Unload Transporter"), 0 }, "u",
+      MENU_ORDER_UNLOAD_TRANSPORTER, 0 },
+    { { N_("Load"), 0 }, "", MENU_ORDER_LOAD, 0 },
+    { { N_("Unload"), 0 }, "", MENU_ORDER_UNLOAD, 0 },
     { { N_("Wake up others"), 0       },     "W", MENU_ORDER_WAKEUP_OTHERS, 0 
},
     { { 0                             },      "", MENU_SEPARATOR_LINE, 0 },
     { { N_("Auto Settler"), 0         },     "a", MENU_ORDER_AUTO_SETTLER, 0 },
@@ -352,8 +355,14 @@
                           can_unit_do_activity(punit, ACTIVITY_PILLAGE));
       menu_entry_sensitive(MENU_ORDER, MENU_ORDER_HOMECITY, 
                           can_unit_change_homecity(punit));
-      menu_entry_sensitive(MENU_ORDER, MENU_ORDER_UNLOAD, 
+      menu_entry_sensitive(MENU_ORDER, MENU_ORDER_UNLOAD_TRANSPORTER, 
                           get_transporter_capacity(punit)>0);
+      menu_entry_sensitive(MENU_ORDER, MENU_ORDER_LOAD,
+       can_unit_load(punit, find_transporter_for_unit(punit,
+                                                      punit->x, punit->y)));
+      menu_entry_sensitive(MENU_ORDER, MENU_ORDER_UNLOAD,
+       (can_unit_unload(punit, find_unit_by_id(punit->transported_by))
+        && can_unit_exist_at_tile(punit, punit->x, punit->y)));
       menu_entry_sensitive(MENU_ORDER, MENU_ORDER_WAKEUP_OTHERS, 
                           is_unit_activity_on_tile(ACTIVITY_SENTRY,
                                punit->x,punit->y));
@@ -630,8 +639,14 @@
   case MENU_ORDER_HOMECITY:
     key_unit_homecity();
     break;
-  case MENU_ORDER_UNLOAD:
+  case MENU_ORDER_UNLOAD_TRANSPORTER:
     key_unit_unload_all();
+    break;
+  case MENU_ORDER_LOAD:
+    request_unit_load(get_unit_in_focus(), NULL);
+    break;
+  case MENU_ORDER_UNLOAD:
+    request_unit_unload(get_unit_in_focus());
     break;
   case MENU_ORDER_WAKEUP_OTHERS:
     key_unit_wakeup_others();
Index: client/gui-xaw/menu.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/menu.h,v
retrieving revision 1.16
diff -u -r1.16 menu.h
--- client/gui-xaw/menu.h       23 Jul 2003 13:46:03 -0000      1.16
+++ client/gui-xaw/menu.h       12 Apr 2004 17:46:36 -0000
@@ -80,6 +80,8 @@
   MENU_ORDER_SENTRY,
   MENU_ORDER_PILLAGE,
   MENU_ORDER_HOMECITY,
+  MENU_ORDER_UNLOAD_TRANSPORTER,
+  MENU_ORDER_LOAD,
   MENU_ORDER_UNLOAD,
   MENU_ORDER_WAKEUP_OTHERS,
   MENU_ORDER_AUTO_SETTLER,

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#8496) (un)load commands for gtk and xaw, Jason Short <=