<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40678 >

The mouse cursor changing code is unreliable to the point of
being a constant annoyance when playing a game, doubly so in
multiplayer time contraints. Numerous people have complained
about this:

http://bugs.freeciv.org/Ticket/Display.html?id=40306
http://bugs.freeciv.org/Ticket/Display.html?id=39800
http://forum.freeciv.org/viewtopic.php?p=22936#22936

and I agree.

Until I or someone has the time to give it a thorough
examining, here is a patch that implements an option to
turn off the cursor changing feature (default enabled,
that is, the default setting preserves the current
behaviour).


-----------------------------------------------------------------------
私は地下室に隠れています。
 client/control.c |    4 ++++
 client/options.c |    7 +++++++
 client/options.h |    1 +
 3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/client/control.c b/client/control.c
index 31a9a09..0856d93 100644
--- a/client/control.c
+++ b/client/control.c
@@ -931,6 +931,10 @@ void control_mouse_cursor(struct tile *ptile)
   struct city *pcity = NULL;
   struct unit_list *active_units = get_units_in_focus();
 
+  if (!enable_cursor_changes) {
+    return;
+  }
+
   if (C_S_RUNNING != client_state()) {
     action_state = CURSOR_ACTION_DEFAULT;
     return;
diff --git a/client/options.c b/client/options.c
index f72717b..a7cfd44 100644
--- a/client/options.c
+++ b/client/options.c
@@ -87,6 +87,7 @@ bool ask_city_name = TRUE;
 bool popup_new_cities = TRUE;
 bool keyboardless_goto = TRUE;
 bool show_task_icons = TRUE;
+bool enable_cursor_changes = TRUE;
 
 /* This option is currently set by the client - not by the user. */
 bool update_city_text_in_refresh_tile = TRUE;
@@ -243,6 +244,12 @@ static client_option common_options[] = {
 		  N_("Setting this option will pop up a newly-founded "
 		     "city's city dialog automatically."),
 		  COC_INTERFACE),
+  GEN_BOOL_OPTION(enable_cursor_changes, N_("Enable cursor changing"),
+                  N_("This option controls whether the client should "
+                     "try to change the mouse cursor depending on what "
+                     "is being pointed at, as well as to indicate "
+                     "changes in the client or server state."),
+                  COC_INTERFACE),
 
   GEN_BOOL_OPTION(overview.layers[OLAYER_BACKGROUND],
 		  N_("Background layer"),
diff --git a/client/options.h b/client/options.h
index 31268ea..49fdced 100644
--- a/client/options.h
+++ b/client/options.h
@@ -51,6 +51,7 @@ extern bool popup_new_cities;
 extern bool update_city_text_in_refresh_tile;
 extern bool keyboardless_goto;
 extern bool show_task_icons;
+extern bool enable_cursor_changes;
 
 enum client_option_type {
   COT_BOOL,
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to