Author: sveinung Date: Mon Oct 3 14:37:49 2016 New Revision: 33978 URL: http://svn.gna.org/viewcvs/freeciv?rev=33978&view=rev Log: Act sel dlg: pre select current target unit.
The unit select unit dialog now supports specifying what unit should be preselected. Use this feature in the action selection dialog's target unit switcher. Have the action selection target unit switcher dialog select the current target unit. See patch #7748 Modified: trunk/client/gui-gtk-3.0/action_dialog.c trunk/client/gui-gtk-3.x/action_dialog.c Modified: trunk/client/gui-gtk-3.0/action_dialog.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/action_dialog.c?rev=33978&r1=33977&r2=33978&view=diff ============================================================================== --- trunk/client/gui-gtk-3.0/action_dialog.c (original) +++ trunk/client/gui-gtk-3.0/action_dialog.c Mon Oct 3 14:37:49 2016 @@ -1225,11 +1225,13 @@ struct action_data *args = (struct action_data *)data; struct unit *punit; + struct unit *tunit; struct tile *ptile; if ((punit = game_unit_by_number(args->actor_unit_id)) - && (ptile = index_to_tile(args->target_tile_id))) { - select_tgt_unit(punit, ptile, ptile->units, NULL, + && (ptile = index_to_tile(args->target_tile_id)) + && (tunit = game_unit_by_number(args->target_unit_id))) { + select_tgt_unit(punit, ptile, ptile->units, tunit, _("Target unit selection"), _("Looking for target unit:"), _("Units at tile:"), Modified: trunk/client/gui-gtk-3.x/action_dialog.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.x/action_dialog.c?rev=33978&r1=33977&r2=33978&view=diff ============================================================================== --- trunk/client/gui-gtk-3.x/action_dialog.c (original) +++ trunk/client/gui-gtk-3.x/action_dialog.c Mon Oct 3 14:37:49 2016 @@ -1219,11 +1219,13 @@ struct action_data *args = (struct action_data *)data; struct unit *punit; + struct unit *tunit; struct tile *ptile; if ((punit = game_unit_by_number(args->actor_unit_id)) - && (ptile = index_to_tile(args->target_tile_id))) { - select_tgt_unit(punit, ptile, ptile->units, NULL, + && (ptile = index_to_tile(args->target_tile_id)) + && (tunit = game_unit_by_number(args->target_unit_id))) { + select_tgt_unit(punit, ptile, ptile->units, tunit, _("Target unit selection"), _("Looking for target unit:"), _("Units at tile:"), _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits