1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Popup won't open via UIManager:QueuePopup

Discussion in 'Mod Creation Help' started by Infixo, Mar 1, 2018.

  1. Infixo

    Infixo Warlord

    Jan 9, 2016
    I am trying to open UnitPromotionPopup using LuaEvents.UnitPanel_PromoteUnit(). Very simple event that ends up calling OnPromoteUnitPopup() in UPP.lua that prepares data and eventually calls UIManager:QueuePopup(ContextPtr, PopupPriority.Current) to open a window.

    You can fire the event in FireTuner and it always goes into OnPromoteUnitPopup(). If the unit has an available promotion, it properly queues the popup. I've checked that using UIManager:IsInPopupQueue(ContextPtr).

    Now the problem. The window only opens if the unit is already selected on the map. And I want to do the following:
    xxx is ofc a unit id, but a different one. The selection works - another unit is selected (checked with UI.GetHeadSelectedUnit()), event is called, OnPromoteUnitPopup() properly detects selcted unitt (yes! it knows that a new unit is selcted), popup is queued (again, checked that) but the window doesn't open. What gives? What am I missing in this sequence?

Share This Page

Ebates: Get Paid to Shop