-
Notifications
You must be signed in to change notification settings - Fork 1
/
System.lua
executable file
·99 lines (84 loc) · 2.85 KB
/
System.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
local addonName, ATOM = ...
local Module = ATOM:NewModule('System')
local defaultCVarValues = {
autoDismountFlying = 1,
autoLootDefault = 1,
assistAttack = 1,
rotateMinimap = 0,
screenEdgeFlash = 1,
threatPlaySounds = 1,
emphasizeMySpellEffects = 1,
autoQuestWatch = 1,
autoQuestProgress = 1,
mapFade = 0,
countdownForCooldowns = 1,
SoftTargetEnemy = 3,
SoftTargetInteract = 3,
UnitNameOwn = 1,
UnitNameNPC = 1,
UnitNameEnemyPetName = 0,
UnitNameFriendlyPetName = 0,
UnitNameFriendlySpecialNPCName = 0,
-- playerStatusText = 1,
-- targetStatusText = 1,
showToastOnline = 1,
showToastOffline = 0,
scriptErrors = 1,
}
local viewIndex, disableOrderHallCommandBar, disableZygorMapButtonAndMenu
function Module:OnInitialize()
for key, value in pairs(defaultCVarValues) do
SetCVar(key, tostring(value))
end
-- MinimapZoomIn:Hide()
-- MinimapZoomOut:Hide()
-- hooksecurefunc('OrderHall_LoadUI', disableOrderHallCommandBar)
-- hooksecurefunc('OrderHall_CheckCommandBar', disableOrderHallCommandBar)
self:SetView(2)
-- inject a frame/texture with ZygorGuideViewer minimap icon so Leatrix can detect the texture
local zygorMinimapIcon = CreateFrame('Frame', 'LeatrixZygorGuidesViewerMapIcon', UIParent)
zygorMinimapIcon.texture = zygorMinimapIcon:CreateTexture('ZygorGuidesViewerMapIconIcon', 'BACKGROUND')
zygorMinimapIcon.texture:SetTexture('Interface\\AddOns\\ATOM\\Textures\\ZygorMinimapIcon')
zygorMinimapIcon:Show()
hooksecurefunc(WorldMapFrame, 'Show', disableZygorMapButtonAndMenu)
end
function disableOrderHallCommandBar()
if OrderHallCommandBar then
OrderHallCommandBar:SetScript('OnShow', nil)
OrderHallCommandBar:SetScript('OnHide', nil)
OrderHallCommandBar:UnregisterAllEvents()
OrderHallCommandBar:Hide()
end
end
function disableZygorMapButtonAndMenu()
if ZygorWorldMapMenu then
ZygorWorldMapMenu:Hide()
ZygorPoiMapButton:Hide()
end
end
function Module:SetView(index)
if index then
viewIndex = index
else
viewIndex = viewIndex == 3 and 2 or 3
end
-- Calling SetView twice will prevent the slow transition and
-- instead switch immediately to the view
SetView(viewIndex)
SetView(viewIndex)
end
function Module:SetVolume(volumeLevel)
if volumeLevel == false then
volumeLevel = tonumber(GetCVar('Sound_MasterVolume')) > 0.5 and 10 or 100
end
SetCVar('Sound_MasterVolume', tostring(volumeLevel / 100))
ATOM:Print('Volume set to |cff00ff00%d|r', volumeLevel)
end
--[[
-- Temporary fix for 5.3.0 addon errors related to the changes to
-- the PlaySound and sound kits ids being required
local origPlaySound = PlaySound
function PlaySound(snd, a0, a1, a2)
pcall(function() origPlaySound(snd, a0, a1, a2) end)
end
]]