Block/Disable leader UI screen?

fcf12

Chieftain
Joined
Jan 22, 2015
Messages
14
I am working on adding functionality to the EUI mod.

Is there a way to disable the leader UI screen from poping up? I am trying to trade without using the cumbersome UI. So far what I have works but it brings up a nasty trade completed dialog with the slow to load leader screen.

Code:
local function GoldTrade ( g_targetCivID )

    print("Goldtrade");
    local g_deal2 = UI.GetScratchDeal();
    local g_iDealDuration2 = Game.GetDealDuration();

    g_deal2:SetFromPlayer(g_activePlayerID);
    g_deal2:SetToPlayer(g_targetCivID);

    g_deal2:AddGoldTrade( g_activePlayerID, 35 );
    g_deal2:AddGoldPerTurnTrade( g_targetCivID, 1, g_iDealDuration2 );

    g_deal2:AddTradeAgreement( g_activePlayerID, g_iDealDuration2 );
    g_deal2:AddTradeAgreement( g_targetCivID, g_iDealDuration2 );

    UI.DoProposeDeal();
end

Code:
lua.log dump:
[1303.434] NotificationPanel: Goldtrade
[1303.691] DiscussionDialog: Handling LeaderMessage: 12, That deal will work.


The problem is at the UI.DoProposeDeal() at the end. Basically the deal cannot finalize without it, and when you call that function the LeaderMessageHandler triggers in discussiondialog.lua. If you block that event, then you just get a leader screen with no dialogs.

How can you prevent even the leader screen from appearing to finalize a trade with the AI? Its slow as hell to load and annoying.
 
Back
Top Bottom