New version format for '/details', added '/details version' to an easy copy and paste

This commit is contained in:
Tercio Jose
2022-10-04 18:31:53 -03:00
parent aa143dcf6e
commit 54510ee298
4 changed files with 62 additions and 30 deletions
+34
View File
@@ -1649,3 +1649,37 @@ function _detalhes:FormatBackground (f)
f.__background:SetHorizTile (true)
f.__background:SetAllPoints()
end
function Details.ShowCopyValueFrame(textToShow)
if (not DetailsCopyValueFrame) then
local frame = CreateFrame("frame", "DetailsCopyValueFrame", UIParent)
frame:SetSize(160, 20)
frame:SetPoint("center", UIParent, "center", 0, 0)
DetailsFramework:ApplyStandardBackdrop(frame)
tinsert(UISpecialFrames, "DetailsCopyValueFrame")
frame.editBox = CreateFrame("editbox", nil, frame)
frame.editBox:SetPoint ("topleft", frame, "topleft")
frame.editBox:SetAutoFocus(false)
frame.editBox:SetFontObject("GameFontHighlightSmall")
frame.editBox:SetAllPoints()
frame.editBox:SetJustifyH("center")
frame.editBox:EnableMouse(true)
frame.editBox:SetScript("OnEnterPressed", function()
frame.editBox:ClearFocus()
frame:Hide()
end)
frame.editBox:SetScript("OnEscapePressed", function()
frame.editBox:ClearFocus()
frame:Hide()
end)
end
DetailsCopyValueFrame:Show()
DetailsCopyValueFrame.editBox:SetText(textToShow or "")
DetailsCopyValueFrame.editBox:SetFocus()
DetailsCopyValueFrame.editBox:HighlightText()
end