Author: sveinung
Date: Thu Aug 11 02:24:30 2016
New Revision: 33558

URL: http://svn.gna.org/viewcvs/freeciv?rev=33558&view=rev
Log:
2nd targeted "Do..." means target own tile.

Change key_unit_action_select_tgt() so it targets the actor's own tile the
2nd time it is called. Targeting its own tile is the traditional behavior.

This makes using key_unit_action_select_tgt() to handle the "d" key press
less confusing and annoying for old players.

A user with an existing habit of pressing "d" to act against a target on
the same tile as the actor is likely to press it again if the first key press
doesn't work. If he selected the menu item he will notice that the mouse
pointer turns into a selector.

Pressing "d" twice doesn't slow down acting against a target on the same
tile as the actor too much. No mouse is required.

See patch #7578

Modified:
    branches/S2_6/client/control.c
    branches/S2_6/data/helpdata.txt

Modified: branches/S2_6/client/control.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/control.c?rev=33558&r1=33557&r2=33558&view=diff
==============================================================================
--- branches/S2_6/client/control.c      (original)
+++ branches/S2_6/client/control.c      Thu Aug 11 02:24:30 2016
@@ -2960,10 +2960,25 @@
 /**************************************************************************
   Have the user select what action the unit(s) in focus should perform to
   the targets at the tile the user will specify by clicking on it.
+
+  Will stop asking for a target tile and have each actor unit act against
+  its own tile if called twice.
 **************************************************************************/
 void key_unit_action_select_tgt(void)
 {
   struct unit_list *punits = get_units_in_focus();
+
+  if (hover_state == HOVER_ACT_SEL_TGT) {
+    /* The 2nd key press means that the actor should target its own
+     * tile. */
+    key_unit_action_select();
+
+    /* Target tile selected. Clean up hover state. */
+    set_hover_state(NULL, HOVER_NONE, ACTIVITY_LAST, NULL, ORDER_LAST);
+    update_unit_info_label(punits);
+
+    return;
+  }
 
   set_hover_state(punits, HOVER_ACT_SEL_TGT, ACTIVITY_LAST, NULL,
                   ORDER_LAST);

Modified: branches/S2_6/data/helpdata.txt
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/helpdata.txt?rev=33558&r1=33557&r2=33558&view=diff
==============================================================================
--- branches/S2_6/data/helpdata.txt     (original)
+++ branches/S2_6/data/helpdata.txt     Thu Aug 11 02:24:30 2016
@@ -1584,7 +1584,7 @@
   b: (b)uild city  (settler units)\n\
   b: help (b)uild wonder  (caravan units)\n\
   B: go to and (B)uild city on target tile  (settler units)\n\
-  d: (d)o an action to a target on this tile.\n\
+  d: (d)o an action to the selected tile (press twice to target own tile)\n\
   D: (D)isband unit\n\
   E: build airbas(e)  (airbase units)\n\
   f: (f)ortify unit  (military units)\n\


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

Reply via email to