Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Happyness status display in city dialog (PR#1046)
Home

[Freeciv-Dev] Happyness status display in city dialog (PR#1046)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Happyness status display in city dialog (PR#1046)
From: andreas.beckmann@xxxxxxxxxxxxxxxxxxxx
Date: Wed, 31 Oct 2001 12:17:18 -0800 (PST)

Full_Name: Andreas Beckmann
Version: 1.12.1-devel (cvs)
Distribution: Built from source
Client: Gtk+
OS: Linux
Submission from: (NULL) (217.226.255.159)


Hi,

I really like the new city dialog! But one thing is still missing: 
an indicator for the city states disorder/content/happy/celebrating.

I made one by adding a string describing the state!=content to the title
(window title and title of the citizen box on top of the city dialog).
It's just an idea and could be improved (change strings, select color 
depending on state, ...)

It's a patch for Gtk+ only and should be ported to the other GUIs, too.
I don't know Gtk+, so I couldn't do anything fancier ...

Index: client/gui-gtk/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/citydlg.c,v
retrieving revision 1.100
diff -u -u -r1.100 citydlg.c
--- client/gui-gtk/citydlg.c    2001/10/30 11:29:33     1.100
+++ client/gui-gtk/citydlg.c    2001/10/31 19:34:55
@@ -1584,7 +1584,16 @@
   my_snprintf(buf, sizeof(buf), _("%s - %s citizens"),
              pdialog->pcity->name,
              population_to_text(city_population(pdialog->pcity)));
+  if (city_unhappy(pdialog->pcity))
+    mystrlcat(buf, _(" - DISORDER"), sizeof(buf));
+  else if (city_celebrating(pdialog->pcity))
+    mystrlcat(buf, _(" - celebrating"), sizeof(buf));
+  else if (city_happy(pdialog->pcity))
+    mystrlcat(buf, _(" - happy"), sizeof(buf));
 
+  // idea: change color depending on city state:
+  // black = normal, red = disorder, white? gold? = celebrating
+
   now = GTK_WINDOW(pdialog->shell)->title;
   if (strcmp(now, buf)) {
     gtk_frame_set_label(GTK_FRAME(pdialog->title_frame), buf);




[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Happyness status display in city dialog (PR#1046), andreas . beckmann <=