- adapted to new Chat API

- fixed broken size calucation
- fixed Import message
This commit is contained in:
2026-11-01 15:37:09 +01:00
parent 37e3dbe63d
commit 2e476648dd
5 changed files with 17 additions and 23 deletions
+3 -3
View File
@@ -886,10 +886,10 @@ function Grichelde:CheckAndExtractMessageTypeTarget(message)
-- special reply handling -- special reply handling
if ("/r" == chatCmd) or ("/reply" == chatCmd) then if ("/r" == chatCmd) or ("/reply" == chatCmd) then
-- reuse last type and target if possible -- reuse last type and target if possible
-- TODO: add the Retail 12.x replacement of ChatEdit_GetLastToldTarget once confirmed in-game local getLastToldTarget = (_G.ChatFrameUtil and _G.ChatFrameUtil.GetLastToldTarget) or _G.ChatEdit_GetLastToldTarget
local lastTold, lastToldType local lastTold, lastToldType
if (_G.ChatEdit_GetLastToldTarget ~= nil) then if (getLastToldTarget ~= nil) then
lastTold, lastToldType = _G.ChatEdit_GetLastToldTarget() lastTold, lastToldType = getLastToldTarget()
end end
self:DebugPrint("CheckAndExtractMessageTypeTarget : lastTell, lastTellType =", lastTold, lastToldType) self:DebugPrint("CheckAndExtractMessageTypeTarget : lastTell, lastTellType =", lastTold, lastToldType)
+2 -2
View File
@@ -84,7 +84,7 @@ end
function Grichelde:SyncToDatabase(info, val) function Grichelde:SyncToDatabase(info, val)
self:TracePrint("SyncToDatabase : info") self:TracePrint("SyncToDatabase : info")
local n = tSize(info) local n = #info
for i = 0, n do for i = 0, n do
self:TracePrint("%d = %s", i, info[i]) self:TracePrint("%d = %s", i, info[i])
end end
@@ -104,7 +104,7 @@ end
function Grichelde:ReadFromDatabase(info) function Grichelde:ReadFromDatabase(info)
self:TracePrint("ReadFromDatabase : info") self:TracePrint("ReadFromDatabase : info")
local n = tSize(info) local n = #info
for i = 0, n do for i = 0, n do
self:TracePrint("%d = %s", i, info[i]) self:TracePrint("%d = %s", i, info[i])
end end
+8 -14
View File
@@ -507,8 +507,7 @@ end
-- @return (boolean) -- @return (boolean)
function Grichelde:IsMappingActive(info) function Grichelde:IsMappingActive(info)
self:TracePrint("IsMappingActive : info") self:TracePrint("IsMappingActive : info")
local n = tSize(info) for i = 0, #info do
for i = 0, n do
self:TracePrint("IsMappingActive : info[%d] = %s", i, info[i]) self:TracePrint("IsMappingActive : info[%d] = %s", i, info[i])
end end
@@ -584,6 +583,7 @@ function Grichelde:ImportExample(num)
self:TracePrint("ImportExample : number is: %d", num) self:TracePrint("ImportExample : number is: %d", num)
if (self.L.Options_Help_Examples[num] == nil) or (tSize(self.L.Options_Help_Examples) < num) then if (self.L.Options_Help_Examples[num] == nil) or (tSize(self.L.Options_Help_Examples) < num) then
self:DebugPrint("ImportExample : invalid number: %d", num) self:DebugPrint("ImportExample : invalid number: %d", num)
return
end end
local profileName = self.L.Options_Help_Examples[num].name local profileName = self.L.Options_Help_Examples[num].name
@@ -671,8 +671,7 @@ end
function Grichelde:MoveUp(info) function Grichelde:MoveUp(info)
self:TracePrint("MoveUp : info") self:TracePrint("MoveUp : info")
local n = tSize(info) for i = 0, #info do
for i = 0, n do
self:TracePrint("%d = %s", i, info[i]) self:TracePrint("%d = %s", i, info[i])
end end
@@ -706,8 +705,7 @@ end
function Grichelde:MoveDown(info) function Grichelde:MoveDown(info)
self:TracePrint("MoveDown : info") self:TracePrint("MoveDown : info")
local n = tSize(info) for i = 0, #info do
for i = 0, n do
self:TracePrint("%d = %s", i, info[i]) self:TracePrint("%d = %s", i, info[i])
end end
@@ -750,8 +748,7 @@ end
function Grichelde:GetMoveUpImage(info) function Grichelde:GetMoveUpImage(info)
self:TracePrint("GetMoveUpImage : info") self:TracePrint("GetMoveUpImage : info")
local n = tSize(info) for i = 0, #info do
for i = 0, n do
self:TracePrint("%d = %s", i, info[i]) self:TracePrint("%d = %s", i, info[i])
end end
@@ -770,8 +767,7 @@ end
function Grichelde:GetMoveDownImage(info) function Grichelde:GetMoveDownImage(info)
self:TracePrint("GetMoveDownImage : info") self:TracePrint("GetMoveDownImage : info")
local n = tSize(info) for i = 0, #info do
for i = 0, n do
self:TracePrint("%d = %s", i, info[i]) self:TracePrint("%d = %s", i, info[i])
end end
@@ -799,8 +795,7 @@ end
function Grichelde:GetDeleteImage(info) function Grichelde:GetDeleteImage(info)
self:TracePrint("GetDeleteImage : info") self:TracePrint("GetDeleteImage : info")
local n = tSize(info) for i = 0, #info do
for i = 0, n do
self:TracePrint("%d = %s", i, info[i]) self:TracePrint("%d = %s", i, info[i])
end end
@@ -813,8 +808,7 @@ end
function Grichelde:DeleteMapping(info) function Grichelde:DeleteMapping(info)
self:TracePrint("DeleteMapping : info") self:TracePrint("DeleteMapping : info")
local n = tSize(info) for i = 0, #info do
for i = 0, n do
self:TracePrint("%d = %s", i, info[i]) self:TracePrint("%d = %s", i, info[i])
end end
+2 -2
View File
@@ -802,7 +802,7 @@ function Grichelde:RunTests()
searchText = "ü", searchText = "ü",
replaceText = "ue", replaceText = "ue",
exactCase = false, exactCase = false,
consolidate = false, consolidate = true,
matchWhen = 2, matchWhen = 2,
stopOnMatch = false, stopOnMatch = false,
}, },
@@ -819,7 +819,7 @@ function Grichelde:RunTests()
{ {
["Hallä"] = "Hallae", ["Hallä"] = "Hallae",
["Ätsch"] = "Aetsch", ["Ätsch"] = "Aetsch",
["Hällöleü"] = "Haelloeleue", ["Hällöluü"] = "Haelloelue",
["ÜöÄ"] = "UeoeAe", ["ÜöÄ"] = "UeoeAe",
} }
) )
+2 -2
View File
@@ -93,7 +93,7 @@ function Grichelde:Format(message, ...)
--print("...: ", ...) --print("...: ", ...)
return message, ... return message, ...
else else
local l = tSize(...) local l = select("#", ...)
if (l > 0) then if (l > 0) then
-- sanitize nil values in vararg -- sanitize nil values in vararg
local packed = { ... } local packed = { ... }
@@ -144,7 +144,7 @@ function Grichelde:LogPrint(printFunc, obj, ...)
printF("<nil>") printF("<nil>")
else else
if type(obj) == "string" then if type(obj) == "string" then
local l = tSize(...) local l = select("#", ...)
if (l == 0) or (find(obj, "%%") == nil) then if (l == 0) or (find(obj, "%%") == nil) then
printF(obj, ...) printF(obj, ...)
else else