City Banner Refresh

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 :
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:

sparrow8332

Chieftain
Joined
Nov 23, 2016
Messages
12
any help would be greatly appreciated.
In Tuner it refreshed the city banner to display the new population just fine but when executed from the mod as able it dose add population just dose not show it until next turn or if you complete production on the city
 

Gedemon

Modder
Super Moderator
Joined
Oct 4, 2004
Messages
10,914
Location
France
It may be possible to force a call to an event that is in turn used in the city banner file to refresh it.

Or you'll have to either edit the city banner file itself to make it update on your event (or use an UI add-on to that file), but of course with the possible incompatibilities with UI mods.
 

__jack__

Warlord
Joined
Dec 29, 2009
Messages
141
Hi sparrow,

i am interested also by a way to refresh the city banner (and ressource icons) after I have used ui.temporaryrevealplots()

have you been able to solve it in the UI script?
 
Top Bottom