Follow-up Comment #2, bug #15563 (project freeciv):
> (A similar issue applies to
client_warming_sprite()/client_cooling_sprite(); however, I've not attempted
to fix these, because (frankly) I can't work out what they're meant to do at
the moment. So these will still get more alarmist with bigger maps.)
These functions define the icon used to indicate the chance of global warming
/ nuclear winter. There are NUM_TILES_PROGRESS (= 8) icons available in
./data/misc/small.png so there are 8 levels.
Now you could replace the calculations within these to functions by your
functions global_warming_percentages() / nuclear_winter_percentages() and use
index = chance / 14. This will result in the following indices:
0 - 13: index 0
14 - 27: index 1
84 - 97: index 6
> 97 : index 7 (100% chance for a change)
At the end limit the index to 0..NUM_TILES_PROGRESS-1 as done in the code
index = CLIP(0, index, NUM_TILES_PROGRESS - 1);
Comment to the code: please move variable definition to the start of the
function ('int chance, rate;' in get_info_label_text_popup()).
Notice to myself: This patch or patch #1505 has to be rebased if the other is
Reply to this item at:
Nachricht geschickt von/durch Gna!
Freeciv-dev mailing list