[2.0.28] Technologies with a finite max_level sometimes not displaying correctly
Posted: Mon Dec 30, 2024 1:07 pm
Consider the Steel Plate Productivity technology, and suppose we haven't research it yet.
Note that whether or not the upgrade field is true has no affect on the above, neither does researching the technology (the text above the coloured square changes appropriately, but the coloured square itself doesn't change).
Moreover, technologies that already have a number in their name (e.g. artillery-shell-range-1) do not have this problem (I.e. when setting their max_level to a finite value, they display like #3 above),
- In Vanilla, we have:
Which gives you:
Code: Select all
data.raw["technology"]["steel-plate-productivity"].max_level == "infinite"
- Now I want to change it to only have 2 levels (instead of infinite):
It does not however display correctly:
Code: Select all
data.raw["technology"]["steel-plate-productivity"].max_level = 2
- In contrast, if I rename the technology to end with a -<number>, it works as expected:
data.raw["technology"]["steel-plate-productivity"].name = "steel-plate-productivity-1"
data.raw["technology"]["steel-plate-productivity"].max_level = 2
data:extend{data.raw["technology"]["steel-plate-productivity"]}
data.raw["technology"]["steel-plate-productivity"] = nil
Which displays correctly:
Note that whether or not the upgrade field is true has no affect on the above, neither does researching the technology (the text above the coloured square changes appropriately, but the coloured square itself doesn't change).
Moreover, technologies that already have a number in their name (e.g. artillery-shell-range-1) do not have this problem (I.e. when setting their max_level to a finite value, they display like #3 above),