[Freeciv-Dev] (PR#3701) Home key center on capital
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
When you press the 'Home' key, client wil focus
on your capital.
I find this useful as a map navigation tool.
Applies to the GDK clients. I'm unsure how to differentiate
between keypad and "grey pad" key codes in SDL and Win32.
Arnstein
diff -ruN -Xdiff_ignore cvs/client/control.c home/client/control.c
--- cvs/client/control.c Sat Feb 22 10:43:01 2003
+++ home/client/control.c Tue Mar 11 19:01:16 2003
@@ -1376,6 +1376,21 @@
/**************************************************************************
...
**************************************************************************/
+void key_center_capital(void)
+{
+ struct city *capital = find_palace(game.player_ptr);
+
+ if (capital) {
+ center_tile_mapcanvas(capital->x, capital->y);
+ put_cross_overlay_tile(capital->x, capital->y);
+ } else {
+ append_output_window(_("Game: Oh my! You seem to have no capital!"));
+ }
+}
+
+/**************************************************************************
+...
+**************************************************************************/
void key_end_turn(void)
{
send_turn_done();
diff -ruN -Xdiff_ignore cvs/client/control.h home/client/control.h
--- cvs/client/control.h Thu Feb 6 05:58:16 2003
+++ home/client/control.h Tue Mar 11 19:00:24 2003
@@ -97,6 +97,7 @@
void process_diplomat_arrival(struct unit *pdiplomat, int victim_id);
void key_cancel_action(void);
+void key_center_capital(void);
void key_city_names_toggle(void);
void key_city_growth_toggle(void);
void key_city_productions_toggle(void);
diff -ruN -Xdiff_ignore cvs/client/gui-gtk/gui_main.c
home/client/gui-gtk/gui_main.c
--- cvs/client/gui-gtk/gui_main.c Fri Feb 28 12:52:16 2003
+++ home/client/gui-gtk/gui_main.c Tue Mar 11 19:02:19 2003
@@ -295,7 +295,6 @@
key_unit_move(DIR8_WEST);
break;
- case GDK_Home:
case GDK_KP_Home:
case GDK_7:
case GDK_KP_7:
@@ -321,6 +320,10 @@
key_city_workers(w, ev);
break;
+ case GDK_Home:
+ key_center_capital();
+ break;
+
default:
return FALSE;
}
diff -ruN -Xdiff_ignore cvs/client/gui-gtk-2.0/gui_main.c
home/client/gui-gtk-2.0/gui_main.c
--- cvs/client/gui-gtk-2.0/gui_main.c Fri Mar 7 12:16:16 2003
+++ home/client/gui-gtk-2.0/gui_main.c Tue Mar 11 19:02:06 2003
@@ -419,7 +419,6 @@
key_unit_move(DIR8_WEST);
break;
- case GDK_Home:
case GDK_KP_Home:
case GDK_7:
case GDK_KP_7:
@@ -445,6 +444,10 @@
key_city_workers(w, ev);
break;
+ case GDK_Home:
+ key_center_capital();
+ break;
+
default:
return FALSE;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#3701) Home key center on capital,
a-l@xxxxxxx <=
|
|