whoward69
DLL Minion
This tutorial shows how to replace a standard popup with a custom one
Locate your popup pair of files (one .xml and one .lua)
We are going to mod the GoodyHutPopup.lua/xml pair
Copy the pair to your mod, rename them (eg MyGoodyHutPopup.lua/xml) and add them as an InGameUIAddin - do NOT set VFS=true
Open the C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization V\Assets\DLC\Expansion2\UI\InGame\InGame.xml file (or whichever one is appropriate for the version of the game you're playing) and locate the <LuaContext> line of your donor popup and make a note of its ID value (GoodyHutPopup in this case) - this is usually the same as the filename but NOT always!
Make any changes needed to the XML file, eg changing the top icon. We'll just change AncientRuinsPopupTop300.dds to GoldenAgePopupTop300.dds - it doesn't line up correctly but it'll prove the point!
Open the Lua file, locate the SerialEventGameMessagePopup event handler, and note the ButtonPopupTypes referenced (BUTTONPOPUP_GOODY_HUT_REWARD in this case)
Replace the SerialEventGameMessagePopup event handler with
where XYZ and ABC are the values noted above, eg, for the GoodyHutPopup it would be
Replace the SetShowHideHandler handler with
eg, for the GoodyHutPopup
Finally, replace any occurances of
with
there should be at least one attached to the Close/OK button.
The attached "My - Changes" mod replaces both the Goody Hut and Barbie Camp popups
[END]
Locate your popup pair of files (one .xml and one .lua)
- For BNW, start your search in C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization V\Assets\DLC\Expansion2\UI\InGame\Popups
- For G&K, start your search in C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization V\Assets\DLC\Expansion\UI\InGame\Popups
- If you can't find one or other of them, look in C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization V\Assets\UI\InGame\Popups
We are going to mod the GoodyHutPopup.lua/xml pair
Copy the pair to your mod, rename them (eg MyGoodyHutPopup.lua/xml) and add them as an InGameUIAddin - do NOT set VFS=true
Open the C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization V\Assets\DLC\Expansion2\UI\InGame\InGame.xml file (or whichever one is appropriate for the version of the game you're playing) and locate the <LuaContext> line of your donor popup and make a note of its ID value (GoodyHutPopup in this case) - this is usually the same as the filename but NOT always!
Make any changes needed to the XML file, eg changing the top icon. We'll just change AncientRuinsPopupTop300.dds to GoldenAgePopupTop300.dds - it doesn't line up correctly but it'll prove the point!
Open the Lua file, locate the SerialEventGameMessagePopup event handler, and note the ButtonPopupTypes referenced (BUTTONPOPUP_GOODY_HUT_REWARD in this case)
Replace the SerialEventGameMessagePopup event handler with
Code:
function SuppressPopup(popupInfo)
if (popupInfo.Type == ButtonPopupTypes.BUTTONPOPUP_XYZ) then
m_PopupInfo = popupInfo
UIManager:DequeuePopup(ContextPtr:LookUpControl("/InGame/ABC"))
ContextPtr:SetHide(false)
end
end
Events.SerialEventGameMessagePopup.Add(SuppressPopup)
where XYZ and ABC are the values noted above, eg, for the GoodyHutPopup it would be
Code:
function SuppressPopup(popupInfo)
if (popupInfo.Type == ButtonPopupTypes.BUTTONPOPUP_GOODY_HUT_REWARD) then
m_PopupInfo = popupInfo
UIManager:DequeuePopup(ContextPtr:LookUpControl("/InGame/GoodyHutPopup"))
ContextPtr:SetHide(false)
end
end
Events.SerialEventGameMessagePopup.Add(SuppressPopup)
Replace the SetShowHideHandler handler with
Code:
function ShowHideHandler(bIsHide, bInitState)
if (not bInitState) then
if (not bIsHide) then
-- Update any controls here, eg new text strings
-- If more than a handful of lines, add them to a function and call the function here
end
end
end
ContextPtr:SetShowHideHandler(ShowHideHandler)
eg, for the GoodyHutPopup
Code:
function ShowHideHandler(bIsHide, bInitState)
if (not bInitState) then
if (not bIsHide) then
-- Update any controls here, eg new text strings
Controls.DescriptionLabel:SetText("Woo hoo!!! We found something!");
end
end
end
ContextPtr:SetShowHideHandler(ShowHideHandler)
Finally, replace any occurances of
Code:
UIManager:DequeuePopup( ContextPtr );
with
Code:
ContextPtr:SetHide(true)
there should be at least one attached to the Close/OK button.
The attached "My - Changes" mod replaces both the Goody Hut and Barbie Camp popups
[END]