killmeplease
Mk Z on Steam
Hello!
I'm trying to modify the CitiView xml and lua files. What i want is to add an another indicator in the upper-left corner
changes to CityView.xml:
changes to CityView.lua:
and its not working, my indicator isnt shown at the city screen.
i set improt to VFS to true for the both files
lua log says "attempt to index a nil field, line 1434". i assume that means ProsperityLabel is nil.
when i tried to add CityView.xml to the Content section as a CityViewUIAddin, the game crashed upon load.
what am i doing wrong?
thanks!
I'm trying to modify the CitiView xml and lua files. What i want is to add an another indicator in the upper-left corner
changes to CityView.xml:
Code:
<!-- Faith Info -->
<Box Offset="0,0" Anchor="L,T" Size="240,32" Color="255,255,255,0" ID="FaithBox">
<Label Anchor="L,C" Offset="6,0" String="[ICON_PEACE]"/>
<Label Anchor="L,C" Offset="32,0" String="TXT_KEY_CITYVIEW_FAITH_TEXT" Font="TwCenMT20" FontStyle="Shadow"/>
<Label ID="FaithPerTurnLabel" Anchor="R,C" String="" Font="TwCenMT20" FontStyle="Shadow"/>
<Box Anchor="L,B" Color="27.53.64.255" Offset="4,0" Size="240,1"/>
</Box>
<!-- EMIGRATION MOD: Prosperity Info -->
[COLOR="DarkGreen"] <Box Offset="0,0" Anchor="L,T" Size="240,32" Color="255,255,255,0" ID="ProsperityBox">
<Label Anchor="L,C" Offset="6,0" String="[ICON_FLOWER]"/>
<Label Anchor="L,C" Offset="32,0" String="TXT_KEY_CITYVIEW_PROSPERITY_TEXT" Color0="128.128.128.255" Color1="0.0.0.128" Color2="255.255.200.255" Font="TwCenMT20" FontStyle="Shadow"/>
<Label ID="ProsperityLabel" Anchor="R,C" String="" Font="TwCenMT20" FontStyle="Shadow"/>
<Box Anchor="L,B" Color="27.53.64.255" Offset="4,0" Size="240,1"/>
</Box>[/COLOR]
changes to CityView.lua:
Code:
if (Game.IsOption(GameOptionTypes.GAMEOPTION_NO_RELIGION)) then
Controls.FaithPerTurnLabel:SetText( Locale.ConvertTextKey("TXT_KEY_CITYVIEW_OFF") );
else
local iFaithPerTurn = pCity:GetFaithPerTurn();
Controls.FaithPerTurnLabel:SetText( Locale.ConvertTextKey("TXT_KEY_CITYVIEW_PERTURN_TEXT", iFaithPerTurn) );
end
[COLOR="darkgreen"] -- EMIGRATION MOD --
local prosp = 0;
for i = 0, 3, 1 do
prosp = prosp + pCity:GetYieldRateTimes100(i);
end
prosp = prosp / 100;
prosp = prosp + pCity:GetJONSCulturePerTurn();
prosp = prosp + pCity:GetGreatPeopleRate();
prosp = prosp / pCity:GetPopulation(); -- calc average per citizen
prosp = prosp * GameInfo.EmigrationSettings["WealthFactor"].Value / 100;
Controls.ProsperityLabel:SetText( Locale.ConvertTextKey("TXT_KEY_CITYVIEW_PERTURN_TEXT", prosp) ); -- line 1434
--------------------
[/COLOR]
and its not working, my indicator isnt shown at the city screen.
i set improt to VFS to true for the both files
lua log says "attempt to index a nil field, line 1434". i assume that means ProsperityLabel is nil.
when i tried to add CityView.xml to the Content section as a CityViewUIAddin, the game crashed upon load.
what am i doing wrong?
thanks!