Back to Home

ESO Lua File v100027

ingame/questtoolmonitor/questtoolmonitor.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
ACTIVE_QUEST_TOOL_MONITOR_SYSTEM = nil
ZO_ActiveQuestToolMonitor = ZO_Object:Subclass()
function ZO_ActiveQuestToolMonitor:New(...)
    local qtm = ZO_Object.New(self)
    qtm:Initialize(...)
    return qtm
end
function ZO_ActiveQuestToolMonitor:Initialize(control)
    self.prompt = control:GetNamedChild("Prompt")
    EVENT_MANAGER:RegisterForEvent(control:GetName() .. "_OnActiveQuestToolChanged", EVENT_ACTIVE_QUEST_TOOL_CHANGED, function(...) self:OnActiveQuestToolChanged(...) end)
    EVENT_MANAGER:RegisterForEvent(control:GetName() .. "_OnActiveQuestToolRemoved", EVENT_ACTIVE_QUEST_TOOL_CLEARED, function(...) self:OnActiveQuestToolRemoved(...) end)
end
function ZO_ActiveQuestToolMonitor:OnActiveQuestToolChanged(eventCode, journalIndex, toolIndex)
    local _, _, _, questToolName = GetQuestToolInfo(journalIndex, toolIndex)
    self.prompt:SetText(zo_strformat(GetString(SI_QUEST_USE_QUEST_ITEM_PROMPT), questToolName))
end
function ZO_ActiveQuestToolMonitor:OnActiveQuestToolRemoved(eventCode)
    self.prompt:SetText("")
end
    ACTIVE_QUEST_TOOL_MONITOR_SYSTEM = ZO_ActiveQuestToolMonitor:New(control)
end