[Freeciv-Dev] (PR#11987) two start dialog aifill problem
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11987 >
> [bhudson - Sat Jan 22 00:18:33 2005]:
>
> > Similarly, if you start a second game, the aifill and difficulty
settings
> > in the GUI are where they were for the first game, but this doesn't
> > get sent to the server. So while aifill looked like it was 30 hard AI,
> > actually it's 5 novice AI that got created.
>
> To replicate this, hit "new game" ; change aifill ; cancel; hit "new
game"
> again.
Here is a fix.
Index: client/gui-gtk-2.0/pages.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/pages.c,v
retrieving revision 1.14
diff -u -r1.14 pages.c
--- client/gui-gtk-2.0/pages.c 22 Jan 2005 19:45:40 -0000 1.14
+++ client/gui-gtk-2.0/pages.c 25 Jan 2005 21:56:22 -0000
@@ -860,6 +860,11 @@
/**************************************************************************
+ START PAGE
+**************************************************************************/
+static GtkWidget *start_aifill_spin;
+
+/**************************************************************************
request the game options dialog.
**************************************************************************/
static void game_options_callback(GtkWidget *w, gpointer data)
@@ -903,6 +908,15 @@
}
/**************************************************************************
+ update the start page.
+**************************************************************************/
+static void update_start_page(void)
+{
+ /* Default to aifill 5. */
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(start_aifill_spin), 5);
+}
+
+/**************************************************************************
create start page.
**************************************************************************/
GtkWidget *create_start_page(void)
@@ -935,9 +949,8 @@
gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
spin = gtk_spin_button_new_with_range(1, MAX_NUM_PLAYERS, 1);
+ start_aifill_spin = spin;
gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spin), 0);
- /* Default to aifill 5. */
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin), 5);
gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin),
GTK_UPDATE_IF_VALID);
g_signal_connect_after(spin, "value_changed",
@@ -1596,6 +1609,7 @@
case PAGE_START:
if (is_server_running()) {
gtk_widget_show(start_options_table);
+ update_start_page();
} else {
gtk_widget_hide(start_options_table);
}
|
|