Skip Citadel Improvement Replacement Confirmation

bay

Chieftain
Joined
Mar 26, 2015
Messages
1
I made a simple adjustment to one of the LUA scripts for the game that makes planting citadels only one click -- no need to click OK to confirm you want to replace an improvement (i.e. farm, mine, etc). For multiplayer duel and teamer players this is absolutely must have. It only affects citadeling (no other great person improvements).

Code is below, this should replace the contents of the file ConfirmImprovementRebuildPopup.lua located in the directory Sid Meier's Civilization V\Assets\DLC\Expansion2\UI\InGame\PopupsGeneric\ (on windows, not sure if it's the same for mac/Linux).

Code:
-- CONFIRM IMPROVEMENT REBUILD POPUP
-- This popup occurs when the player is trying to construct an Improvement over the top of another one.
PopupLayouts[ButtonPopupTypes.BUTTONPOPUP_CONFIRM_IMPROVEMENT_REBUILD] = function(popupInfo)

	local iAction		= popupInfo.Data1;
	local iBuild		= popupInfo.Data2;
	local bAlt		= popupInfo.Option1;

	local pAction = GameInfoActions[iAction];
	local pBuild = GameInfo.Builds[iBuild];

	-- Yes click handler
	local OnYesClicked = function()
		-- Confirm action
		local gameMessagePushMission = GameMessageTypes.GAMEMESSAGE_PUSH_MISSION;
		Game.SelectionListGameNetMessage(gameMessagePushMission, pAction.MissionType, pAction.MissionData, -1, 0, bAlt);
	end

	if (pAction.Type == "BUILD_CITADEL") then
		-- Confirm citadel automatically
		OnYesClicked();
		Events.SerialEventGameMessagePopupProcessed.CallImmediate( popupInfo.Type, 0 );
		return false;
	else
		if (pAction.Type == "MISSION_FOUND") then
			popupText = Locale.ConvertTextKey("TXT_KEY_POPUP_ARE_YOU_SURE_FOUND_ON_DIG_SITE", pAction.TextKey);
			SetPopupText(popupText);
		else
			popupText = Locale.ConvertTextKey("TXT_KEY_POPUP_ARE_YOU_SURE_IMPROVEMENT_REBUILD", pAction.TextKey);
			SetPopupText(popupText);
		end

		local buttonText = Locale.ConvertTextKey("TXT_KEY_POPUP_YES");
		AddButton(buttonText, OnYesClicked)

		-- Initialize 'no' button.
		local buttonText = Locale.ConvertTextKey("TXT_KEY_POPUP_NO");
		AddButton(buttonText, nil);
	end
end
 
Top Bottom