Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] (PR#3713) City choose production dialog
Home

[Freeciv-Dev] (PR#3713) City choose production dialog

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: dspeyer@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#3713) City choose production dialog
From: "Guest" <rt-guest@xxxxxxxxxxxxxx>
Date: Wed, 12 Mar 2003 13:05:26 -0800
Reply-to: rt@xxxxxxxxxxxxxx

I was recently talkingto a comparative freeciv newbie who complained the
choose production dialog gave too few hints about what the things were.
 She suggested color coding.  Here is my code:

Units{
 Land: green
 Sea: blue
 Air/Heli: red
}
Buildings{
 redundand: grey
 current: black
}
Wonders{
 obsolete: grey
 current: black
}

The patch is appended, it's very simple.  I can't think of much to add
to it.

--Daniel Speyer
More than a third of the expected casualties in a U.S. war against Iraq
weren't even born during the Kuwait invasion, but don't worry, they
won't be on TV.

--- ../freeciv-mike-mine-myalgor/client/gui-gtk/citydlg.c       Sat Feb 22
16:51:06 2003
+++ client/gui-gtk/citydlg.c    Wed Mar 12 15:12:33 2003
@@ -24,6 +24,7 @@
 #include <gdk/gdkkeysyms.h>
 
 #include "city.h"
+#include "colors_g.h"
 #include "fcintl.h"
 #include "game.h"
 #include "map.h"
@@ -1762,17 +1763,6 @@
   gtk_widget_modify_style(info_label[POLLUTION], info_label_style[style]);
 }
@@ -3115,6 +3047,26 @@
                                   cid_id(cid), cid_is_unit(cid),
                                   pdialog->pcity);
     row_no = gtk_clist_append(GTK_CLIST(pdialog->change_list), row);
+    if (cid_is_unit(cid) &&
get_unit_type(cid_id(cid))->move_type==LAND_MOVING){
+      gtk_clist_set_foreground(GTK_CLIST(pdialog->change_list), row_no,
+                              colors_standard[COLOR_STD_GROUND]);
+    }else if (cid_is_unit(cid) &&
get_unit_type(cid_id(cid))->move_type==SEA_MOVING){
+      gtk_clist_set_foreground(GTK_CLIST(pdialog->change_list), row_no,
+                              colors_standard[COLOR_STD_OCEAN]);
+    }else if (cid_is_unit(cid)){ /*Air and Heli (and anything new)*/
+      gtk_clist_set_foreground(GTK_CLIST(pdialog->change_list), row_no,
+                              colors_standard[COLOR_STD_RED]);
+    }else /*not a unit*/ if (is_wonder(cid_id(cid)) &&
(wonder_obsolete(cid_id(cid)) ||
+                                                       
game.global_wonders[cid_id(cid)])){
+      gtk_clist_set_foreground(GTK_CLIST(pdialog->change_list), row_no,
+                              colors_standard[COLOR_STD_BACKGROUND]);
+    } else if (!is_wonder(cid_id(cid)) && 
+              improvement_redundant(city_owner(pdialog->pcity),
+                                    pdialog->pcity,
+                                    cid_id(cid),FALSE)){
+      gtk_clist_set_foreground(GTK_CLIST(pdialog->change_list), row_no,
+                              colors_standard[COLOR_STD_BACKGROUND]);
+    }
     gtk_clist_set_row_data(GTK_CLIST(pdialog->change_list),
                           row_no, GINT_TO_POINTER(cid));
   }



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