Version 0.9.0-rc1

- enable/disable from slash command
- matching conditions (never, always, start, end, start or end)
- support capturing groups
- import examples
- testing capabilities
- compatibility with WoW Retail
- adapted help texts
- spelling errors
This commit is contained in:
2020-07-16 12:54:06 +02:00
parent cc4df96bac
commit bafb116bb9
39 changed files with 3043 additions and 1049 deletions

View File

@@ -1,11 +1,11 @@
-- read namespace from global env
local _G = _G
local Grichelde = _G.Grichelde
local Grichelde = _G.Grichelde or {}
local pairs, tInsert, tClone, unpack, join, toString
= Grichelde.functions.pairs, Grichelde.functions.tInsert, Grichelde.functions.tClone, Grichelde.functions.unpack, Grichelde.functions.join, Grichelde.functions.toString
= Grichelde.F.pairs, Grichelde.F.tInsert, Grichelde.F.tClone, Grichelde.F.unpack, Grichelde.F.join, Grichelde.F.toString
function Grichelde:GetDefaultConfig()
function Grichelde.getDefaultConfig()
return {
global = {},
profile = {
@@ -24,12 +24,12 @@ function Grichelde:GetDefaultConfig()
},
replacements = {
["**"] = {
active = true,
order = 9999,
searchText = "",
replaceText = "",
exactCase = false,
consolidate = true,
matchWhen = 2,
stopOnMatch = false,
},
replacement_10 = {
@@ -42,13 +42,18 @@ function Grichelde:GetDefaultConfig()
searchText = "t",
replaceText = "ck",
},
replacement_12 = {
order = 12,
searchText = "p",
replaceText = "b",
},
}
}
}
end
function Grichelde:LoadDatabase()
local db = LibStub("AceDB-3.0"):New(self.name .."DB", self:GetDefaultConfig(), true)
local db = LibStub("AceDB-3.0"):New(self.name .."DB", self.getDefaultConfig(), true)
db.RegisterCallback(self, "OnNewProfile", "RefreshOptions")
db.RegisterCallback(self, "OnProfileChanged", "RefreshOptions")
@@ -68,8 +73,8 @@ function Grichelde:SyncToDatabase(info, val)
local option = self.db.profile
local path = 1
while (path < #info) do
if info[path] ~= "mappings" then
option = option[info[path]] -- or nil
if (info[path] ~= "mappings") then
option = option[info[path]]
end
path = path + 1
end
@@ -87,8 +92,8 @@ function Grichelde:ReadFromDatabase(info)
local option = self.db.profile
local path = 1
while (path <= #info) do
if info[path] ~= "mappings" then
option = option[info[path]] -- or nil
if (info[path] ~= "mappings") then
option = option[info[path]]
end
path = path + 1
end
@@ -120,7 +125,7 @@ function Grichelde:ReorderReplacements()
while count < size do
local replName = orderToName[index]
if replName and replacements[replName] then
if (replName ~= nil) and (replacements[replName] ~= nil) then
self:TracePrint("ReorderReplacements : replName: %s, replTable", replName)
self:TracePrint(replacements[replName])
local order = Grichelde.MAPPING_OFFSET + count