Author: sveinung
Date: Sun Jul 19 13:00:28 2015
New Revision: 29221

URL: http://svn.gna.org/viewcvs/freeciv?rev=29221&view=rev
Log:
Xaw client: support the "Steal Maps" spy action.

See patch #6129

Modified:
    trunk/client/gui-xaw/action_dialog.c
    trunk/data/Freeciv.in

Modified: trunk/client/gui-xaw/action_dialog.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-xaw/action_dialog.c?rev=29221&r1=29220&r2=29221&view=diff
==============================================================================
--- trunk/client/gui-xaw/action_dialog.c        (original)
+++ trunk/client/gui-xaw/action_dialog.c        Sun Jul 19 13:00:28 2015
@@ -339,6 +339,24 @@
   if (NULL != game_unit_by_number(diplomat_id)
       && NULL != game_city_by_number(diplomat_target_id[ATK_CITY])) {
     request_do_action(ACTION_SPY_STEAL_GOLD, diplomat_id,
+                      diplomat_target_id[ATK_CITY], 0, "");
+  }
+
+  choose_action_queue_next();
+}
+
+/********************************************************************
+  The player selected "Steal Maps"
+********************************************************************/
+static void spy_steal_maps_callback(Widget w, XtPointer client_data,
+                                    XtPointer call_data)
+{
+  destroy_message_dialog(w);
+  diplomat_dialog = NULL;
+
+  if (NULL != game_unit_by_number(diplomat_id)
+      && NULL != game_city_by_number(diplomat_target_id[ATK_CITY])) {
+    request_do_action(ACTION_STEAL_MAPS, diplomat_id,
                       diplomat_target_id[ATK_CITY], 0, "");
   }
 
@@ -962,6 +980,7 @@
                            capture_units_callback, 0, 0,
                            found_city_callback, 0, 0,
                            join_city_callback, 0, 0,
+                           spy_steal_maps_callback, 0, 0,
                            diplomat_keep_moving_callback, target_tile, 1,
                            diplomat_cancel_callback, 0, 0,
                            NULL);
@@ -1034,10 +1053,14 @@
                ACTION_JOIN_CITY,
                act_probs);
 
+  action_entry(XtNameToWidget(diplomat_dialog, "*button17"),
+               ACTION_STEAL_MAPS,
+               act_probs);
+
   if (!(unit_can_move_to_tile(actor_unit, target_tile, FALSE)
       || (is_military_unit(actor_unit) || is_attack_unit(actor_unit))
       || (can_unit_bombard(actor_unit) && !is_ocean_tile(target_tile)))) {
-    XtSetSensitive(XtNameToWidget(diplomat_dialog, "*button17"), FALSE);
+    XtSetSensitive(XtNameToWidget(diplomat_dialog, "*button18"), FALSE);
   }
 
   astr_free(&text);

Modified: trunk/data/Freeciv.in
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/Freeciv.in?rev=29221&r1=29220&r2=29221&view=diff
==============================================================================
--- trunk/data/Freeciv.in       (original)
+++ trunk/data/Freeciv.in       Sun Jul 19 13:00:28 2015
@@ -2327,12 +2327,15 @@
 
 Freeciv*diplomatdialog.*.button16.fromVert:  button14
 
-Freeciv*diplomatdialog.*.button17.label:     _("Keep moving")
 Freeciv*diplomatdialog.*.button17.fromVert:  button15
 Freeciv*diplomatdialog.*.button17.fromHoriz: button16
 
-Freeciv*diplomatdialog.*.button18.label:     _("Cancel")
+Freeciv*diplomatdialog.*.button18.label:     _("Keep moving")
 Freeciv*diplomatdialog.*.button18.fromVert:  button16
+
+Freeciv*diplomatdialog.*.button19.label:     _("Cancel")
+Freeciv*diplomatdialog.*.button19.fromVert:  button17
+Freeciv*diplomatdialog.*.button19.fromHoriz: button18
 
 !
 ! Spy Steal Tech Dialog


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to