No popups bug (but only for game that was never loaded)

Pazyryk

Deity
Joined
Jun 13, 2008
Messages
3,584
Not getting popups for goody huts or for meeting city states. Strangely, I only have this problem in a new game that has never been loaded. The problem does not exist at all for a game that was loaded, even from turn 0.

I'm aware of this developer comment for the hotfix:
Spoiler :
[MODDING NOTE]
Modders need to ensure they are calling the SerialEventGameMessagePopupProcessed event immediately with pop-ups.

The first parameter of this event must be the popup type that is closing, so that the game knows it can show any other popups in the queue. This can be done by explicitly sending the popup type that was opened, e.g. ButtonPopupTypes.BUTTONPOPUP_GOODY_HUT_REWARD, or when the popup handles the SerialEventGameMessagePopup message and determines that it will handle the popup, the popup type is saved off in a global. The latter is needed if the code handles more than one popup type, but is preferred even if the code handles one type. That method will ensure that the code works in all cases. The example below is from ReligionOverview.lua and shows how the popup type is saved off, then re-used when sending the SerialEventGameMessagePopupProcessed. The relevant changes are in red:

Code:
[COLOR="#FF0000"]local g_PopupInfo = nil;[/COLOR]

function OnPopupMessage(popupInfo)
      
      local popupType = popupInfo.Type;
      if popupType ~= ButtonPopupTypes.BUTTONPOPUP_RELIGION_OVERVIEW then
            return;
      end
      
      if(not Game.IsOption(GameOptionTypes.GAMEOPTION_NO_RELIGION)) then
            [COLOR="#FF0000"]g_PopupInfo = popupInfo;[/COLOR]
      
            if( g_PopupInfo.Data1 == 1 ) then
            if( ContextPtr:IsHidden() == false ) then
                  OnClose();
                  else
                  UIManager:QueuePopup( ContextPtr, PopupPriority.eUtmost );
            end
            else
                  UIManager:QueuePopup( ContextPtr, PopupPriority.SocialPolicy );
            end         
      end
end
Events.SerialEventGameMessagePopup.Add( OnPopupMessage );


function ShowHideHandler( bIsHide, bInitState )
    if( not bInitState ) then
        if( not bIsHide ) then
                UI.incTurnTimerSemaphore();  
                Events.SerialEventGameMessagePopupShown(g_PopupInfo);                 
                TabSelect(g_CurrentTab);
        else
           [COLOR="#FF0000"] if(g_PopupInfo ~= nil) then
             Events.SerialEventGameMessagePopupProcessed.CallImmediate(g_PopupInfo.Type, 0);
            end[/COLOR]
            UI.decTurnTimerSemaphore();
        end
   end
end
ContextPtr:SetShowHideHandler( ShowHideHandler );
[/QUOTE]
...although I think it might be relevant, I can't for the life of me figure out how. Frankly I don't understand the dev comment. My installed ReligionOverview.lua is dated 11/25 and does not have the first red line of text. (Did I not get the hotfix?) I added this and the other red text in my modded ReligionOverview.lua, but doesn't seem to make any difference with or without it.

Anyone have any ideas? I can't see what would be different about a loaded vs a never loaded game with respect to popups. There is no error messege when the popup doesn't happen, --and all other effects of the event seem to be normal.
 
Not getting popups for goody huts or for meeting city states. Strangely, I only have this problem in a new game that has never been loaded. The problem does not exist at all for a game that was loaded, even from turn 0.

I'm seeing the same (and this is in games without any mods) - after an unknown event (may be founding a pantheon), I'll no longer get popups until I pick a policy, then I'll get all the missing popups in one go!
 
Only thing I've noticed, is that sometimes a notification icon refuses to go away, but assumed it was likely to do with me testing a mod.
 
Back
Top Bottom