-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore.lua
More file actions
executable file
·69 lines (64 loc) · 1.96 KB
/
core.lua
File metadata and controls
executable file
·69 lines (64 loc) · 1.96 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
local ADDON_NAME, ns = ...
local L = ns.L
function ravGPS_OnLoad(self)
self:RegisterEvent("PLAYER_ENTERING_WORLD")
end
function ravGPS_OnEvent(self, event, arg, ...)
if event == "PLAYER_ENTERING_WORLD" then
local isInitialLogin, isReloadingUi = ...
if not RAVGPS_version then
ns:PrettyPrint(L.Install)
elseif RAVGPS_version ~= ns.version then
-- Version-specific messages go here...
end
RAVGPS_version = ns.version
self:UnregisterEvent("PLAYER_ENTERING_WORLD")
end
end
AddonCompartmentFrame:RegisterAddon({
text = ns.name,
icon = ns.icon,
registerForAnyClick = true,
notCheckable = true,
func = function(button, menuInputData, menu)
local mouseButton = menuInputData.buttonName
if mouseButton == "RightButton" then
ns:Share()
return
end
ns:Coordinates()
end,
funcOnEnter = function(menuItem)
GameTooltip:SetOwner(menuItem)
GameTooltip:SetText(ns.name .. " v" .. ns.version)
GameTooltip:AddLine(" ", 1, 1, 1, true)
GameTooltip:AddLine(L.AddonCompartmentTooltip1, 1, 1, 1, true)
GameTooltip:AddLine(L.AddonCompartmentTooltip2, 1, 1, 1, true)
GameTooltip:Show()
end,
funcOnLeave = function()
GameTooltip:Hide()
end,
})
SlashCmdList["RAVGPS"] = function(message, editbox)
local a, b, c, d
if message:match(",") then
a, b, c, d = strsplit(",", message)
else
a, b, c, d = strsplit(" ", message)
end
if a == "version" or a == "v" then
ns:PrettyPrint(L.Version)
elseif a == "h" or a:match("help") then
ns:PrettyPrint(L.Help)
elseif a == "c" or a:match("clear") then
C_Map.ClearUserWaypoint()
elseif a == "s" or a:match("share") then
ns:Share(b, c)
else
ns:Coordinates(a, b, c, d)
end
end
SLASH_RAVGPS1 = "/" .. ns.command
SLASH_RAVGPS2 = "/gps"
SLASH_RAVGPS3 = "/ravgps"