Author: sveinung
Date: Tue Jul  7 13:34:55 2015
New Revision: 29199

URL: http://svn.gna.org/viewcvs/freeciv?rev=29199&view=rev
Log:
SDL clients: support the "Steal Maps" spy action.

See patch #6122

Modified:
    trunk/client/gui-sdl/action_dialog.c
    trunk/client/gui-sdl2/action_dialog.c

Modified: trunk/client/gui-sdl/action_dialog.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl/action_dialog.c?rev=29199&r1=29198&r2=29199&view=diff
==============================================================================
--- trunk/client/gui-sdl/action_dialog.c        (original)
+++ trunk/client/gui-sdl/action_dialog.c        Tue Jul  7 13:34:55 2015
@@ -231,6 +231,28 @@
         && NULL != game_city_by_number(
           pDiplomat_Dlg->target_ids[ATK_CITY])) {
       request_do_action(ACTION_SPY_STEAL_GOLD,
+                        pDiplomat_Dlg->actor_unit_id,
+                        pDiplomat_Dlg->target_ids[ATK_CITY],
+                        0, "");
+    }
+
+    popdown_diplomat_dialog();
+    choose_action_queue_next();
+  }
+
+  return -1;
+}
+
+/********************************************************************
+  User clicked "Steal Maps"
+********************************************************************/
+static int spy_steal_maps_callback(struct widget *pWidget)
+{
+  if (Main.event.button.button == SDL_BUTTON_LEFT) {
+    if (NULL != game_unit_by_number(pDiplomat_Dlg->actor_unit_id)
+        && NULL != game_city_by_number(
+          pDiplomat_Dlg->target_ids[ATK_CITY])) {
+      request_do_action(ACTION_STEAL_MAPS,
                         pDiplomat_Dlg->actor_unit_id,
                         pDiplomat_Dlg->target_ids[ATK_CITY],
                         0, "");
@@ -784,6 +806,7 @@
   [ACTION_SPY_INVESTIGATE_CITY] = diplomat_investigate_callback,
   [ACTION_SPY_POISON] = spy_poison_callback,
   [ACTION_SPY_STEAL_GOLD] = spy_steal_gold_callback,
+  [ACTION_STEAL_MAPS] = spy_steal_maps_callback,
   [ACTION_SPY_SABOTAGE_CITY] = diplomat_sabotage_callback,
   [ACTION_SPY_TARGETED_SABOTAGE_CITY] = spy_sabotage_request,
   [ACTION_SPY_STEAL_TECH] = diplomat_steal_callback,

Modified: trunk/client/gui-sdl2/action_dialog.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl2/action_dialog.c?rev=29199&r1=29198&r2=29199&view=diff
==============================================================================
--- trunk/client/gui-sdl2/action_dialog.c       (original)
+++ trunk/client/gui-sdl2/action_dialog.c       Tue Jul  7 13:34:55 2015
@@ -233,6 +233,28 @@
         && NULL != game_city_by_number(
           pDiplomat_Dlg->target_ids[ATK_CITY])) {
       request_do_action(ACTION_SPY_STEAL_GOLD,
+                        pDiplomat_Dlg->actor_unit_id,
+                        pDiplomat_Dlg->target_ids[ATK_CITY],
+                        0, "");
+    }
+
+    popdown_diplomat_dialog();
+    choose_action_queue_next();
+  }
+
+  return -1;
+}
+
+/********************************************************************
+  User clicked "Steal Maps"
+********************************************************************/
+static int spy_steal_maps_callback(struct widget *pWidget)
+{
+  if (Main.event.button.button == SDL_BUTTON_LEFT) {
+    if (NULL != game_unit_by_number(pDiplomat_Dlg->actor_unit_id)
+        && NULL != game_city_by_number(
+          pDiplomat_Dlg->target_ids[ATK_CITY])) {
+      request_do_action(ACTION_STEAL_MAPS,
                         pDiplomat_Dlg->actor_unit_id,
                         pDiplomat_Dlg->target_ids[ATK_CITY],
                         0, "");
@@ -787,6 +809,7 @@
   [ACTION_SPY_INVESTIGATE_CITY] = diplomat_investigate_callback,
   [ACTION_SPY_POISON] = spy_poison_callback,
   [ACTION_SPY_STEAL_GOLD] = spy_steal_gold_callback,
+  [ACTION_STEAL_MAPS] = spy_steal_maps_callback,
   [ACTION_SPY_SABOTAGE_CITY] = diplomat_sabotage_callback,
   [ACTION_SPY_TARGETED_SABOTAGE_CITY] = spy_sabotage_request,
   [ACTION_SPY_STEAL_TECH] = diplomat_steal_callback,


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

Reply via email to