You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
3.7 KiB
Lua
94 lines
3.7 KiB
Lua
4 years ago
|
-- read namespace from global env
|
||
|
local _G = _G
|
||
|
local Grichelde = _G.Grichelde
|
||
|
|
||
|
-- upvalues and constants
|
||
|
|
||
|
-- faster function lookups by mapping to local refs
|
||
|
Grichelde.functions = {}
|
||
|
Grichelde.functions.type = _G.type
|
||
|
Grichelde.functions.print = _G.print
|
||
|
Grichelde.functions.pairs = _G.pairs
|
||
|
Grichelde.functions.ipairs = _G.ipairs
|
||
|
Grichelde.functions.tContains = _G.tContains
|
||
|
Grichelde.functions.tFilter = function(t, cond, extr)
|
||
|
local filtered = {}
|
||
|
for key, value in Grichelde.functions.pairs(t) do
|
||
|
if cond(key, value) then
|
||
|
local val = extr(key, value)
|
||
|
Grichelde.functions.tInsert(filtered, #filtered + 1, val)
|
||
|
end
|
||
|
end
|
||
|
return filtered
|
||
|
end
|
||
|
Grichelde.functions.tInsert = _G.table.insert
|
||
|
Grichelde.functions.tConcat = _G.table.concat
|
||
|
Grichelde.functions.select = _G.select
|
||
|
Grichelde.functions.unpack = _G.unpack
|
||
|
Grichelde.functions.find = _G.string.find
|
||
|
Grichelde.functions.sub = _G.string.sub
|
||
|
Grichelde.functions.gsub = _G.string.gsub
|
||
|
Grichelde.functions.match = _G.strmatch
|
||
|
Grichelde.functions.join = _G.strjoin
|
||
|
Grichelde.functions.toLower = _G.strlower
|
||
|
Grichelde.functions.toUpper = _G.strupper
|
||
|
Grichelde.functions.format = _G.string.format
|
||
|
Grichelde.functions.rep = _G.string.rep
|
||
|
Grichelde.functions.trim = _G.strtrim
|
||
|
Grichelde.functions.length = _G.string.len
|
||
|
Grichelde.functions.toString = _G.tostring
|
||
|
|
||
|
-- colors:
|
||
|
Grichelde.COLOR_CODES = {}
|
||
|
Grichelde.COLOR_CODES.PREFIX = "|c00FFAA00"
|
||
|
-- https://github.com/stoneharry/Misc-WoW-Stuff/blob/master/EoC%20Interface/FrameXML/Constants.lua
|
||
|
Grichelde.COLOR_CODES.NORMAL = _G.NORMAL_FONT_COLOR_CODE or "|cffffd200";
|
||
|
Grichelde.COLOR_CODES.HIGHLIGHT = _G.HIGHLIGHT_FONT_COLOR_CODE or "|cffffffff";
|
||
|
Grichelde.COLOR_CODES.RED = _G.RED_FONT_COLOR_CODE or "|cffff2020";
|
||
|
Grichelde.COLOR_CODES.GREEN = _G.GREEN_FONT_COLOR_CODE or "|cff20ff20";
|
||
|
Grichelde.COLOR_CODES.GRAY = _G.GRAY_FONT_COLOR_CODE or "|cff808080";
|
||
|
Grichelde.COLOR_CODES.YELLOW = _G.YELLOW_FONT_COLOR_CODE or "|cffffff00";
|
||
|
Grichelde.COLOR_CODES.LIGHTYELLOW = _G.LIGHTYELLOW_FONT_COLOR_CODE or "|cffffff9a";
|
||
|
Grichelde.COLOR_CODES.ORANGE = _G.ORANGE_FONT_COLOR_CODE or "|cffff7f3f";
|
||
|
Grichelde.COLOR_CODES.CLOSE = _G.FONT_COLOR_CODE_CLOSE or "|r";
|
||
|
|
||
|
Grichelde.slashCommands = { "/s", "/say", "/e", "/em", "/me", "/emote", "/y", "/yell", "/sh", "/shout", "/p", "/party", "/pl", "/partyleader", "/g", "/gc", "/guild", "/o", "/osay", "/officer", "/raid", "/rsay", "/rl", "/raidleader", "/rw", "/raidwarning", "/i", "/instance", "/bg", "/battleground", "/w", "/whisper", "/t", "/tell", "/send", "/r", "/reply" }
|
||
|
|
||
|
Grichelde.defaultConfig = {
|
||
|
global = {},
|
||
|
profile = {
|
||
|
enabled = true,
|
||
|
channels = {
|
||
|
["*"] = false,
|
||
|
say = true,
|
||
|
emote = false,
|
||
|
yell = true,
|
||
|
party = true,
|
||
|
partyLeader = true,
|
||
|
guild = true,
|
||
|
officer = true,
|
||
|
},
|
||
|
replacements = {
|
||
|
["**"] = {
|
||
|
searchText = "",
|
||
|
replaceText = "",
|
||
|
caseSensitive = false,
|
||
|
consolidate = true,
|
||
|
},
|
||
|
replacement_0 = {
|
||
|
order = 1,
|
||
|
searchText = "s",
|
||
|
replaceText = "ch",
|
||
|
caseSensitive = false,
|
||
|
consolidate = true,
|
||
|
},
|
||
|
replacement_1 = {
|
||
|
order = 2,
|
||
|
searchText = "t",
|
||
|
replaceText = "ck",
|
||
|
caseSensitive = false,
|
||
|
consolidate = true,
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|