sparrow8332
Chieftain
- Joined
- Nov 23, 2016
- Messages
- 12
Im trying to refresh the city banner after population change as it only refreshes after next turn or city production complete. Has anyone got any tips or a way off forcing a refresh on the city banner ?
script lua :
UI lua
its just been making my brain ache so many thanks
script lua :
Code:
function ChangePopulation(playerID, pNewPopulation, pCity)
local pPlayer = Players[playerID]
if iPlayer == playerID then
local pCity = pPlayer:GetCities():FindID(iCity)
if pCity ~= nil then
pCity:ChangePopulation(pNewPopulation);
end
end
end
function Initialize()
if ( not ExposedMembers.Add_Population) then ExposedMembers.Add_Population = {}; end
ExposedMembers.Add_Population.ChangePopulation = ChangePopulation;
end
Initialize();
UI lua
Code:
function ChangePopulation()
local pCity = UI.GetHeadSelectedCity();
if pCity ~= nil and pPlayer:IsHuman() then
ExposedMembers.Add_Population.ChangePopulation(playerID, pNewPopulation, pCity);
end
end
its just been making my brain ache so many thanks
Last edited: