Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2006:
[Freeciv-Dev] (PR#15688) gtk2 client needs pregame observer support
Home

[Freeciv-Dev] (PR#15688) gtk2 client needs pregame observer support

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#15688) gtk2 client needs pregame observer support
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 1 Mar 2006 09:35:23 -0800
Reply-to: bugs@xxxxxxxxxxx

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

This patch adds an "observe" button the the pregame dialog.

However this is problematic since there is no corresponding button to
reverse observing.  After you /observe your player is automatically
deleted.  To reclaim a player I think you have to:

  /create some-name
  /take some-name
  /aitoggle some-name

which is so complex that we cannot expect anyone to actually figure it
out, aside from which you have to pick "some-name" to be a name that's
not already in use or it won't work.  The end result is that if a user
presses "observe" by accident they've effectively fubared their game.

Thus, before this is finalized we need to change "/take" so that if
given no parameters it creates and takes a player for you.  Then the
observe button can be toggled onto a "take player" button when you are
observing.

-jason

Index: client/gui-gtk-2.0/pages.c
===================================================================
--- client/gui-gtk-2.0/pages.c  (revision 11685)
+++ client/gui-gtk-2.0/pages.c  (working copy)
@@ -996,6 +996,14 @@
 }
 
 /**************************************************************************
+  Called when "observe" is clicked.
+**************************************************************************/
+static void observe_callback(GtkWidget *w, gpointer data)
+{
+  send_chat("/observe");
+}
+
+/**************************************************************************
   update the start page.
 **************************************************************************/
 void update_start_page(void)
@@ -1428,6 +1436,11 @@
                   G_CALLBACK(pick_nation_callback), NULL);
   gtk_container_add(GTK_CONTAINER(bbox), button);
 
+  button = gtk_stockbutton_new(GTK_STOCK_ZOOM_IN, _("_Observe"));
+  g_signal_connect(button, "clicked",
+                  G_CALLBACK(observe_callback), NULL);
+  gtk_container_add(GTK_CONTAINER(bbox), button);
+
   ready_button = gtk_stockbutton_new(GTK_STOCK_EXECUTE, _("_Ready"));
   g_signal_connect(ready_button, "clicked",
       G_CALLBACK(start_start_callback), NULL);

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