forked from LegolandoBloom/Angleur
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
209 lines (188 loc) · 6.05 KB
/
init.lua
File metadata and controls
209 lines (188 loc) · 6.05 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
angleurDelayers = CreateFramePool("Frame", angleurDelayers, nil, function(framePool, frame)
frame:ClearAllPoints()
frame:SetScript("OnUpdate", nil)
frame:Hide()
end)
AngleurConfig = {
angleurKey,
angleurKeyModifier,
angleurKeyMain,
raftEnabled,
chosenRaft = {toyID = 0, name = 0, dropDownID = 0},
baitEnabled,
chosenBait = {itemID = 0, name = 0, dropDownID = 0},
oversizedEnabled,
crateEnabled,
chosenCrateBobber = {toyID = 0, name = 0, dropDownID = 0},
chosenMethod,
doubleClickChosenID = 2,
visualHidden,
visualLocation,
ultraFocusAudioEnabled,
ultraFocusAutoLootEnabled,
ultraFocusTurnOffInteract,
ultraFocusingAudio,
ultraFocusingAutoLoot,
}
AngleurCharacter = {
sleeping = false,
angleurSet = false
}
Angleur_CVars = {
ultraFocus = {musicOn, ambienceOn, dialogOn, effectsOn, effectsVolume, masterOn, masterVolume, backgroundOn},
autoLoot
}
AngleurMinimapButton = {
hide
}
Angleur_TinyOptions = {
turnOffSoftInteract = false,
allowDismount = false,
doubleClickWindow = 0.4,
visualScale = 1,
ultraFocusMaster = 1,
loginDisabled = false,
errorsDisabled = true,
softIconOff = false,
}
function Init_AngleurSavedVariables()
if AngleurConfig.ultraFocusAudioEnabled == nil then
AngleurConfig.ultraFocusAudioEnabled = false
end
if AngleurConfig.ultraFocusAutoLootEnabled == nil then
AngleurConfig.ultraFocusAutoLootEnabled = false
end
if AngleurConfig.chosenBait == nil then
AngleurConfig.chosenBait = {itemID = 0, name = 0, dropDownID = 0}
end
if AngleurCharacter.sleeping == nil then
AngleurCharacter.sleeping = false
end
if Angleur_TinyOptions.turnOffSoftInteract == nil then
Angleur_TinyOptions.turnOffSoftInteract = false
end
if Angleur_TinyOptions.allowDismount == nil then
Angleur_TinyOptions.allowDismount = false
end
if Angleur_TinyOptions.softTargetIcon == nil then
Angleur_TinyOptions.softTargetIcon = true
end
if Angleur_TinyOptions.doubleClickWindow == nil then
Angleur_TinyOptions.doubleClickWindow = 0.4
end
if Angleur_TinyOptions.visualScale == nil then
Angleur_TinyOptions.visualScale = 1
end
if Angleur_TinyOptions.ultraFocusMaster == nil then
Angleur_TinyOptions.ultraFocusMaster = 1
end
if Angleur_TinyOptions.loginDisabled == nil then
Angleur_TinyOptions.loginDisabled = false
end
if Angleur_TinyOptions.errorsDisabled == nil then
Angleur_TinyOptions.errorsDisabled = true
end
if AngleurMinimapButton.hide == nil then
AngleurMinimapButton.hide = false
end
if AngleurTutorial.part == nil then
AngleurTutorial.part = 1
end
end
-- 1 : Retail, 2 : Cata Classic, 3 : Classic 19 : MoP Classic (0: None, fail)
function Angleur_CheckVersion()
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
return 1
elseif WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC or WOW_PROJECT_ID == 19 then
return 2
elseif WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
return 3
end
return 0
end
-- USE TO CHECK VERSIONS
-- /run print(WOW_PROJECT_ID == WOW_PROJECT_MAINLINE and "Retail"
-- or WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC and "Cata"
-- or WOW_PROJECT_ID == WOW_PROJECT_CLASSIC and "Vanilla" or "I don't know")
function Angleur_SingleDelayer(delay, timeElapsed, elapsedThreshhold, delayFrame, cycleFunk, endFunk)
delayFrame:SetScript("OnUpdate", function(self, elapsed)
timeElapsed = timeElapsed + elapsed
if timeElapsed > elapsedThreshhold then
if cycleFunk then
if cycleFunk() == true then
--print("Breaking delayer")
self:SetScript("OnUpdate", nil)
return
end
end
delay = delay - timeElapsed
timeElapsed = 0
end
if delay <= 0 then
self:SetScript("OnUpdate", nil)
endFunk()
return
end
end)
end
angleurCombatDelayFrame = CreateFrame("Frame")
angleurCombatDelayFrame:RegisterEvent("PLAYER_REGEN_ENABLED")
angleurFunctionsQueueTable = {}
function Angleur_CombatDelayer(funk)
if InCombatLockdown() then
--print("triggered")
table.insert(angleurFunctionsQueueTable, funk)
angleurCombatDelayFrame:SetScript("OnEvent", function()
for i, funktion in pairs(angleurFunctionsQueueTable) do
funktion()
--print("executed: ", funktion)
end
angleurFunctionsQueueTable = {}
angleurCombatDelayFrame:SetScript("OnEvent", nil)
end)
else
funk()
end
end
function Angleur_PoolDelayer(delay, timeElapsed, elapsedThreshhold, delayFramePool, cycleFunk, endFunk)
local delayFrame = delayFramePool:Acquire()
delayFrame:Show()
delayFrame:SetScript("OnUpdate", function(self, elapsed)
timeElapsed = timeElapsed + elapsed
if timeElapsed > elapsedThreshhold then
if cycleFunk then
if cycleFunk() == true then
delayFramePool:Release(self)
return
end
end
delay = delay - timeElapsed
timeElapsed = 0
end
if delay <= 0 then
if endFunk then endFunk() end
delayFramePool:Release(self)
return
end
end)
end
function Angleur_BetaPrint(text, ...)
if Angleur_TinyOptions.errorsDisabled == false then
print(text, ...)
end
end
function Angleur_BetaDump(dump)
if Angleur_TinyOptions.errorsDisabled == false then
DevTools_Dump(dump)
end
end
function Angleur_BetaTableToString(tbl)
if Angleur_TinyOptions.errorsDisabled == false then
local tableToString = ""
for i, v in pairs(tbl) do
local element = "[" .. tostring(i) .. ":" .. tostring(v) .. "]"
tableToString = tableToString .. " " .. element
end
print(tableToString)
end
end