forked from jamesb93/RegionFilter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.lua
38 lines (32 loc) · 965 Bytes
/
utils.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
local RF = select(2, ...)
RF.consolePrefix = "|cff00ffff[Region Filter]:|r "
function RF:regionTag(label, activity, regionColour)
-- Creates and colours the REGION tag
return regionColour..'['..label..']|r '..activity
end
function RF:dungeonText(playerRegion, listRegion)
-- Colours the activity name if its in an ideal region
if playerRegion == listRegion then
return 0, 1, 1
else
return 0.75, 0.75, 0.75
end
end
function RF:sanitiseName(leaderName)
-- returns name, realm when passed a name-realm full name
if string.match(leaderName, "-") then
local name, realm = strsplit("-", leaderName, 2)
local realm = realm:gsub("'", "")
return name, realm
else
local name = leaderName
local realm = RF.myRealm
return name, realm
end
end
function RF:splitName(leaderName)
-- returns name, realm when passed a name-realm full name
local name, realm = strsplit("-", leaderName, 2)
local realm = realm:gsub("'", "")
return name, realm
end