diff --git a/!Compatibility/api/wowAPI.lua b/!Compatibility/api/wowAPI.lua index 052d438..98bebfd 100644 --- a/!Compatibility/api/wowAPI.lua +++ b/!Compatibility/api/wowAPI.lua @@ -430,6 +430,18 @@ function EditBoxGetCursorPosition(self) local otc = removeScript(self, "OnTextChanged") local ots = removeScript(self, "OnTextSet") + local charsChanged, numeric + + local maxChars = self:GetMaxLetters() + if maxChars == self:GetNumLetters() then + self:SetMaxLetters(maxChars + 1) + charsChanged = true + end + if self:IsNumeric() then + self:SetNumeric(false) + numeric = true + end + self:Insert(nbsp) local pos = find(self:GetText(), nbsp) @@ -441,6 +453,13 @@ function EditBoxGetCursorPosition(self) self:Insert("") end + if charsChanged then + self:SetMaxLetters(maxChars) + end + if numeric then + self:SetNumeric(true) + end + if occ then self:SetScript("OnCursorChanged", occ) end if otc then self:SetScript("OnTextChanged", otc) end if ots then self:SetScript("OnTextSet", ots) end @@ -467,9 +486,30 @@ function EditBoxSetCursorPosition(self, pos) end if pos == 0 then + local charsChanged, numeric + + local maxChars = self:GetMaxLetters() + if maxChars == self:GetNumLetters() then + self:SetMaxLetters(maxChars + 1) + charsChanged = true + end + if self:IsNumeric() then + self:SetNumeric(false) + numeric = true + end + text = sub(text, 0, 1) self:HighlightText(0, 1) self:Insert(text) + self:HighlightText(0, 1) + self:Insert("") + + if charsChanged then + self:SetMaxLetters(maxChars) + end + if numeric then + self:SetNumeric(true) + end else text = sub(text, pos, pos) self:HighlightText(pos - 1, pos) diff --git a/ElvUI/Modules/Blizzard/ColorPicker.lua b/ElvUI/Modules/Blizzard/ColorPicker.lua index 45c8561..967021b 100644 --- a/ElvUI/Modules/Blizzard/ColorPicker.lua +++ b/ElvUI/Modules/Blizzard/ColorPicker.lua @@ -147,6 +147,21 @@ function B:EnhanceColorPicker() this:SetScript("OnUpdate", HandleUpdateLimiter) end) + hooksecurefunc(ColorPickerFrame, "SetFrameLevel", function(self, level) + for _, child in ipairs({self:GetChildren()}) do + child:SetFrameLevel(level + 1) + + if child:GetFrameType() == "EditBox" then + for _, child in ipairs({child:GetChildren()}) do + child:SetFrameLevel(level + 1) + end + end + end + + --Set OnUpdate script to handle update limiter + this:SetScript("OnUpdate", HandleUpdateLimiter) + end) + hooksecurefunc(ColorPickerFrame, "SetFrameLevel", function(self, level) for _, child in ipairs({self:GetChildren()}) do child:SetFrameLevel(level + 1) diff --git a/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua b/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua index aa18e17..0f8e516 100644 --- a/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua +++ b/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua @@ -61,9 +61,9 @@ if not AceGUIMultiLineEditBoxInsertLink then hooksecurefunc("SetItemRef", function(link, text, button) if IsShiftKeyDown() then - if strsub(link,1,6) == "player" then - local name = strsub(link,8) - if name and (strlen(name) > 0) then + if sub(link, 1, 6) == "player" then + local name = sub(link,8) + if name and name ~= "" then return _G.AceGUIMultiLineEditBoxInsertLink(name) end else diff --git a/README.md b/README.md index bff734d..2d3f141 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ This UI will arrange your interface to be more flexible and practical. /ec or /elvui Toggle the configuration GUI. /rl or /reloadui Reload the whole UI. /moveui Open the movable frames options. + /bgstats Toggles Battleground datatexts to display info when inside a battleground. /egrid Toggles visibility of the grid for helping placement of thirdparty addons. /farmmode Toggles the Minimap Farmmode. /in The input of how many seconds you want a command to fire.