Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] (PR#3700) Recall previous focus unit
Home

[Freeciv-Dev] (PR#3700) Recall previous focus unit

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: a-l@xxxxxxx
Subject: [Freeciv-Dev] (PR#3700) Recall previous focus unit
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 21 Mar 2003 17:01:44 -0800
Reply-to: rt@xxxxxxxxxxxxxx

[a-l@xxxxxxx - Tue Mar 11 21:20:50 2003]:

> I find it useful with a key that returns focus to the previous
> focus unit, for many reasons.

Sounds helpful.

> This patch puts that on the "Keypad 5" key, which
> previously was focus_to_next_unit(), in the GDK clients.
> I did not delete the previously used function. Should I?

Yes, please - it has no users and doesn't do anything complicated anyway.

Alternately, it should be moved into control.c and rebound to a
different key.  Perhaps we can just wait to see if someone complains
about its absence...

> Of course, with the current code there is a subtle difference
> between pressing Keypad 5 and pressing W, in that Keypad 5
> does not set the unit's status to "wait".
> 
> But I suspect nobody uses Keypad 5. If someone did,
> this long standing bug would probably have been reported:
> 
>       (GTK1 and GTK2) When the numlock LED is off, Keypad 5
>       will end turn instead of advance focus.
> 
> If you prefere, the other patch, bugfix.diff, simply fixes this bug.

Indeed, I didn't even know keypad-5 advanced the focus.

I think this patch is basically ready (except for the above).  But also:

- Should recall_previous_focus() have a key_ prefix?  Most of the other
keyboard-binding functions do.

- Is there an easy way to make this action recursive?  Then you could go
back several steps in your unit-advancing.  Would such a feature be useful?

- Is it possible for the previous_focus_id unit to die, and its ID to be
taken by a different unit?  This would give buggy, but rather unharmful,
results.  Is there an easy way to prevent this?

jason



[Prev in Thread] Current Thread [Next in Thread]