-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNuggsUI.lua
111 lines (98 loc) · 4.43 KB
/
NuggsUI.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
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
local T, C, L = Tukui:unpack()
-- Move this stuff to proper files, Could probably go in a PvP module or something.
-- Maybe not. shaman addon, you cannot outrun the wind, blablblblbl when windfury procs
--[[ ]]
--local n, _, _, _, _, _, _, m, hwl, cwa, u = GetCurrencyListInfo(390) print(n.." "..m.." "..cwa)
--/run local n, a, _, tw, w, t = GetCurrencyInfo(390) print(n.." "..a.." "..tw.." "..w.." "..t)
-- Some basic things I want from my UI.
local zoneName;
local NuggsUI_Worker = CreateFrame("Frame");
function NuggsUI_Worker:PLAYER_LOGIN()
SetMapToCurrentZone();
zoneName = GetZoneText();
NuggsUI_Worker:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
NuggsUI_Worker:UnregisterEvent("PLAYER_LOGIN");
if (IsAddOnLoaded("Tukui_Datatext")) then
local UnitFrames = T.UnitFrames
local Pet = UnitFrames.Units.Pet
Pet:SetPoint("BOTTOM", UnitFrames.Anchor, "TOP", 0, 83)
end
end
-- Change some settings when entering BGs or arenas
function NuggsUI_Worker:PLAYER_ENTERING_WORLD(...)
--[[if NuggsUI_IsPvP() then
local mlook = CreateFrame("button","mlook")
mlook:RegisterForClicks("AnyDown","AnyUp")
mlook:SetScript("OnClick",function(s,b,d)
if d then
MouselookStart()
else
MouselookStop()
end
end)
SecureStateDriverManager:RegisterEvent("UPDATE_MOUSEOVER_UNIT")
local mov = CreateFrame("frame",nil,nil,"SecureHandlerStateTemplate")
RegisterStateDriver(mov,"mov","[@mouseover,exists]1;0")
mov:SetAttribute("_onstate-mov","if newstate==1 then self:SetBindingClick(1,'BUTTON2','mlook')else self:ClearBindings()end")
else
local mlook = CreateFrame("button", "mlook")
mlook:RegisterForClicks("AnyDown", "AnyUp")
mlook:SetScript("OnClick", function(s ,b, d)
if d then
MouselookStart()
else
MouselookStop()
end
end)
SecureStateDriverManager:RegisterEvent("UPDATE_MOUSEOVER_UNIT")
local mov = CreateFrame("frame", nil, nil, "SecureHandlerStateTemplate")
RegisterStateDriver(mov, "mov", "[@mouseover,exists]1;1")
mov:SetAttribute("type", "click")
end]]
if (NuggsUI_IsPvP() == 1) then
if (ObjectiveTrackerFrame:IsVisible() or ObjectiveTrackerFrame:IsShown()) then
ObjectiveTrackerFrame:Hide();
end
SetBinding("TAB","TARGETNEARESTENEMYPLAYER");
SetBinding("SHIFT-TAB","TARGETNEARESTENEMY");
else
if (not ObjectiveTrackerFrame:IsVisible() or not ObjectiveTrackerFrame:IsShown()) then
ObjectiveTrackerFrame:Show();
end
SetBinding("TAB","TARGETNEARESTENEMY");
SetBinding("SHIFT-TAB","TARGETNEARESTENEMYPLAYER");
end
end
function NuggsUI_Worker:COMBAT_LOG_EVENT_UNFILTERED(...)
local _, event, _, sourceGUID, sourceName, sourceFlags, _, destGUID, destName, destFlags, _, sourceID, _, _, spellID, spellName, spellSchool = ...
local isDestEnemy = (bit.band(destFlags, COMBATLOG_OBJECT_REACTION_HOSTILE) == COMBATLOG_OBJECT_REACTION_HOSTILE);
if bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
local enemy = UnitName(destGUID);
if event == "SPELL_INTERRUPT" and UnitIsPlayer("target") and isDestEnemy then --UnitIsEnemy("player", destName) then--UnitIsPlayer(enemy) then
SendChatMessage(">>>> Interrupt "..GetSpellLink(spellID).." ["..destName.."] <<<<", "SAY");
end
if event=="SPELL_AURA_APPLIED" then
spellId, spellName, spellSchool = select(12,...);
if spellId == 42292 or spellId == 59752 then
SendChatMessage("<<<< TRINKET USED! >>>>", "SAY");
end
end
end
if event == "SPELL_AURA_APPLIED" and isDestEnemy and zoneName ~= "Ashran" then
spellId, spellName, spellSchool = select(12,...);
if spellId == 42292 or spellId == 59752 then --if sourceGUID ~= destGUID then
SendChatMessage(">>>> TRINKET USED ".." ["..destName.."] <<<<", "SAY");
end
end
end
NuggsUI_Worker:SetScript("OnEvent", function(self, event, ...) self[event](self, ...) end);
NuggsUI_Worker:RegisterEvent("PLAYER_LOGIN");
NuggsUI_Worker:RegisterEvent("PLAYER_ENTERING_WORLD");
--[[ Implement later, mayhaps
local Tooltip = T["Tooltips"]
hooksecurefunc(Tooltip, "CreateAnchor", function()
Tooltip.Anchor:ClearAllPoints()
Tooltip.Anchor:SetPoint("BOTTOMRIGHT", RightChatBG, -5, 125)
end)
]]--
-- n,_,_,c,_,_,_,_,_,_,_,_,_,v1,v2,v3=UnitDebuff("Player", "Dampening");print(n..":".." "..c.." ".." "..v1.." "..v2.." "..v3)