-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOmegaMapHotSpot.lua
More file actions
81 lines (69 loc) · 2.64 KB
/
OmegaMapHotSpot.lua
File metadata and controls
81 lines (69 loc) · 2.64 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
-- ///////////////////////////////////////////////////////////////////////////////////////////
--Omega Map Options Frame & Controls
--Omega Map Hotspot Code
-- ///////////////////////////////////////////////////////////////////////////////////////////
local OmegaMap = select(2, ...)
local L = LibStub("AceLocale-3.0"):GetLocale("OmegaMap")
OmegaMap = LibStub("AceAddon-3.0"):GetAddon("OmegaMap")
local Config = OmegaMap_Config
local HotSpotState = false
--Toggles the Display of the HotSpot Button
function OmegaMap:HotSpotToggle(value)
if value then
OmegaMapHotSpotFrame:Show()
else
OmegaMapHotSpotFrame:Hide()
end
end
if not OmegaMapHotSpot then
OmegaMapHotSpotFrame = CreateFrame("Button", "OmegaMapHotSpot", UIParent, "BackdropTemplate")
end
--Initializes the HotSpot Button Attributes
function OmegaMap:HotSpotInit()
OmegaMapHotSpotFrame:SetMovable(true)
OmegaMapHotSpotFrame:SetUserPlaced(true)
OmegaMapHotSpotFrame:ClearAllPoints()
OmegaMapHotSpotFrame:SetPoint("CENTER");
OmegaMapHotSpotFrame:SetWidth(25)
OmegaMapHotSpotFrame:SetHeight(25)
OmegaMapHotSpotFrame:SetFrameStrata("DIALOG")
OmegaMapHotSpotFrame:SetClampedToScreen( true )
OmegaMapHotSpotFrame:SetScript("OnMouseDown", function() OmegaMapHotSpotFrame:StartMoving() end)
OmegaMapHotSpotFrame:SetScript("OnMouseUp", function() OmegaMapHotSpotFrame:StopMovingOrSizing() end)
OmegaMapHotSpotFrame:SetScript("OnEnter", function() OmegaMap:HotSpotMapToggle(true) HotSpotState = true end)
OmegaMapHotSpotFrame:SetScript("OnLeave", function() OmegaMap:HotSpotMapToggle() HotSpotState = false end)
OmegaMapHotSpotFrame:SetScript("OnClick", function()
if Config.hotSpotLock == true then
Config.hotSpotLock = false
else
Config.hotSpotLock = true
end
end);
OmegaMapHotSpotFrame:SetBackdrop({
bgFile = "Interface/Tooltips/UI-Tooltip-Background",
edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
tile = true, tileSize = 32, edgeSize = 16,
insets = { left = 5, right = 5, top = 5, bottom = 5 },
})
OmegaMapHotSpotFrame:SetBackdropColor(0,0,0, 0.95)
OmegaMapHotSpotFrame:SetNormalTexture("Interface\\Icons\\INV_Misc_Map04")
end
function OmegaMap:HotSpotMapToggle(state)
if state == true and OmegaMapFrame:IsVisible()then
if OmegaMap.Config.fullHotSpotAlpha then
OmegaMapFrame_SetOpacity(0)
end
return
elseif Config.hotSpotLock == true then
if OmegaMap.Config.fullHotSpotAlpha then
OmegaMapFrame_SetOpacity(OmegaMap.Config.opacity)
end
return
elseif OmegaMap.Config.fullHotSpotAlpha and not OmegaMapFrame:IsVisible() then
OmegaMapFrame_SetOpacity(0)
ToggleOmegaMap()
else
OmegaMapFrame_SetOpacity(OmegaMap.Config.opacity)
ToggleOmegaMap()
end
end