diff --git a/Emotes.lua b/Emotes.lua index b645c8a..fd4c2db 100644 --- a/Emotes.lua +++ b/Emotes.lua @@ -8927,7 +8927,7 @@ TwitchEmotes_animation_metadata = { ["Interface\\AddOns\\TwitchEmotes\\Emotes\\Custom\\Clap.tga"] = {["nFrames"] = 2, ["frameWidth"] = 32, ["frameHeight"] = 32, ["imageWidth"]=32, ["imageHeight"]=64, ["framerate"] = 6}, ["Interface\\AddOns\\TwitchEmotes\\Emotes\\Custom\\modCheck.tga"] = {["nFrames"] = 28, ["frameWidth"] = 32, ["frameHeight"] = 32, ["imageWidth"]=32, ["imageHeight"]=1024, ["framerate"] = 9}, ["Interface\\AddOns\\TwitchEmotes\\Emotes\\Custom\\goinginsane.tga"] = {["nFrames"] = 47, ["frameWidth"] = 32, ["frameHeight"] = 32, ["imageWidth"]=64, ["imageHeight"]=1024, ["framerate"] = 25}, - ["Interface\\AddOns\\TwitchEmotes\\Emotes\\Custom\\catJAM.tga"] = {["nFrames"] = 60, ["frameWidth"] = 32, ["frameHeight"] = 32, ["imageWidth"]=64, ["imageHeight"]=1024, ["framerate"] = 15}, + ["Interface\\AddOns\\TwitchEmotes\\Emotes\\Custom\\catJAM.tga"] = {["nFrames"] = 60, ["frameWidth"] = 32, ["frameHeight"] = 32, ["imageWidth"]=64, ["imageHeight"]=1024, ["framerate"] = 10}, ["Interface\\AddOns\\TwitchEmotes\\Emotes\\Custom\\ratJAM.tga"] = {["nFrames"] = 16, ["frameWidth"] = 32, ["frameHeight"] = 32, ["imageWidth"]=32, ["imageHeight"]=512, ["framerate"] = 15}, ["Interface\\AddOns\\TwitchEmotes\\Emotes\\BTTV+FFZ\\haHAA.tga"] = {["nFrames"] = 14, ["frameWidth"] = 32, ["frameHeight"] = 32, ["imageWidth"]=32, ["imageHeight"]=512, ["framerate"] = 34}, ["Interface\\AddOns\\TwitchEmotes\\Emotes\\Pepes\\PepeMeltdown.tga"] = {["nFrames"] = 10, ["frameWidth"] = 32, ["frameHeight"] = 32, ["imageWidth"]=32, ["imageHeight"]=512, ["framerate"] = 34}, diff --git a/TwitchEmotesAnimator.lua b/TwitchEmotesAnimator.lua index 747b926..a895ab2 100644 --- a/TwitchEmotesAnimator.lua +++ b/TwitchEmotesAnimator.lua @@ -40,11 +40,14 @@ local function CropToCurrentFrame(tex, animdata) top / animdata.imageHeight, bottom / animdata.imageHeight) end +-- The engine splits the payload on ':' and atoi's each field, so a coordinate +-- carrying a decimal point silently truncates and crops the wrong rect (a +-- fractional framerate is enough to leak one in). Format them as integers. local function BuildFrameString(imagepath, animdata, framenum, w, h) local left, right, top, bottom = GetFrameRect(animdata, framenum) - return "|T" .. imagepath .. ":" .. w .. ":" .. h .. ":0:0:" .. - animdata.imageWidth .. ":" .. animdata.imageHeight .. ":" .. - left .. ":" .. right .. ":" .. top .. ":" .. bottom .. "|t" + return ("|T%s:%d:%d:0:0:%d:%d:%d:%d:%d:%d|t"):format(imagepath, w, h, + animdata.imageWidth, animdata.imageHeight, + left, right, top, bottom) end -- escape the pattern-magic chars that can appear in an emote escape (paths use