I'm working on a mod that includes new yield types. The new yields are added to the database, but I don't know how to have them display in the UI. As a test, I added the new yields to the palace building, but it doesn't show up in the overview panel. I found the <Stack ID="BuildingAndDistrictsStack" ...> tag in CityPanelOverview.xml (I'm using the CQUI mod, which is awesome btw), but it looks like it might be assembled via Lua.
I think I found the relevant lua code in CityPanelOverview.lua (243):
Any assistance would be appreciated.
Edit: It seems there is a bit of hard-codedness going on regarding yields. I'm finding a bit of code scattered around that uses variables for each yield type, and that implies I may need to touch each of those files...sigh. Also, there are a lot of references to YieldTypes.X, but I can't find where the YieldTypes variable is defined. Is this hard-coded somewhere in the engine?
I think I found the relevant lua code in CityPanelOverview.lua (243):
local yieldString:string = "";
for _,kYield in ipairs(building.Yields) do
kInstanceBuild.BuildingYield:SetText( yieldString );
For some reason, it isn't displaying the new yields, although I see the rows in the database. Is there another table I need to adjust besides Building_YieldChanges?for _,kYield in ipairs(building.Yields) do
yieldString = yieldString .. GetYieldString(kYield.YieldType,kYield.YieldChange);
endkInstanceBuild.BuildingYield:SetText( yieldString );
Any assistance would be appreciated.
Edit: It seems there is a bit of hard-codedness going on regarding yields. I'm finding a bit of code scattered around that uses variables for each yield type, and that implies I may need to touch each of those files...sigh. Also, there are a lot of references to YieldTypes.X, but I can't find where the YieldTypes variable is defined. Is this hard-coded somewhere in the engine?
Last edited: