This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Progress.lua
executable file
·51 lines (40 loc) · 1.6 KB
/
Progress.lua
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
local addonName, addon = ...
local Module = {}
addon.Progress = Module
local function getPlayerLastActivityInfo()
local playerGUID = UnitGUID("player")
local playerInfo = Dragtheron_WelcomeBack.KnownCharacters[playerGUID]
if not playerInfo or not playerInfo.currentActivityIndex then
return
end
local lastPlayerActivityInfo = playerInfo.Activities[playerInfo.currentActivityIndex]
if not lastPlayerActivityInfo or not lastPlayerActivityInfo.Activity then
return
end
return lastPlayerActivityInfo
end
local function getProgressInfo(lastActivity)
local activityName = addon.HaveWeMet.GetActivityTitle(lastActivity)
local titleString = format("Current Activity: |cffffffff%s|r", activityName)
local playerLastActivityInfo = getPlayerLastActivityInfo()
local activityInfo = playerLastActivityInfo
and playerLastActivityInfo
or {
Activity = lastActivity,
Encounters = {},
}
return titleString, activityInfo
end
function Module.IsKeystoneActivity(activity)
return activity.KeystoneLevel
end
function Module.GetActivityProgress(activity)
local titleString, activityInfo = getProgressInfo(activity)
local detailsString = addon.HaveWeMet.GetDetailsString(activityInfo, true)
return detailsString, titleString, activityInfo
end
function Module.GetKeystoneProgress(activity)
local titleString, activityInfo = getProgressInfo(activity)
local details = addon.HaveWeMet.GetDetails(activityInfo, true)
return details, titleString, activityInfo
end