Back to Home

ESO Lua File v100018

ingame/stuck/stuck.lua

[◄ back to folders ]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
local Stuck = ZO_Stuck_Base:Subclass()
function Stuck:New(...)
    return ZO_Stuck_Base.New(self, ...)
end
function Stuck:Initialize(...)
    ZO_Stuck_Base.Initialize(self, ...)
end
function Stuck:ShowConfirmDialog()
    local warn = true    
    if(CanUseStuck(warn)) then
        local cost = zo_min(GetRecallCost(), GetCarriedCurrencyAmount(CURT_MONEY))
        if DoesCurrentZoneHaveTelvarStoneBehavior() then
            ZO_Dialogs_ShowDialog("CONFIRM_STUCK_WITH_TELVAR_COST", nil, { mainTextParams = { cost, zo_iconFormat("EsoUI/Art/currency/currency_gold.dds", 16, 16), zo_floor(GetTelvarStonePercentLossOnNonPvpDeath() * 100) } } )
        else
            ZO_Dialogs_ShowDialog("CONFIRM_STUCK", nil, { mainTextParams = { cost, zo_iconFormat("EsoUI/Art/currency/currency_gold.dds", 16, 16) } } )
        end
    end
end
function Stuck:ShowFixingDialog()
    ZO_Dialogs_ShowDialog("FIXING_STUCK")
end
function Stuck:HideFixingDialog()
    ZO_Dialogs_ReleaseDialog("FIXING_STUCK")
end
--Events
function Stuck:OnPlayerActivated()
    if(IsStuckFixPending()) then
        self:ShowFixingDialog()
    end
end
function Stuck:OnStuckBegin()
end
function Stuck:OnStuckCanceled()
end
function Stuck:OnStuckComplete()
end
-- handling these to technically handle every stuck event if functionality is desired later, but PC informs the user via the chat window / C++ code
end
function Stuck:OnStuckErrorInvalidLocation()
end
function Stuck:OnStuckErrorInCombat()
end
function Stuck:OnStuckErrorOnCooldown()
end
STUCK = Stuck:New()
SYSTEMS:RegisterKeyboardObject(ZO_STUCK_NAME, STUCK)