Author: cazfi
Date: Wed May  6 19:23:00 2015
New Revision: 29008

URL: http://svn.gna.org/viewcvs/freeciv?rev=29008&view=rev
Log:
Restore sdl-clients' menu button after switching player.

See bug #23551

Modified:
    branches/S2_5/client/gui-sdl/gui_main.h
    branches/S2_5/client/gui-sdl/menu.c

Modified: branches/S2_5/client/gui-sdl/gui_main.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-sdl/gui_main.h?rev=29008&r1=29007&r2=29008&view=diff
==============================================================================
--- branches/S2_5/client/gui-sdl/gui_main.h     (original)
+++ branches/S2_5/client/gui-sdl/gui_main.h     Wed May  6 19:23:00 2015
@@ -37,7 +37,7 @@
 #define CF_MAP_UNIT_W_CREATED          (1<<1)
 #define CF_UNITINFO_SHOWN              (1<<2)
 #define CF_OVERVIEW_SHOWN              (1<<3)
-#define CF_GANE_JUST_STARTED           (1<<6)
+#define CF_GAME_JUST_STARTED           (1<<6)
 
 #define CF_FOCUS_ANIMATION             (1<<9)
 #define CF_CHANGED_PROD                        (1<<10)

Modified: branches/S2_5/client/gui-sdl/menu.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-sdl/menu.c?rev=29008&r1=29007&r2=29008&view=diff
==============================================================================
--- branches/S2_5/client/gui-sdl/menu.c (original)
+++ branches/S2_5/client/gui-sdl/menu.c Wed May  6 19:23:00 2015
@@ -1006,7 +1006,7 @@
   if ((C_S_RUNNING != client_state()) ||
       (get_client_page() != PAGE_GAME)) {
 
-    SDL_Client_Flags |= CF_GANE_JUST_STARTED;
+    SDL_Client_Flags |= CF_GAME_JUST_STARTED;
        
     if (SDL_Client_Flags & CF_MAP_UNIT_W_CREATED) {
       set_wflag(pOptions_Button, WF_HIDDEN);
@@ -1018,50 +1018,48 @@
       hide_group(pBeginOrderWidgetList, pEndOrderWidgetList);
     }
 
-  } else if (NULL == client.conn.playing) {
-    
-    /* running state, but AI is playing */
-    
+  } else {
+    /* Running state */
     if (SDL_Client_Flags & CF_MAP_UNIT_W_CREATED) {
       /* show options button */
       clear_wflag(pOptions_Button, WF_HIDDEN);
       widget_redraw(pOptions_Button);
       widget_mark_dirty(pOptions_Button);
-      /* show minimap buttons and unitinfo buttons */ 
-      show_minimap_window_buttons();
-      show_unitinfo_window_buttons();      
-      /* disable minimap buttons and unitinfo buttons */
-      disable_minimap_window_buttons();
-      disable_unitinfo_window_buttons();
-    }
-
-    return;
-
-  } else {
+    }
+
+    if (NULL == client.conn.playing) {
+      /* Global observer */
+      if (SDL_Client_Flags & CF_MAP_UNIT_W_CREATED) {
+        /* show minimap buttons and unitinfo buttons */ 
+        show_minimap_window_buttons();
+        show_unitinfo_window_buttons();      
+        /* disable minimap buttons and unitinfo buttons */
+        disable_minimap_window_buttons();
+        disable_unitinfo_window_buttons();
+      }
+
+      return;
+
+    } else {
+      /* running state with player */
+
+      if (get_wstate(pEndOrderWidgetList) == FC_WS_DISABLED) {
+        enable_group(pBeginOrderWidgetList, pEndOrderWidgetList);
+      }
+    
+      if (counter) {
+        undraw_order_widgets();
+      }
+
+      if (SDL_Client_Flags & CF_GAME_JUST_STARTED) {
+        SDL_Client_Flags &= ~CF_GAME_JUST_STARTED;
       
-    /* running state with human player */
-    
-    if (get_wstate(pEndOrderWidgetList) == FC_WS_DISABLED) {
-      enable_group(pBeginOrderWidgetList, pEndOrderWidgetList);
-    }
-    
-    if (counter) {
-      undraw_order_widgets();
-    }
-
-    if (SDL_Client_Flags & CF_GANE_JUST_STARTED) {
-      SDL_Client_Flags &= ~CF_GANE_JUST_STARTED;
-
-      /* show options button */
-      clear_wflag(pOptions_Button, WF_HIDDEN);
-      widget_redraw(pOptions_Button);
-      widget_mark_dirty(pOptions_Button);
-      
-      /* show minimap buttons and unitinfo buttons */
-      show_minimap_window_buttons();      
-      show_unitinfo_window_buttons();
-
-      counter = 0;
+        /* show minimap buttons and unitinfo buttons */
+        show_minimap_window_buttons();      
+        show_unitinfo_window_buttons();
+
+        counter = 0;
+      }
     }
 
     punits = get_units_in_focus();


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to