Strange numbers in selection_details.js
Default values should be rounded (like in gui/common/tooltips.js)
Differential D3657
Fixed round typo in selection_details.js nwtour on Mar 9 2021, 10:58 AM. Authored by
Details
Strange numbers in selection_details.js Default values should be rounded (like in gui/common/tooltips.js) .
Diff Detail
Event TimelineComment Actions please keep in mind value in simulation can be 0.4 in this case it would show 0, what is wrong, therefore in simulation we rather use ceil to not have entities with non 0 hp existing and running around. Comment Actions I didn't make it up myself. The adjacent file (binaries/data/mods/public/gui/common/tooltips.js) uses:
As I understand it, some technologies give a buff. I don’t know why they are used from the beginning of the game, but this is a standard game function Comment Actions I know you did not made rounding up :)
Comment Actions I completely agree with your arguments about the fact that the human brain perceives 0 as UNDEFINED and it is better to round it up I updated the patch to make it clear how I see it One parameter in different windows must be the same Round values are desirable This patch solves this issues. Comment Actions i cant agree with this change. GetTechModifiedProperty run on start of match and params should be natural numbers the type of the value or parameter it needs / should be is defined in the template schema. there are several values which need to stay floats (gather rates for example) and should not be forced to be integers. Comment Actions
variables are the same, displaying is different, that means how they are displayed needs to be unified, hence proposed global function which would returned correctly rounded values to be displayed in gui Comment Actions My competence in the project and in English is not enough for this process. I can offer moral support ;-)
If the idea is clear (do not start up unjustified EPSILON from modifications at the init stage) and it has prospects, I can start studying the issue... Comment Actions every entity is defined by components such as Attack, Resources, UnitAI and so on. For in game health, the damage calculation is decimal due to fact how armour is calculated so health is decimal number. In fact it have been integer but have been changed to be decimal (some years ago) probably due to change which have been made to the armour as it works currently. But stayed to display as integer because it looks nicer and not too important to see that unit has 500.032 health, just 500 is enough. now, when displaying in gui (your initial differential), coder usually knows what the number should looks like (how many decimal places to display) Comment Actions Ok. It will solve issue. I'll then leave a way to reproduce the bug: cp binaries/data/mods/public/simulation/data/technologies/civbonuses/greek_structures.json binaries/data/mods/public/simulation/data/technologies/civbonuses/greek_structures2.json |