-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeystoneFisher.lua
53 lines (41 loc) · 1.43 KB
/
keystoneFisher.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
52
53
-------------------------------------------------------------------------------
-- init
-- Note that the cvar value is "0" or "1" (and 0 is truthy, not falsey).
local cvarName = "autoLootDefault"
local getAutoLoot = function()
return C_CVar.GetCVar(cvarName)
end
aura_env.setAutoLoot = function(enabled)
if getAutoLoot() ~= enabled then
C_CVar.SetCVar(cvarName, enabled)
print(CreateColor(0.5, 0.5, 0.5, 0):WrapTextInColorCode(
"Keystone Fisher: "
.. (enabled == "0"
and CreateColor(1, 0, 0, 0):WrapTextInColorCode("DISABLING")
or CreateColor(0, 1, 0, 0):WrapTextInColorCode("ENABLING"))
.. " auto-loot"))
end
end
-------------------------------------------------------------------------------
-- show
local keystoneMapId = C_MythicPlus.GetOwnedKeystoneChallengeMapID()
if keystoneMapId == nil then
aura_env.setAutoLoot("0")
else
aura_env.setAutoLoot("1")
end
-------------------------------------------------------------------------------
-- hide
aura_env.setAutoLoot("1")
-------------------------------------------------------------------------------
-- TSU:
function(allstates, event, ...)
-- Always show a dummy state so that we get "On Hide" functionality for
-- free when the WeakAura unloads.
local state = {
["show"] = true,
["changed"] = true,
}
allstates[""] = state
return true
end