Re: [Freeciv-Dev] (PR#40765) Freeciv-2.1.9-win32 Help Browser reports Wonders obsoleted by their required technology

2009-04-29 Thread Marko Lindqvist

http://bugs.freeciv.org/Ticket/Display.html?id=40765 >

2009/4/22 Marko Lindqvist :
> 2009/4/12 Daniel Doran :
>>
>> The Freeciv Help browser shows, for all Wonders (at least in the default
>> ruleset)  "Requirement: 0" and "Obsolete by: " {the technology required
>> to build the wonder}
>
>  Attached patch should fix this along some potential crashes.

 S2_1 version


 - ML

diff -Nurd -X.diff_ignore freeciv/client/gui-win32/helpdlg.c freeciv/client/gui-win32/helpdlg.c
--- freeciv/client/gui-win32/helpdlg.c	2008-01-22 03:47:26.0 +0200
+++ freeciv/client/gui-win32/helpdlg.c	2009-04-30 01:00:54.0 +0300
@@ -492,6 +492,7 @@
 		get_req_source_text(&preq->source, req_buf,
 		sizeof(req_buf)));
   i++;
+  break;
 } requirement_vector_iterate_end;
 /*create_tech_tree(help_improvement_tree, 0, imp->tech_req, 3);*/
   }
@@ -522,8 +523,6 @@
 
 sprintf(buf, "%d", impr_build_shield_cost(which));
 SetWindowText(help_ilabel[1], buf);
-sprintf(buf, "%d", imp->upkeep);
-SetWindowText(help_ilabel[3], buf);
 
 /* FIXME: this should show ranges and all the MAX_NUM_REQS reqs. 
  * Currently it's limited to 1 req but this code is partially prepared
@@ -531,12 +530,19 @@
  * definition. */
 i = 0;
 requirement_vector_iterate(&imp->reqs, preq) {
-  SetWindowText(help_ilabel[5 + i],
+  SetWindowText(help_ilabel[3 + i],
 		get_req_source_text(&preq->source, req_buf,
 		sizeof(req_buf)));
   i++;
+  break;
 } requirement_vector_iterate_end;
-/*create_tech_tree(help_improvement_tree, 0, imp->tech_req, 3);*/
+if (imp->obsolete_by != A_LAST) {
+  SetWindowText(help_ilabel[5],
+advance_name_for_player(game.player_ptr,
+imp->obsolete_by));
+} else {
+  SetWindowText(help_ilabel[5], _("None"));
+}
   }
   else {
 /* can't find wonder */
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40765) Freeciv-2.1.9-win32 Help Browser reports Wonders obsoleted by their required technology

2009-04-22 Thread Marko Lindqvist

http://bugs.freeciv.org/Ticket/Display.html?id=40765 >

2009/4/12 Daniel Doran :
>
> The Freeciv Help browser shows, for all Wonders (at least in the default
> ruleset)  "Requirement: 0" and "Obsolete by: " {the technology required
> to build the wonder}

 Attached patch should fix this along some potential crashes. It
(cross-)compiles, but I cannot test it at the moment.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/gui-win32/helpdlg.c freeciv/client/gui-win32/helpdlg.c
--- freeciv/client/gui-win32/helpdlg.c	2009-02-20 16:39:24.0 +0200
+++ freeciv/client/gui-win32/helpdlg.c	2009-04-22 16:42:01.0 +0300
@@ -494,6 +494,7 @@
 		universal_name_translation(&preq->source, req_buf,
 		sizeof(req_buf)));
   i++;
+  break;
 } requirement_vector_iterate_end;
 /*create_tech_tree(help_improvement_tree, 0, imp->tech_req, 3);*/
   }
@@ -524,8 +525,6 @@
 
 sprintf(buf, "%d", impr_build_shield_cost(imp));
 SetWindowText(help_ilabel[1], buf);
-sprintf(buf, "%d", imp->upkeep);
-SetWindowText(help_ilabel[3], buf);
 
 /* FIXME: this should show ranges and all the MAX_NUM_REQS reqs. 
  * Currently it's limited to 1 req but this code is partially prepared
@@ -533,11 +532,20 @@
  * definition. */
 i = 0;
 requirement_vector_iterate(&imp->reqs, preq) {
-  SetWindowText(help_ilabel[5 + i],
+  SetWindowText(help_ilabel[3 + i],
 		universal_name_translation(&preq->source, req_buf,
 		sizeof(req_buf)));
   i++;
+  break;
 } requirement_vector_iterate_end;
+if (valid_advance(imp->obsolete_by)) {
+  SetWindowText(help_ilabel[5],
+advance_name_for_player(client.conn.playing,
+	advance_number(imp->obsolete_by)));
+} else {
+  SetWindowText(help_ilabel[5], _("None"));
+}
+
 /*create_tech_tree(help_improvement_tree, 0, imp->tech_req, 3);*/
   }
   else {
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#40765) Freeciv-2.1.9-win32 Help Browser reports Wonders obsoleted by their required technology

2009-04-11 Thread Madeline Book

http://bugs.freeciv.org/Ticket/Display.html?id=40765 >

> [dado...@sbcglobal.net - Sun Apr 12 05:51:02 2009]:
> 
> Version: Freeciv-2.1.9-win32  running on Windows XP pro
> 
> The Freeciv Help browser shows, for all Wonders (at least
> in the default ruleset)  "Requirement: 0" and "Obsolete by: "
> {the technology required to build the wonder}

This is surely a bug in the win32 client code, but I am
unsure if anyone is maintaining that client version anymore
(I am surprised that it compiles and that someone even made
an exe package for it).

Unfortunately I cannot compile win32 code so I cannot help
in this instance. Until someone with a windows machine
fixes this, might I suggest you try the (windows) gtk version?


---
作家であることは難しいね。

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#40765) Freeciv-2.1.9-win32 Help Browser reports Wonders obsoleted by their required technology

2009-04-11 Thread Daniel Doran

http://bugs.freeciv.org/Ticket/Display.html?id=40765 >

Version: Freeciv-2.1.9-win32  running on Windows XP pro

The Freeciv Help browser shows, for all Wonders (at least in the default 
ruleset)  "Requirement: 0" and "Obsolete by: " {the technology required 
to build the wonder}


<>___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev