Author: sveinung
Date: Wed Mar  9 16:38:27 2016
New Revision: 32213

URL: http://svn.gna.org/viewcvs/freeciv?rev=32213&view=rev
Log:
Close the action selection dialog on lost focus.

The action selection dialog is opened based on current unit focus. Have
losing focus close a unit's action selection dialog.

This makes open action selection dialogs pop down when the connection to the
server is lost.

See bug #24506

Modified:
    branches/S2_6/client/control.c

Modified: branches/S2_6/client/control.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/control.c?rev=32213&r1=32212&r2=32213&view=diff
==============================================================================
--- branches/S2_6/client/control.c      (original)
+++ branches/S2_6/client/control.c      Wed Mar  9 16:38:27 2016
@@ -422,6 +422,11 @@
 **************************************************************************/
 static void current_focus_remove(struct unit *punit)
 {
+  /* Close the action selection dialog if the actor unit lose focus. */
+  if (action_selection_actor_unit() == punit->id) {
+    action_selection_close();
+  }
+
   unit_list_remove(current_focus, punit);
   refresh_unit_mapcanvas(punit, unit_tile(punit), TRUE, FALSE);
 }
@@ -473,6 +478,13 @@
     store_previous_focus();
     focus_changed = TRUE;
   }
+
+  /* Close the action selection dialog if the actor unit lose focus. */
+  unit_list_iterate(current_focus, punit_old) {
+    if (action_selection_actor_unit() == punit_old->id) {
+      action_selection_close();
+    }
+  } unit_list_iterate_end;
 
   /* Redraw the old focus unit (to fix blinking or remove the selection
    * circle). */


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

Reply via email to