bismark439
Chieftain
- Joined
- Aug 26, 2013
- Messages
- 34
Code:
---------------------------------------------------------------------
GameEvents.PlayerDoTurn.Add(function(iPlayer)
-- Only on first player's turn
if (iPlayer > 0) then
return false;
end
if (Game.GetGameTurn() == 1 ) then
DoBriefing (iPlayer);
end
end);
I made a popup called Briefing to pop out in TUrn 1
Code:
-------------------------------------------------
-- Disaster Popup
-------------------------------------------------
local lastBackgroundImage = "Test.dds"
-------------------------------------------------
-- On Popup
-------------------------------------------------
function DoBriefing (iPlayer)
local pPlayer=Players[iPlayer]
if pPlayer:IsHuman() then
Controls.DisasterImage:SetHide(false);
Controls.DisastersPopBox:SetHide(false);
Controls.DisasterBox:SetHide(false);
lastBackgroundImage = "Test.dds";
Controls.DisasterImage:SetTexture(lastBackgroundImage);
Controls.TitleLabel:LocalizeAndSetText("TXT_KEY_BRIEFING");
Controls.DescriptionLabel:LocalizeAndSetText("TXT_KEY_BRIEFING_CONTENT");
end
end
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
function OnClose()
Controls.DisasterImage:SetHide(true);
Controls.DisasterImage:UnloadTexture();
Controls.DisastersPopBox:SetHide(true);
Controls.DisasterBox:SetHide(true);
end
Controls.CloseButton:RegisterCallback( Mouse.eLClick, OnClose);
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
It shows Test.dds picture with a caption below. However, in game it does not show up.
http://cafeptthumb2.phinf.naver.net/20140611_42/lewis46_1402498028653Sfqhe_PNG/3.PNG?type=w740
This is what the lua.log says, but I dont know what the problem is. I clearly added image files but it says value is nil.
Does anyone have any idea?


