This repository has been archived by the owner on Jan 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore.lua
166 lines (145 loc) · 5.48 KB
/
core.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
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
------------------------------------------------------------------------
-- Look In Teh Corner! --
-- Big thanks to haste's oMinimap on which this is based.
-- I mainly added coordinates, changed some positions,
-- but as per his copyright thingie, the addon has changed name.
-- I would like to thank Lyn for the awesome name.
------------------------------------------------------------------------
------------------------------------------------------------------------
-- Configuration and lessening the typing strains of the world.
------------------------------------------------------------------------
local font = STANDARD_TEXT_FONT
local scale = 1.1
local backdrop = {
bgFile = "Interface\\Buttons\\WHITE8x8",
insets = { left = -2, right = -2, top = -2, bottom = -2}
}
local backdropColor = { r = .1, g = .1, b = .1, a = .9 }
local showZoneText = true -- true shows zonetext
-- This is needed to properly ping the minimap
function GetMinimapShape() return "SQUARE" end
-- Frame creation and event handler
local LookInTehCorner = CreateFrame("Frame", "LookInTehCorner", Minimap)
LookInTehCorner:SetScript('OnEvent', function(self, event, ...) self[event](self, ...) end)
LookInTehCorner:RegisterEvent"PLAYER_LOGIN"
local hiddenFrames = {
MinimapBorder,
MinimapBorderTop,
MinimapToggleButton,
MinimapZoomIn,
MinimapZoomOut,
MiniMapTrackingBackground,
MiniMapBattlefieldBorder,
MiniMapMeetingStoneFrame,
MiniMapVoiceChatFrame,
MiniMapWorldMapButton,
MiniMapMailBorder,
BattlegroundShine,
MiniMapZoneTextButton,
GameTimeFrame,
MinimapNorthTag
}
------------------------------------------------------------------------
-- Util funcs
------------------------------------------------------------------------
function LookInTehCorner:GetLocTextColor()
local pvpType = GetZonePVPInfo()
if pvpType == "arena" then
return 0.84, 0.03, 0.03
elseif pvpType == "friendly" then
return 0.05, 0.85, 0.03
elseif pvpType == "contested" then
return 0.9, 0.85, 0.05
elseif pvpType == "hostile" then
return 0.84, 0.03, 0.03
elseif pvpType == "sanctuary" then
return 0.035, 0.58, 0.84
elseif pvpType == "combat" then
return 0.84, 0.03, 0.03
else
return 0.84, 0.03, 0.03
end
end
------------------------------------------------------------------------
-- PLAYER LOGIN func - the main shebang
------------------------------------------------------------------------
function LookInTehCorner:PLAYER_LOGIN(...)
Minimap:ClearAllPoints()
Minimap:SetParent(UIParent)
Minimap:SetPoint("TOPRIGHT", -10, -10)
Minimap:SetBackdrop(backdrop)
Minimap:SetBackdropColor(0, 0, 0)
Minimap:SetScale(scale)
Minimap:SetMaskTexture("Interface\\ChatFrame\\ChatFrameBackground")
Minimap:SetArchBlobRingScalar(0)
Minimap:SetQuestBlobRingScalar(0)
-- Scrolling with mousewheel
Minimap:EnableMouseWheel()
Minimap:SetScript("OnMouseWheel", function(self, dir)
if(dir > 0) then
Minimap_ZoomIn()
else
Minimap_ZoomOut()
end
end)
MiniMapTrackingIconOverlay:SetAlpha(0)
MiniMapTrackingButtonBorder:Hide()
MiniMapTracking:Hide()
MinimapNorthTag:SetAlpha(0)
-- Mail icon changes
MiniMapMailIcon:SetTexture("Interface\\AddOns\\LookInTehCorner\\media\\mail") -- remove this line if you want the default mail icon to show
MiniMapMailFrame:ClearAllPoints()
MiniMapMailFrame:SetPoint("BOTTOM", Minimap,"BOTTOM", 0, 0)
MiniMapMailFrame:SetSize(50, 20)
MiniMapMailFrame:SetScale(1 / scale)
-- MiniMapMailIcon:SetTexture("")
MiniMapMailBorder:SetTexture("")
-- Minimap.mailText = MiniMapMailFrame:CreateFontString(nil, "OVERLAY", "NumberFontNormal")
-- Minimap.mailText:SetPoint("BOTTOM")
-- Minimap.mailText:SetTextColor(1, 0.9, 0.8)
-- Minimap.mailText:SetText("Mail!")
-- Garrison icon
GarrisonLandingPageMinimapButton:ClearAllPoints()
GarrisonLandingPageMinimapButton:SetPoint("TOPRIGHT", Minimap, 3, 2)
GarrisonLandingPageMinimapButton:SetScale(0.7)
GarrisonLandingPageMinimapButton:SetAlpha(0)
GarrisonLandingPageMinimapButton:SetScript('OnEnter', function(self) self:SetAlpha(100) end) -- Hover it Appears! Magic!!
GarrisonLandingPageMinimapButton:SetScript('OnLeave', function(self) self:SetAlpha(0) end) -- Hover Disapears!
-- Minimap zone text stuff.
if (showZoneText) then
MinimapZoneText:SetParent(Minimap)
MinimapZoneText:SetDrawLayer"OVERLAY"
MinimapZoneText:ClearAllPoints()
MinimapZoneText:SetPoint("TOPLEFT", Minimap, 5, 0)
MinimapZoneText:SetPoint("TOPRIGHT", Minimap, -5, 0)
MinimapZoneText:SetFont(font, 10)
MinimapZoneText:SetJustifyH("CENTER")
else
MinimapZoneText:Hide()
end
-- World PvP Frame
if (WorldStateCaptureBar) then
WorldStateCaptureBar:ClearAllPoints()
WorldStateCaptureBar:SetPoint("TOP", UIParent, "TOP", -75, -50)
WorldStateCaptureBar.SetPoint = function() end
WorldStateCaptureBar.ClearAllPoints = function() end
end
MiniMapInstanceDifficulty:ClearAllPoints()
MiniMapInstanceDifficulty:Hide()
GuildInstanceDifficulty:ClearAllPoints()
GuildInstanceDifficulty:Hide()
QueueStatusMinimapButton:ClearAllPoints()
QueueStatusMinimapButton:SetParent(Minimap)
QueueStatusMinimapButton:SetPoint("TOPLEFT", Minimap, 1, -1)
-- Frame hiding
for _, frame in pairs(hiddenFrames) do
frame:Hide()
end
hiddenFrames = nil
self:UnregisterEvent"ADDON_LOADED"
end
function LookInTehCorner:ZONE_CHANGED(...)
MinimapZoneText:SetTextColor(LookInTehCorner:GetLocTextColor())
self:RegisterEvent"ZONE_CHANGED_INDOORS"
self:RegisterEvent"ZONE_CHANGED_NEW_AREA"
end