-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLostControl.lua
More file actions
112 lines (101 loc) · 2.84 KB
/
LostControl.lua
File metadata and controls
112 lines (101 loc) · 2.84 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
-- LostControl
-- Notifies party/raid members when you lose control of your character
local addonEnabled = true;
if(addonEnabled==true) then
local LostControlFrame = CreateFrame("FRAME", nil, UIParent);
LostControlFrame:Hide();
function LostControlOptions_OnLoad()
end
function LostControl_OnEvent(self,event,...)
local args = {...};
if(event=="ADDON_LOADED" and args[1]==LCU.addonName) then
LCcfg.init();
LCU.optionsPanel = LCOptions(LostControlFrame);
end
if(event=="PLAYER_ENTERING_WORLD") then
LCU.player.updateInstanceInfo();
LCU.player.updateRole();
LCcfg.init();
end
if(event=="LFG_ROLE_UPDATE") then
LCU.player.updateInstanceInfo();
LCU.player.updateRole();
LCU.player.updateSpec();
LCcfg.init();
end
if(event=="PLAYER_ROLES_ASSIGNED") then
LCU.player.updateInstanceInfo();
LCU.player.updateRole();
LCU.player.updateSpec();
LCcfg.init();
end
if(event=="ACTIVE_TALENT_GROUP_CHANGED") then
LCU.player.updateSpec();
end
if(event=="PLAYER_LOGOUT") then
end
if(event=="COMBAT_LOG_EVENT_UNFILTERED") then
end
end
LostControlFrame:SetScript("OnEvent",LostControl_OnEvent);
LostControlFrame:RegisterEvent("ADDON_LOADED");
LostControlFrame:RegisterEvent("PLAYER_ENTERING_WORLD");
LostControlFrame:RegisterEvent("LFG_ROLE_UPDATE");
LostControlFrame:RegisterEvent("PLAYER_ROLES_ASSIGNED");
LostControlFrame:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED");
LostControlFrame:RegisterEvent("PLAYER_LOGOUT");
LostControlFrame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
StaticPopupDialogs["LC_DEBUFF_TEST"] = {
text = "Which debuff do you want to test?",
button1 = "Accept",
button2 = "Cancel",
OnAccept = function(self)
local dbType = self.editBox:GetText();
Debuffs.test(dbType);
end,
timeout = 0,
whileDead = true,
hideOnEscape = true,
preferredIndex = 3,
hasEditBox = true,
enterClicksFirstButton = true,
}
local charJumped = 0
local fallAnnounced = 0
local function jumpAscendHook(arg1)
charJumped = 1
fallingFrames = 0
end
hooksecurefunc('JumpOrAscendStart',jumpAscendHook)
local total = 0
local fallingFrames = 0;
local function onUpdate(self,elapsed)
total = total + elapsed
if total >= 0.25 then
checkDebuffs()
if(LCcfg.watching('falling')) then
local falling = IsFalling()
if(falling and charJumped==0) then fallingFrames = fallingFrames+1; end
if(falling and charJumped==0 and fallAnnounced==0 and fallingFrames >= 10) then
LCU.announcePlayer('is airborne')
fallAnnounced = 1
end
if(falling == nil or falling == false) then
charJumped = 0
if(fallingFrames>15 and fallAnnounced) then LCU.announcePlayer('has landed'); end
fallAnnounced = 0
fallingFrames = 0
end
end
total = 0
end
end
local f = CreateFrame("frame")
f:SetScript("OnUpdate", onUpdate)
end
if(addonEnabled==false) then
function LostControlOptions_OnLoad()
end
function LostControl_OnUpdate()
end
end