[Freeciv-Dev] Re: Happiness dialog - some bugs (PR#1581)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Hi all!
Content-Type: multipart/mixed; boundary="=-LMX8YrCficlkbW8WncrC"
--=-LMX8YrCficlkbW8WncrC
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi all!
This is a proposal patch to fix the bug I've wrote of:
(For the happiness display, I've made the fix to gtk, gtk-2 and win-32
clients)
Ciao, Davide
--=-LMX8YrCficlkbW8WncrC
Content-Disposition: attachment; filename=happiness-2.patch
Content-Transfer-Encoding: quoted-printable
Content-Type: text/x-patch; name=happiness-2.patch; charset=ISO-8859-1
diff -urN -Xfreeciv/diff_ignore freeciv-audio/client/gui-gtk/happiness.c fr=
eeciv/client/gui-gtk/happiness.c
--- freeciv-audio/client/gui-gtk/happiness.c Mon Feb 11 11:37:52 2002
+++ freeciv/client/gui-gtk/happiness.c Fri Jun 14 11:00:40 2002
@@ -148,8 +148,9 @@
int n1 =3D pcity->ppl_happy[index];
int n2 =3D n1 + pcity->ppl_content[index];
int n3 =3D n2 + pcity->ppl_unhappy[index];
- int n4 =3D n3 + pcity->ppl_elvis;
- int n5 =3D n4 + pcity->ppl_scientist;
+ int n4 =3D n3 + pcity->ppl_angry[index];
+ int n5 =3D n4 + pcity->ppl_elvis;
+ int n6 =3D n5 + pcity->ppl_scientist;
int num_citizens =3D pcity->size;
int pix_width =3D HAPPINESS_PIX_WIDTH * SMALL_TILE_WIDTH;
int offset =3D MIN(SMALL_TILE_WIDTH, pix_width / num_citizens);
@@ -164,10 +165,12 @@
else if (i < n2)
citizen_type =3D 3 + i % 2;
else if (i < n3)
- citizen_type =3D 7 + 1 % 2;
+ citizen_type =3D 7 + i % 2;
else if (i < n4)
- citizen_type =3D 0;
+ citizen_type =3D 9 + i % 2;
else if (i < n5)
+ citizen_type =3D 0;
+ else if (i < n6)
citizen_type =3D 1;
else
citizen_type =3D 2;
@@ -268,8 +271,8 @@
int nleft =3D sizeof(buf);
struct city *pcity =3D pdialog->pcity;
=20
- my_snprintf(bptr, nleft, _("Luxury: %d total (maximum %d usable). "),
- pcity->luxury_total, 2 * pcity->size);
+ my_snprintf(bptr, nleft, _("Luxury: %d total."),
+ pcity->luxury_total);
=20
gtk_set_label(pdialog->hlabels[LUXURIES], buf);
}
@@ -350,6 +353,7 @@
struct city *pcity =3D pdialog->pcity;
struct government *g =3D get_gov_pcity(pcity);
int mlmax =3D g->martial_law_max;
+ int uhcfac =3D g->unit_happy_cost_factor;
=20
my_snprintf(bptr, nleft, _("Units: "));
bptr =3D end_of_strn(bptr, &nleft);
@@ -366,10 +370,16 @@
bptr =3D end_of_strn(bptr, &nleft);
=20
my_snprintf(bptr, nleft, _("%d per unit). "), g->martial_law_per);
- } else {
+ }=20
+ else if (uhcfac > 0) {
my_snprintf(bptr, nleft,
_("Military units in the field may cause unhappiness. "));
}
+ else {
+ my_snprintf(bptr, nleft,
+ _("Military units have no happiness effect. "));
+
+ }
=20
gtk_set_label(pdialog->hlabels[UNITS], buf);
}
diff -urN -Xfreeciv/diff_ignore freeciv-audio/client/gui-gtk-2.0/happiness.=
c freeciv/client/gui-gtk-2.0/happiness.c
--- freeciv-audio/client/gui-gtk-2.0/happiness.c Tue Mar 12 00:09:46 2002
+++ freeciv/client/gui-gtk-2.0/happiness.c Fri Jun 14 12:43:25 2002
@@ -148,8 +148,9 @@
int n1 =3D pcity->ppl_happy[index];
int n2 =3D n1 + pcity->ppl_content[index];
int n3 =3D n2 + pcity->ppl_unhappy[index];
- int n4 =3D n3 + pcity->ppl_elvis;
- int n5 =3D n4 + pcity->ppl_scientist;
+ int n4 =3D n3 + pcity->ppl_angry[index];
+ int n5 =3D n4 + pcity->ppl_elvis;
+ int n6 =3D n5 + pcity->ppl_scientist;
int num_citizens =3D pcity->size;
int pix_width =3D HAPPINESS_PIX_WIDTH * SMALL_TILE_WIDTH;
int offset =3D MIN(SMALL_TILE_WIDTH, pix_width / num_citizens);
@@ -164,10 +165,12 @@
else if (i < n2)
citizen_type =3D 3 + i % 2;
else if (i < n3)
- citizen_type =3D 7 + 1 % 2;
+ citizen_type =3D 7 + i % 2;
else if (i < n4)
- citizen_type =3D 0;
+ citizen_type =3D 9 + i % 2;
else if (i < n5)
+ citizen_type =3D 0;
+ else if (i < n6)
citizen_type =3D 1;
else
citizen_type =3D 2;
@@ -268,8 +271,8 @@
int nleft =3D sizeof(buf);
struct city *pcity =3D pdialog->pcity;
=20
- my_snprintf(bptr, nleft, _("Luxury: %d total (maximum %d usable). "),
- pcity->luxury_total, 2 * pcity->size);
+ my_snprintf(bptr, nleft, _("Luxury: %d total."),
+ pcity->luxury_total);
=20
gtk_set_label(pdialog->hlabels[LUXURIES], buf);
}
@@ -350,6 +353,7 @@
struct city *pcity =3D pdialog->pcity;
struct government *g =3D get_gov_pcity(pcity);
int mlmax =3D g->martial_law_max;
+ int uhcfac =3D g->unit_happy_cost_factor;
=20
my_snprintf(bptr, nleft, _("Units: "));
bptr =3D end_of_strn(bptr, &nleft);
@@ -366,10 +370,16 @@
bptr =3D end_of_strn(bptr, &nleft);
=20
my_snprintf(bptr, nleft, _("%d per unit). "), g->martial_law_per);
- } else {
+ }=20
+ else if (uhcfac > 0) {
my_snprintf(bptr, nleft,
_("Military units in the field may cause unhappiness. "));
}
+ else {
+ my_snprintf(bptr, nleft,
+ _("Military units have no happiness effect. "));
+
+ }
=20
gtk_set_label(pdialog->hlabels[UNITS], buf);
}
diff -urN -Xfreeciv/diff_ignore freeciv-audio/client/gui-win32/happiness.c =
freeciv/client/gui-win32/happiness.c
--- freeciv-audio/client/gui-win32/happiness.c Sun Apr 21 16:40:13 2002
+++ freeciv/client/gui-win32/happiness.c Fri Jun 14 12:55:02 2002
@@ -213,8 +213,8 @@
int nleft =3D sizeof(buf);
struct city *pcity =3D pdialog->pcity;
=20
- my_snprintf(bptr, nleft, _("Luxury: %d total (maximum %d usable). "),
- pcity->luxury_total, 2 * pcity->size);
+ my_snprintf(bptr, nleft, _("Luxury: %d total."),
+ pcity->luxury_total);
=20
SetWindowText(pdialog->mod_label[LUXURIES], buf);
}
@@ -295,6 +295,7 @@
struct city *pcity =3D pdialog->pcity;
struct government *g =3D get_gov_pcity(pcity);
int mlmax =3D g->martial_law_max;
+ int uhcfac =3D g->unit_happy_cost_factor;
=20
my_snprintf(bptr, nleft, _("Units: "));
bptr =3D end_of_strn(bptr, &nleft);
@@ -311,10 +312,15 @@
bptr =3D end_of_strn(bptr, &nleft);
=20
my_snprintf(bptr, nleft, _("%d per unit). "), g->martial_law_per);
- } else {
+ }
+ else if (uhcfac > 0) {
my_snprintf(bptr, nleft,
_("Military units in the field may cause unhappiness. "));
}
+ else {
+ my_snprintf(bptr, nleft,
+ _("Military units have no happiness effect. "));
+ }
=20
SetWindowText(pdialog->mod_label[UNITS], buf);
}
@@ -388,8 +394,9 @@
int n1 =3D pcity->ppl_happy[index];
int n2 =3D n1 + pcity->ppl_content[index];
int n3 =3D n2 + pcity->ppl_unhappy[index];
- int n4 =3D n3 + pcity->ppl_elvis;
- int n5 =3D n4 + pcity->ppl_scientist;
+ int n4 =3D n3 + pcity->ppl_angry[index];
+ int n5 =3D n4 + pcity->ppl_elvis;
+ int n6 =3D n5 + pcity->ppl_scientist;
int num_citizens =3D pcity->size;
int pix_width =3D HAPPINESS_PIX_WIDTH * SMALL_TILE_WIDTH;
int offset =3D MIN(SMALL_TILE_WIDTH, pix_width / num_citizens);
@@ -407,10 +414,12 @@
else if (i < n2)
citizen_type =3D 3 + i % 2;
else if (i < n3)
- citizen_type =3D 7 + 1 % 2;
+ citizen_type =3D 7 + i % 2;
else if (i < n4)
- citizen_type =3D 0;
+ citizen_type =3D 9 + i % 2;
else if (i < n5)
+ citizen_type =3D 0;
+ else if (i < n6)
citizen_type =3D 1;
else
citizen_type =3D 2;
--=-LMX8YrCficlkbW8WncrC--
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] Re: Happiness dialog - some bugs (PR#1581),
Davide Pagnin <=
|
|