Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2003:
[Freeciv-Dev] (PR#3949) New revolution gui gives problems
Home

[Freeciv-Dev] (PR#3949) New revolution gui gives problems

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ChrisK@xxxxxxxx
Subject: [Freeciv-Dev] (PR#3949) New revolution gui gives problems
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 23 Apr 2003 10:44:21 -0700
Reply-to: rt@xxxxxxxxxxxxxx

[ChrisK@xxxxxxxx - Mon Apr  7 09:49:14 2003]:

> CVS 07 APR 2003 GTK 1
> 
> So while we're on it ...
> 
> I can chose "Republik" from the kingdom menue. Next round I discover
> communism or democracy, and, still in anarchy, chose "Revolution!".
> With no effect - I'll end up in republic, no menue appears when anarchy
> comes to an end.
> 
> Also, I tried first "democracy", then "Revolution", then "republic", and
> ended in "republic", but a menue appeared: I clicked on "democracy", but
> nothing happened ...
> 
> IMHO it should do the following: Always respect the last command (only)
> while in anarchy period. Also gives a clear feedback what will happen;
> at least a text message announcing the intended government form.

This patch clears the target government when you choose to have a
revolution.

It would be easy enough to provide feedback on the chatline, simply by
adding a new line to start_revolution or set_government_choice.

jason

Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.301
diff -u -r1.301 packhand.c
--- client/packhand.c   2003/04/17 20:06:35     1.301
+++ client/packhand.c   2003/04/23 17:41:22
@@ -1256,6 +1256,19 @@
 }
 
 /**************************************************************************
+  Begin a revolution by telling the server to start it.  This also clears
+  the current government choice.
+**************************************************************************/
+void start_revolution(void)
+{
+  struct packet_player_request packet;
+
+  government_selected = FALSE;
+  send_packet_player_request(&aconnection, &packet,
+                            PACKET_PLAYER_REVOLUTION);
+}
+
+/**************************************************************************
   Choose the government after a revolution completes, either by taking the
   government that the player has already specified or by popping up a
   dialog to ask.
Index: client/packhand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.h,v
retrieving revision 1.32
diff -u -r1.32 packhand.h
--- client/packhand.h   2003/03/24 22:29:31     1.32
+++ client/packhand.h   2003/04/23 17:41:22
@@ -75,5 +75,6 @@
 
 void target_government_init(void);
 void set_government_choice(int government);
+void start_revolution(void);
 
 #endif /* FC__PACKHAND_H */
Index: client/gui-gtk/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/dialogs.c,v
retrieving revision 1.126
diff -u -r1.126 dialogs.c
--- client/gui-gtk/dialogs.c    2003/04/04 15:47:46     1.126
+++ client/gui-gtk/dialogs.c    2003/04/23 17:41:23
@@ -39,6 +39,7 @@
 #include "clinet.h"
 #include "control.h"
 #include "options.h"
+#include "packhand.h"
 #include "tilespec.h"
 
 #include "chatline.h"
@@ -1301,9 +1302,7 @@
 *****************************************************************/
 static void revolution_callback_yes(gpointer data)
 {
-  struct packet_player_request packet;
-
-  send_packet_player_request(&aconnection, &packet, PACKET_PLAYER_REVOLUTION);
+  start_revolution();
 }
 
 /****************************************************************
Index: client/gui-gtk-2.0/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/dialogs.c,v
retrieving revision 1.46
diff -u -r1.46 dialogs.c
--- client/gui-gtk-2.0/dialogs.c        2003/04/19 04:23:32     1.46
+++ client/gui-gtk-2.0/dialogs.c        2003/04/23 17:41:24
@@ -46,6 +46,7 @@
 #include "gui_stuff.h"
 #include "mapview.h"
 #include "options.h"
+#include "packhand.h"
 #include "tilespec.h"
 
 #include "dialogs.h"
@@ -1192,9 +1193,7 @@
   gtk_window_set_title(GTK_WINDOW(shell), _("Revolution!"));
 
   if (gtk_dialog_run(GTK_DIALOG(shell)) == GTK_RESPONSE_YES) {
-    struct packet_player_request packet;
-
-    send_packet_player_request(&aconnection, &packet, 
PACKET_PLAYER_REVOLUTION);
+    start_revolution();
   }
   gtk_widget_destroy(shell);
 }
Index: client/gui-mui/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/dialogs.c,v
retrieving revision 1.50
diff -u -r1.50 dialogs.c
--- client/gui-mui/dialogs.c    2003/03/29 09:57:37     1.50
+++ client/gui-mui/dialogs.c    2003/04/23 17:41:25
@@ -45,6 +45,7 @@
 #include "gui_main.h"
 #include "mapview.h"
 #include "options.h"
+#include "packhand.h"
 
 #include "muistuff.h"
 #include "mapclass.h"
@@ -55,8 +56,7 @@
 *****************************************************************/
 void request_player_revolution(void)
 {
-  struct packet_player_request packet;
-  send_packet_player_request(&aconnection, &packet, PACKET_PLAYER_REVOLUTION);
+  start_revolution();
 }
 /****************************************************************
  ...
Index: client/gui-sdl/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/dialogs.c,v
retrieving revision 1.17
diff -u -r1.17 dialogs.c
--- client/gui-sdl/dialogs.c    2003/03/20 13:37:51     1.17
+++ client/gui-sdl/dialogs.c    2003/04/23 17:41:27
@@ -48,6 +48,7 @@
 #include "civclient.h"
 #include "clinet.h"
 #include "control.h"
+#include "packhand.h"
 
 #include "colors.h"
 
@@ -4298,10 +4299,7 @@
 **************************************************************************/
 static int revolution_dlg_ok_callback(struct GUI *pButton)
 {
-  struct packet_player_request packet;
-
-  send_packet_player_request(&aconnection, &packet,
-                            PACKET_PLAYER_REVOLUTION);
+  start_revolution();
 
   popdown_revolution_dialog();
   
Index: client/gui-win32/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/dialogs.c,v
retrieving revision 1.32
diff -u -r1.32 dialogs.c
--- client/gui-win32/dialogs.c  2003/04/04 15:47:48     1.32
+++ client/gui-win32/dialogs.c  2003/04/23 17:41:27
@@ -34,16 +34,18 @@
 #include "rand.h"
 #include "support.h"
  
-#include "chatline.h"
 #include "civclient.h"
 #include "clinet.h"
 #include "control.h"
+#include "tilespec.h"
+#include "packhand.h"
+
+#include "chatline.h"
+#include "dialogs.h"
 #include "gui_stuff.h"
 #include "mapview.h"
-#include "tilespec.h"
 #include "gui_main.h" 
                              
-#include "dialogs.h"
 #define POPUP_MESSAGEDLG_IDBASE 500
 #define UNITSELECT_CLOSE 300
 #define UNITSELECT_READY_ALL 301
@@ -876,10 +878,7 @@
 *****************************************************************/
 static void revolution_callback_yes(HWND w, void * data)
 {
-  struct packet_player_request packet;
- 
-  send_packet_player_request(&aconnection, &packet, PACKET_PLAYER_REVOLUTION);
- 
+  start_revolution();
   destroy_message_dialog(w);
 }
  
Index: client/gui-xaw/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/dialogs.c,v
retrieving revision 1.82
diff -u -r1.82 dialogs.c
--- client/gui-xaw/dialogs.c    2003/04/04 15:47:48     1.82
+++ client/gui-xaw/dialogs.c    2003/04/23 17:41:28
@@ -1367,10 +1367,7 @@
 static void revolution_callback_yes(Widget w, XtPointer client_data, 
                                    XtPointer call_data)
 {
-  struct packet_player_request packet;
-
-  send_packet_player_request(&aconnection, &packet, PACKET_PLAYER_REVOLUTION);
-  
+  start_revolution();
   destroy_message_dialog(w);
 }
 

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