diff --git a/!Compatibility/api/luaAPI.lua b/!Compatibility/api/luaAPI.lua index b1a0427..32d89d5 100644 --- a/!Compatibility/api/luaAPI.lua +++ b/!Compatibility/api/luaAPI.lua @@ -1,5 +1,4 @@ --Cache global variables -local assert = assert local error = error local geterrorhandler = geterrorhandler local loadstring = loadstring @@ -12,38 +11,8 @@ local ceil, floor = math.ceil, math.floor local find, format, gfind, gsub, sub = string.find, string.format, string.gfind, string.gsub, string.sub local getn, setn, tinsert = table.getn, table.setn, table.insert -local escapeSequences = { - ["\a"] = "\\a", -- Bell - ["\b"] = "\\b", -- Backspace - ["\t"] = "\\t", -- Horizontal tab - ["\n"] = "\\n", -- Newline - ["\v"] = "\\v", -- Vertical tab - ["\f"] = "\\f", -- Form feed - ["\r"] = "\\r", -- Carriage return - ["\\"] = "\\\\", -- Backslash - ["\""] = "\\\"", -- Quotation mark - ["|"] = "||", - [" "] = "%s", - - [" "] = "%s", - ["!"] = "\\!", - ["#"] = "\\#", - ["$"] = "\\$", - ["%"] = "\\%", - ["&"] = "\\&", - ["'"] = "\\'", - ["("] = "\\(", - [")"] = "\\)", - ["*"] = "\\*", - ["+"] = "\\+", - [","] = "\\,", - ["-"] = "\\-", - ["."] = "\\.", - ["/"] = "\\/" -} - math.huge = 1/0 -string.gmatch = gfind +string.gmatch = string.gfind function difftime(time2, time1) if type(time2) ~= "number" then @@ -150,6 +119,34 @@ function string.split(delimiter, str) end strsplit = string.split +local escapeSequences = { + ["\a"] = "\\a", -- Bell + ["\b"] = "\\b", -- Backspace + ["\t"] = "\\t", -- Horizontal tab + ["\n"] = "\\n", -- Newline + ["\v"] = "\\v", -- Vertical tab + ["\f"] = "\\f", -- Form feed + ["\r"] = "\\r", -- Carriage return + ["\\"] = "\\\\", -- Backslash + ["\""] = "\\\"", -- Quotation mark + ["|"] = "||", + [" "] = "%s", + + ["!"] = "\\!", + ["#"] = "\\#", + ["$"] = "\\$", + ["%"] = "\\%", + ["&"] = "\\&", + ["'"] = "\\'", + ["("] = "\\(", + [")"] = "\\)", + ["*"] = "\\*", + ["+"] = "\\+", + [","] = "\\,", + ["-"] = "\\-", + ["."] = "\\.", + ["/"] = "\\/" +} function string.trim(str, chars) if type(str) ~= "string" and type(str) ~= "number" then error(format("bad argument #1 to 'trim' (string expected, got %s)", str and type(str) or "no value"), 2) diff --git a/!Compatibility/api/wowAPI.lua b/!Compatibility/api/wowAPI.lua index de83eb4..c652799 100644 --- a/!Compatibility/api/wowAPI.lua +++ b/!Compatibility/api/wowAPI.lua @@ -232,10 +232,8 @@ function GetInstanceInfo() local name = GetRealZoneText() local difficulty = 1 - local difficultyName = DUNGEON_DIFFICULTY1 local maxPlayers = GetMaxPlayersByType(instanceType, name) - - difficultyName = format("%d %s", maxPlayers, difficultyName) + local difficultyName = format("%d %s", maxPlayers, DUNGEON_DIFFICULTY1) return name, instanceType, difficulty, difficultyName, maxPlayers end @@ -291,14 +289,14 @@ end local function OnSizeChanged() local width, height = this:GetWidth(), this:GetHeight() + this.texturePointer.width = width this.texturePointer.height = height this.texturePointer:SetWidth(width) this.texturePointer:SetHeight(height) end -local function OnValueChanged() - local value = arg1 +local function OnValueChanged(value) local _, max = this:GetMinMaxValues() if this.texturePointer.verticalOrientation then