[Freeciv-Dev] (PR#11207) keyboardless mouse-only goto causes accidental
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: |
[Freeciv-Dev] (PR#11207) keyboardless mouse-only goto causes accidental gotos |
From: |
"Christian Knoke" <chrisk@xxxxxxxxx> |
Date: |
Sun, 19 Dec 2004 02:26:35 -0800 |
Reply-to: |
bugs@xxxxxxxxxxx |
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11207 >
Here is a patch, following loosely my suggestion #2. The veteran state info
is moved from behind the unit name down to the Moves line. Thus, the number
of lines total does not change.
This avoids the resize pretty much I think, and so avoids the goto problem.
The current unit_info_label (with unit name and veteran state in one line)
can exeed to at least 31 characters in the german locale. Even if we avoid
the resize by other means, this can grow too big, anyway.
If tested the patch with GTK2 and XAW3D. The GTK1 client uses another system
to setup the text as is unaffected.
Christian
--
Christian Knoke * * * http://cknoke.de
* * * * * * * * * Ceterum censeo Microsoft esse dividendum.
--- client/text.c.orig 2004-12-19 10:43:54.000000000 +0100
+++ client/text.c 2004-12-19 10:57:21.000000000 +0100
@@ -476,10 +476,6 @@
struct unit_type *ptype = unit_type(punit);
add("%s", ptype->name);
-
- if (ptype->veteran[punit->veteran].name[0] != '\0') {
- add(" (%s)", _(ptype->veteran[punit->veteran].name));
- }
}
RETURN;
}
@@ -496,6 +492,7 @@
/* This text should always have the same number of lines. Otherwise the
* GUI widgets may be confused and try to resize themselves. */
if (punit) {
+ struct unit_type *ptype = unit_type(punit);
struct city *pcity =
player_find_city_by_id(game.player_ptr, punit->homecity);
int infrastructure =
@@ -504,7 +501,12 @@
if (hover_unit == punit->id) {
add_line(_("Turns to target: %d"), get_goto_turns());
} else {
+ if (ptype->veteran[punit->veteran].name[0] != '\0') {
+ add_line("%s, %s", _(ptype->veteran[punit->veteran].name),
+ unit_activity_text(punit));
+ } else {
add_line("%s", unit_activity_text(punit));
+ }
}
add_line("%s", map_get_tile_info_text(punit->tile));
|
|