Version 0.7.0-beta

- order buttons

- use numeric LogLevel over booleans
- exact case option reversed (again)
- smart case handling if replacement is longer than match

- Deletion of all mappings
This commit is contained in:
2020-06-06 14:33:06 +02:00
parent a29f6486fe
commit cb2c995a82
11 changed files with 564 additions and 357 deletions

View File

@@ -2,23 +2,28 @@
local _G = _G
local Grichelde = _G.Grichelde
-- upvalues and constants
-- constants and upvalues
Grichelde.LOG_LEVEL = {}
Grichelde.LOG_LEVEL.DEBUG = 1
Grichelde.LOG_LEVEL.TRACE = 2
Grichelde.MAPPING_OFFSET = 10
-- 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.LIGHTGRAY = "|cffC0C0C0";
Grichelde.COLOR_CODES.GRAY = _G.GRAY_FONT_COLOR_CODE or "|cff808080";
Grichelde.COLOR_CODES.DARKGRAY = "|cff404040";
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.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.LIGHTGRAY = "|cffC0C0C0"
Grichelde.COLOR_CODES.GRAY = _G.GRAY_FONT_COLOR_CODE or "|cff808080"
Grichelde.COLOR_CODES.DARKGRAY = "|cff404040"
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" }
@@ -47,6 +52,8 @@ local function spairs(t, orderFunc)
it = it + 1
if sortedKeys[it] then
return sortedKeys[it], t[sortedKeys[it]]
else
return nil
end
end
end
@@ -89,20 +96,20 @@ local function tClone(orig)
return copy
end
local function isChar(char)
return Grichelde.functions.find(char, "%a+")
local function isChar(word)
return Grichelde.functions.find(word, "%a+")
end
local function isNumber(digit)
return Grichelde.functions.find(Grichelde.functions.toString(digit), "%d+")
return Grichelde.functions.find(digit, "%d+")
end
local function isUpper(char)
return Grichelde.functions.isChar(char) and char == Grichelde.functions.toUpper(char)
local function isUpper(word)
return Grichelde.functions.isChar(word) and word == Grichelde.functions.toUpper(word)
end
local function isLower(char)
return Grichelde.functions.isChar(char) and char == Grichelde.functions.toLower(char)
local function isLower(word)
return Grichelde.functions.isChar(word) and word == Grichelde.functions.toLower(word)
end
local function isCapital(word)