Author: cazfi
Date: Tue Jan  5 20:33:13 2016
New Revision: 31372

URL: http://svn.gna.org/viewcvs/freeciv?rev=31372&view=rev
Log:
Do not list conflicting resources individually for Resource extra help in 
gtk-clients.

See patch #6771

Modified:
    trunk/client/gui-gtk-2.0/helpdlg.c
    trunk/client/gui-gtk-3.0/helpdlg.c
    trunk/client/gui-gtk-3.x/helpdlg.c

Modified: trunk/client/gui-gtk-2.0/helpdlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-2.0/helpdlg.c?rev=31372&r1=31371&r2=31372&view=diff
==============================================================================
--- trunk/client/gui-gtk-2.0/helpdlg.c  (original)
+++ trunk/client/gui-gtk-2.0/helpdlg.c  Tue Jan  5 20:33:13 2016
@@ -1243,6 +1243,7 @@
     strcat(buf, pitem->text);
   } else {
     struct road_type *proad = extra_road_get(pextra);
+    bool is_resource = is_extra_caused_by(pextra, EC_RESOURCE);
 
     /* Cost to build */
     if (pextra->buildable) {
@@ -1259,8 +1260,13 @@
     gtk_label_set_text(GTK_LABEL(help_elabel[1]), buf);
     /* Conflicting extras */
     buf[0] = '\0';
+    if (is_resource) {
+      /* TRANS: (Resource extra) Conflicts with: */
+      strcat(buf, _("Other Resources"));
+    }
     extra_type_iterate(pextra2) {
-      if (!can_extras_coexist(pextra, pextra2)) {
+      if (!can_extras_coexist(pextra, pextra2)
+          && (!is_resource || !is_extra_caused_by(pextra2, EC_RESOURCE))) {
         if (buf[0] != '\0') {
           strcat(buf, "/");
         }

Modified: trunk/client/gui-gtk-3.0/helpdlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/helpdlg.c?rev=31372&r1=31371&r2=31372&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/helpdlg.c  (original)
+++ trunk/client/gui-gtk-3.0/helpdlg.c  Tue Jan  5 20:33:13 2016
@@ -1270,6 +1270,7 @@
     strcat(buf, pitem->text);
   } else {
     struct road_type *proad = extra_road_get(pextra);
+    bool is_resource = is_extra_caused_by(pextra, EC_RESOURCE);
 
     /* Cost to build */
     if (pextra->buildable) {
@@ -1286,8 +1287,13 @@
     gtk_label_set_text(GTK_LABEL(help_elabel[1]), buf);
     /* Conflicting extras */
     buf[0] = '\0';
+    if (is_resource) {
+      /* TRANS: (Resource extra) Conflicts with: */
+      strcat(buf, _("Other Resources"));
+    }
     extra_type_iterate(pextra2) {
-      if (!can_extras_coexist(pextra, pextra2)) {
+      if (!can_extras_coexist(pextra, pextra2)
+          && (!is_resource || !is_extra_caused_by(pextra2, EC_RESOURCE))) {
         if (buf[0] != '\0') {
           strcat(buf, "/");
         }

Modified: trunk/client/gui-gtk-3.x/helpdlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.x/helpdlg.c?rev=31372&r1=31371&r2=31372&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.x/helpdlg.c  (original)
+++ trunk/client/gui-gtk-3.x/helpdlg.c  Tue Jan  5 20:33:13 2016
@@ -1273,6 +1273,7 @@
     strcat(buf, pitem->text);
   } else {
     struct road_type *proad = extra_road_get(pextra);
+    bool is_resource = is_extra_caused_by(pextra, EC_RESOURCE);
 
     /* Cost to build */
     if (pextra->buildable) {
@@ -1289,8 +1290,13 @@
     gtk_label_set_text(GTK_LABEL(help_elabel[1]), buf);
     /* Conflicting extras */
     buf[0] = '\0';
+    if (is_resource) {
+      /* TRANS: (Resource extra) Conflicts with: */
+      strcat(buf, _("Other Resources"));
+    }
     extra_type_iterate(pextra2) {
-      if (!can_extras_coexist(pextra, pextra2)) {
+      if (!can_extras_coexist(pextra, pextra2)
+          && (!is_resource || !is_extra_caused_by(pextra2, EC_RESOURCE))) {
         if (buf[0] != '\0') {
           strcat(buf, "/");
         }


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to