Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display economy values as decimals in unit viewer (FAForever#6282)
## Description of the proposed changes Displays the mass/energy production of a unit as a decimal value in the unit viewer, with appropriate precision for the number. This makes the effects of adjacency more visible. Idea first popped up on [Discord](https://discord.com/channels/197033481883222026/1224799508249055395/1226247496112799855), but this uses the new engine patch for `GetRolloverInfo` (FAForever/FA-Binary-Patches#75) instead of the `UserUnit:GetEconData` that I'm assuming was used in that example. ## Testing done on the proposed changes Before testing, make sure to go to the client and launch a FAF Develop lobby to download the latest exe. Spawned an air grid with fabs/radars/storages and moused over the various buildings and over the factories building different units to make sure that how the numbers are displayed makes sense. <details> <summary> Spawn units command </summary> ``` CreateUnitAtMouse('uab1101', 0, -8.56, -19.86, -0.00012) CreateUnitAtMouse('xsb1201', 0, -0.56, 22.14, 0.00000) CreateUnitAtMouse('xsb1105', 0, 1.44, -11.86, 0.00000) CreateUnitAtMouse('xsb1101', 0, -14.56, 4.14, 0.00000) CreateUnitAtMouse('xsb1201', 0, -16.56, 0.14, -0.00003) CreateUnitAtMouse('uab1101', 0, -4.56, -19.86, -0.00014) CreateUnitAtMouse('xsb1105', 0, -2.56, -15.86, -0.00002) CreateUnitAtMouse('ueb1106', 0, -24.56, -11.86, -0.00588) CreateUnitAtMouse('xsb1105', 0, -2.56, -17.86, 0.00000) CreateUnitAtMouse('xsb1105', 0, -2.56, -13.86, 0.00000) CreateUnitAtMouse('ueb1106', 0, 17.44, 28.14, 0.00000) CreateUnitAtMouse('ueb1106', 0, 13.44, 24.14, 0.00000) CreateUnitAtMouse('ueb1106', 0, -12.56, -3.86, -0.00002) CreateUnitAtMouse('xsb1101', 0, -2.56, -11.86, 0.00000) CreateUnitAtMouse('ueb1104', 0, -4.56, 6.14, 0.00000) CreateUnitAtMouse('xsb1301', 0, 0.44, 9.14, 0.00000) CreateUnitAtMouse('ueb1106', 0, -8.56, 12.14, 0.00000) CreateUnitAtMouse('ueb1106', 0, -20.56, -11.86, -0.00388) CreateUnitAtMouse('uab3101', 0, 3.44, 16.14, 0.00000) CreateUnitAtMouse('ueb1106', 0, 19.44, 8.14, 0.00000) CreateUnitAtMouse('xsb1303', 0, -0.56, 16.14, 0.00000) CreateUnitAtMouse('xsb1303', 0, -8.56, 8.14, 0.00000) CreateUnitAtMouse('xsb1301', 0, -7.56, -14.86, -0.00005) CreateUnitAtMouse('xsb1301', 0, 0.44, -6.86, 0.00000) CreateUnitAtMouse('ueb1104', 0, -12.56, 2.14, 0.00000) CreateUnitAtMouse('ueb1106', 0, -10.56, -23.86, -0.00107) CreateUnitAtMouse('xsb1303', 0, -22.56, -15.86, -0.00519) CreateUnitAtMouse('ueb1104', 0, -4.56, 12.14, 0.00000) CreateUnitAtMouse('ueb1104', 0, -4.56, 8.14, 0.00000) CreateUnitAtMouse('ueb1104', 0, -4.56, 10.14, 0.00000) CreateUnitAtMouse('xsb1101', 0, -20.56, -19.86, -0.00388) CreateUnitAtMouse('xsb1303', 0, -14.56, -7.86, -0.00024) CreateUnitAtMouse('xsb1105', 0, 5.44, -3.86, 0.00000) CreateUnitAtMouse('uab3101', 0, 3.44, 21.14, 0.00000) CreateUnitAtMouse('xsb1105', 0, 5.44, -9.86, 0.00000) CreateUnitAtMouse('ueb1106', 0, 19.44, 10.14, 0.00000) CreateUnitAtMouse('xsb1303', 0, 17.44, 24.14, 0.00000) CreateUnitAtMouse('xsb0302', 0, -7.56, -6.86, 0.00000) CreateUnitAtMouse('xsb1303', 0, 23.44, 18.14, 0.00000) CreateUnitAtMouse('uab3101', 0, -6.56, -19.86, 0.00006) CreateUnitAtMouse('ueb1106', 0, -16.56, -25.86, -0.00452) CreateUnitAtMouse('ueb1106', 0, -12.56, -25.86, -0.00218) CreateUnitAtMouse('ueb1106', 0, -14.56, -25.86, -0.00292) CreateUnitAtMouse('ueb1106', 0, -10.56, -21.86, -0.00043) CreateUnitAtMouse('ueb1106', 0, -10.56, -19.86, -0.00016) CreateUnitAtMouse('ueb1106', 0, 25.44, 14.14, 0.00000) CreateUnitAtMouse('xsb1105', 0, 13.44, 2.14, 0.00000) CreateUnitAtMouse('xsb1105', 0, 13.44, 0.14, 0.00000) CreateUnitAtMouse('ueb1106', 0, 27.44, 16.14, 0.00000) CreateUnitAtMouse('ueb1106', 0, 23.44, 14.14, 0.00000) CreateUnitAtMouse('ueb1106', 0, 15.44, 6.14, 0.00000) CreateUnitAtMouse('xsb1303', 0, 9.44, 16.14, 0.00000) CreateUnitAtMouse('ueb1106', 0, 17.44, 6.14, 0.00000) CreateUnitAtMouse('ueb1106', 0, 27.44, 18.14, 0.00000) CreateUnitAtMouse('xsb1105', 0, 13.44, 4.14, 0.00000) CreateUnitAtMouse('ueb1106', 0, 13.44, 6.14, 0.00000) CreateUnitAtMouse('xsb1105', 0, 3.44, 14.14, 0.00000) CreateUnitAtMouse('xsb1301', 0, 8.44, 1.14, 0.00000) CreateUnitAtMouse('xsb1105', 0, 13.44, -1.86, 0.00000) CreateUnitAtMouse('xsb0302', 0, -15.56, -14.86, 0.00000) CreateUnitAtMouse('ueb1104', 0, -12.56, 0.14, 0.00000) CreateUnitAtMouse('xsb1301', 0, -7.56, 1.14, 0.00000) CreateUnitAtMouse('xsb0302', 0, 0.44, 1.14, 0.00000) CreateUnitAtMouse('xsb0302', 0, 24.44, 25.14, 0.00000) CreateUnitAtMouse('ueb1104', 0, -12.56, -1.86, -0.00002) CreateUnitAtMouse('xsb0302', 0, 16.44, 17.14, 0.00000) CreateUnitAtMouse('xsb0302', 0, 8.44, 9.14, 0.00000) CreateUnitAtMouse('xsb1303', 0, -14.56, -21.86, -0.00162) CreateUnitAtMouse('xsb1303', 0, 15.44, 10.14, 0.00000) CreateUnitAtMouse('ueb1104', 0, -12.56, 4.14, 0.00000) CreateUnitAtMouse('ueb1106', 0, -6.56, 12.14, 0.00000) CreateUnitAtMouse('ueb1106', 0, -22.56, -11.86, -0.00524) CreateUnitAtMouse('xsb1301', 0, -5.56, -24.86, -0.00018) CreateUnitAtMouse('xsb1301', 0, -5.56, -24.86, -0.00051) CreateUnitAtMouse('xsb1201', 0, 9.44, -5.86, 0.00000) CreateUnitAtMouse('uab1101', 0, 5.44, 21.14, 0.00000) CreateUnitAtMouse('ueb1106', 0, -4.56, 14.14, 0.00000) ``` </details> ## Additional context <!-- Add any other context about the pull request here. --> A further improvement would be adding how much of the production/consumption change comes from the adjacency bonus. ## Checklist - [x] Changes are annotated, including comments where useful - [x] Changes are documented in the changelog for the next game version
- Loading branch information