Thalassicus
Bytes and Nibblers
In GenericPopup.lua, how can I skip displaying a specific type of popup? I tried variations of this:
It works the first time the popup should display, correctly preventing the popup. When it should display a second time however, the OnDisplay function never runs at all! I checked this with a print("OnDisplay") at the top of the function. What did I do wrong?
PHP:
if initialize then
local activePlayer = Players[Game.GetActivePlayer()]
if (popupInfo.Type == ButtonPopupTypes.BUTTONPOPUP_CITY_CAPTURED
and popupInfo.Data3 == -1
and not activePlayer:CanRaze(city)
) then
-- No option but puppeting
Network.SendDoTask(popupInfo.Data1, TaskTypes.TASK_CREATE_PUPPET, -1, -1, false, false, false, false);
else
ClearButtons();
initialize(popupInfo);
ShowWindow();
mostRecentPopup = popupInfo.Type;
g_isOpen = true;
end
end
It works the first time the popup should display, correctly preventing the popup. When it should display a second time however, the OnDisplay function never runs at all! I checked this with a print("OnDisplay") at the top of the function. What did I do wrong?