I am a beginner modder and I can't resolve how to close a popup window, code is as follows:
Everything works perfectly and even the player receives 5000 gold but I can not close the window, do not know if I need a function onback() but not how to do.
Would greatly appreciate your help.
Spoiler :
if (Game.GetGameTurnYear() >= 1492) then
local popupInfo = {
Data1 = 500,
Type = ButtonPopupTypes.BUTTONPOPUP_TEXT,
}
popupInfo.Text = Locale.ConvertTextKey("TXT_KEY_VICTORIA_SPAIN_TEXT");
UI.AddPopup(popupInfo);
player:ChangeGold(5000);
local popupInfo = {
Data1 = 500,
Type = ButtonPopupTypes.BUTTONPOPUP_TEXT,
}
popupInfo.Text = Locale.ConvertTextKey("TXT_KEY_VICTORIA_SPAIN_TEXT");
UI.AddPopup(popupInfo);
player:ChangeGold(5000);
Everything works perfectly and even the player receives 5000 gold but I can not close the window, do not know if I need a function onback() but not how to do.
Would greatly appreciate your help.