Hi all!
I have come across a real weird thing. In my Lord of the Rings scenarios, by clicking a button "start encounter", i call to the following LuaEvent:
The event is registered in a EncounterPopup.lua / EncounterPopup.xml ...
and responses correctly. It executes...
it shows the popup correctly...
then everything works well, I close the popup with a button...
it closes, so it executes well the following code...
Afterwards, a WEIRD behaviour. The stack of the game ("Choose production") doesn't get updated. I select in everycity the production, but the "Choose production" message doesn't disappear. When I click on it, it points me to the same city, again and again. And it does have already a project selected, but anyway, "Choose production" doesn't let me to do anything else.
I have tried to check if the Player is paused, if there are lua errors. NOTHING. Firetuner doesn't show anything.
Any idea of what could be causing the block?
Thanks in advance.
I have come across a real weird thing. In my Lord of the Rings scenarios, by clicking a button "start encounter", i call to the following LuaEvent:
Code:
LuaEvents.OnEncounter(iEncounterID);
The event is registered in a EncounterPopup.lua / EncounterPopup.xml ...
Code:
LuaEvents.OnEncounter.Add(OnPopupEncounter);
and responses correctly. It executes...
Code:
function OnPopupEncounter(iEncounterID)
--CONFIGURES POPUP DATA / IMAGES
ContextPtr:SetHide( false );
Game.SetPausePlayer(Game.GetActivePlayer());
Controls.EncounterPopupGrid:SetHide(false);
unit = UI.GetHeadSelectedUnit();
...
--SHOW POPUP
OpenPopup();
end
it shows the popup correctly...
Code:
function OpenPopup()
ContextPtr:SetHide( false );
Controls.EncounterPopupGrid:SetHide(false);
Debug("EncountersClicked called to show popup");
UIManager:QueuePopup( ContextPtr, PopupPriority.InGameUtmost );
end
then everything works well, I close the popup with a button...
Code:
Controls.btnClose:RegisterCallback( Mouse.eLClick, Close );
it closes, so it executes well the following code...
Code:
function Close()
local newCursor = GameInfoTypes[GameInfo.InterfaceModes[InterfaceModeTypes.INTERFACEMODE_SELECTION].CursorType];
UIManager:SetUICursor(newCursor);
Events.ClearHexHighlights();
UIManager:DequeuePopup( ContextPtr );
Controls.EncounterPopupGrid:SetHide(true);
ContextPtr:SetHide( true );
Game.SetPausePlayer(-1);
Debug("EncountersClicked called to close");
end
Afterwards, a WEIRD behaviour. The stack of the game ("Choose production") doesn't get updated. I select in everycity the production, but the "Choose production" message doesn't disappear. When I click on it, it points me to the same city, again and again. And it does have already a project selected, but anyway, "Choose production" doesn't let me to do anything else.
I have tried to check if the Player is paused, if there are lua errors. NOTHING. Firetuner doesn't show anything.
Any idea of what could be causing the block?
Thanks in advance.