-
Notifications
You must be signed in to change notification settings - Fork 0
/
patches.lua
136 lines (122 loc) · 4.03 KB
/
patches.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
local addon, dark_addon = ...
-- local function _RemoveTalent(id)
-- if dark_addon.adv_protected then
-- RemoveTalent(id)
-- else
-- secured = false
-- while not secured do
-- RunScript([[
-- for index = 1, 500 do
-- if not issecure() then
-- return
-- end
-- end
-- RemoveTalent("]] .. id .. [[")
-- secured = true
-- ]])
-- end
-- end
-- end
-- local function _LearnTalent(id)
-- if dark_addon.adv_protected then
-- LearnTalent(id)
-- else
-- secured = false
-- while not secured do
-- RunScript([[
-- for index = 1, 500 do
-- if not issecure() then
-- return
-- end
-- end
-- LearnTalent("]] .. id .. [[")
-- secured = true
-- ]])
-- end
-- end
-- end
-- local hookedTalents = false
-- local frame = CreateFrame('Frame')
-- frame:RegisterEvent("ADDON_LOADED")
-- frame:SetScript("OnEvent", function(self, event, addon)
-- if addon == "Blizzard_TalentUI" then
-- if not hookedTalents then
-- hooksecurefunc("PlayerTalentFrameTalent_OnClick", function(self, button)
-- for i = 1, #self:GetParent().talents do
-- _RemoveTalent(self:GetParent().talents[i]:GetID())
-- _RemoveTalent(self:GetParent().talents[i]:GetID())
-- UIErrorsFrame:Clear()
-- end
-- C_Timer.After(0.45, function()
-- _LearnTalent(self:GetID())
-- end)
-- end)
-- end
-- hookedTalents = true
-- end
-- end)
local function hide_block(...)
StaticPopup1:Hide()
end
function StaticPopup_OnShow(self)
if self.which ~= 'MACRO_ACTION_FORBIDDEN' and self.which ~= 'ADDON_ACTION_FORBIDDEN' and self.which ~= 'ADDON_ACTION_BLOCKED' then
PlaySound(SOUNDKIT.IG_MAINMENU_OPEN);
end
local dialog = StaticPopupDialogs[self.which];
local OnShow = dialog.OnShow;
if ( OnShow ) then
OnShow(self, self.data);
end
if ( dialog.hasMoneyInputFrame ) then
_G[self:GetName().."MoneyInputFrameGold"]:SetFocus();
end
if ( dialog.enterClicksFirstButton ) then
self:SetScript("OnKeyDown", StaticPopup_OnKeyDown);
end
end
function StaticPopup_OnHide(self)
if self.which ~= 'MACRO_ACTION_FORBIDDEN' and self.which ~= 'ADDON_ACTION_FORBIDDEN' and self.which ~= 'ADDON_ACTION_BLOCKED' then
PlaySound(SOUNDKIT.IG_MAINMENU_CLOSE);
end
StaticPopup_CollapseTable();
local dialog = StaticPopupDialogs[self.which];
local OnHide = dialog.OnHide;
if ( OnHide ) then
OnHide(self, self.data);
end
self.extraFrame:Hide();
if ( dialog.enterClicksFirstButton ) then
self:SetScript("OnKeyDown", nil);
end
if ( self.insertedFrame ) then
self.insertedFrame:Hide();
self.insertedFrame:SetParent(nil);
local text = _G[self:GetName().."Text"];
_G[self:GetName().."MoneyFrame"]:SetPoint("TOP", text, "BOTTOM", 0, -5);
_G[self:GetName().."MoneyInputFrame"]:SetPoint("TOP", text, "BOTTOM", 0, -5);
end
end
function C_Timer.NewAdvancedTicker(duration, callback, iterations)
local ticker = setmetatable({}, TickerMetatable);
ticker._duration = duration;
ticker._remainingIterations = iterations;
ticker._callback = function()
if ( not ticker._cancelled ) then
callback(ticker);
--Make sure we weren't cancelled during the callback
if ( not ticker._cancelled ) then
if ( ticker._remainingIterations ) then
ticker._remainingIterations = ticker._remainingIterations - 1;
end
if ( not ticker._remainingIterations or ticker._remainingIterations > 0 ) then
C_Timer.After(ticker._duration, ticker._callback);
end
end
end
end;
C_Timer.After(ticker._duration, ticker._callback);
return ticker;
end
dark_addon.event.register("MACRO_ACTION_FORBIDDEN", hide_block)
dark_addon.event.register("ADDON_ACTION_FORBIDDEN", hide_block)
dark_addon.event.register("ADDON_ACTION_BLOCKED", hide_block)