mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
update Developer modules
This commit is contained in:
+106
-4
@@ -1,13 +1,17 @@
|
||||
--Cache global variables
|
||||
--Lua functions
|
||||
local _G = _G
|
||||
local format = string.format
|
||||
local print, tostring, select = print, tostring, select
|
||||
local format = format
|
||||
--WoW API / Variables
|
||||
local CreateFrame = CreateFrame
|
||||
local FrameStackTooltip_Toggle = FrameStackTooltip_Toggle
|
||||
local GetMouseFocus = GetMouseFocus
|
||||
local IsAddOnLoaded = IsAddOnLoaded
|
||||
local LoadAddOn = LoadAddOn
|
||||
|
||||
--[[
|
||||
Command to grab frame information when mouseing over a frame
|
||||
|
||||
Frame Name
|
||||
Width
|
||||
Height
|
||||
@@ -25,8 +29,9 @@ SlashCmdList["FRAME"] = function(arg)
|
||||
else
|
||||
arg = GetMouseFocus()
|
||||
end
|
||||
|
||||
if arg ~= nil then FRAME = arg end --Set the global variable FRAME to = whatever we are mousing over to simplify messing with frames that have no name.
|
||||
if arg ~= nil and arg:GetName() ~= nil then
|
||||
if arg ~= nil and this:GetName() ~= nil then
|
||||
local point, relativeTo, relativePoint, xOfs, yOfs = arg:GetPoint()
|
||||
ChatFrame1:AddMessage("|cffCC0000----------------------------")
|
||||
ChatFrame1:AddMessage("Name: |cffFFD100"..arg:GetName())
|
||||
@@ -54,4 +59,101 @@ SlashCmdList["FRAME"] = function(arg)
|
||||
else
|
||||
ChatFrame1:AddMessage("Could not find frame info")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if IsAddOnLoaded("!DebugTools") then
|
||||
CreateFrame("Frame", "FrameStackHighlight")
|
||||
FrameStackHighlight:SetFrameStrata("TOOLTIP")
|
||||
local t = FrameStackHighlight:CreateTexture(nil, "BORDER")
|
||||
t:SetAllPoints()
|
||||
t:SetTexture(0, 1, 0, 0.5)
|
||||
|
||||
hooksecurefunc("FrameStackTooltip_Toggle", function()
|
||||
local tooltip = _G["FrameStackTooltip"]
|
||||
if not tooltip:IsVisible() then
|
||||
FrameStackHighlight:Hide()
|
||||
end
|
||||
end)
|
||||
|
||||
local _timeSinceLast = 0
|
||||
HookScript(FrameStackTooltip, "OnUpdate", function()
|
||||
_timeSinceLast = _timeSinceLast - arg1
|
||||
if _timeSinceLast <= 0 then
|
||||
_timeSinceLast = FRAMESTACK_UPDATE_TIME
|
||||
local highlightFrame = GetMouseFocus()
|
||||
|
||||
FrameStackHighlight:ClearAllPoints()
|
||||
if highlightFrame and highlightFrame ~= _G["WorldFrame"] then
|
||||
FrameStackHighlight:SetPoint("BOTTOMLEFT", highlightFrame)
|
||||
FrameStackHighlight:SetPoint("TOPRIGHT", highlightFrame)
|
||||
FrameStackHighlight:Show()
|
||||
else
|
||||
FrameStackHighlight:Hide()
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
SLASH_FRAMELIST1 = "/framelist"
|
||||
SlashCmdList["FRAMELIST"] = function(msg)
|
||||
if IsAddOnLoaded("!DebugTools") then
|
||||
local isPreviouslyShown = FrameStackTooltip:IsShown()
|
||||
if not isPreviouslyShown then
|
||||
if msg == tostring(true) then
|
||||
FrameStackTooltip_Toggle(true)
|
||||
else
|
||||
FrameStackTooltip_Toggle()
|
||||
end
|
||||
end
|
||||
|
||||
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
|
||||
for i = 2, FrameStackTooltip:NumLines() do
|
||||
local text = _G["FrameStackTooltipTextLeft"..i]:GetText()
|
||||
if text and text ~= "" then
|
||||
print(text)
|
||||
end
|
||||
end
|
||||
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
|
||||
|
||||
if CopyChatFrame:IsShown() then
|
||||
CopyChatFrame:Hide()
|
||||
end
|
||||
|
||||
ElvUI[1]:GetModule("Chat"):CopyChat(ChatFrame1)
|
||||
if not isPreviouslyShown then
|
||||
FrameStackTooltip_Toggle()
|
||||
end
|
||||
else
|
||||
print("You must first load addon: |cffffd700!DebugTools|r")
|
||||
end
|
||||
end
|
||||
|
||||
local function TextureList()
|
||||
local frame = this or FRAME
|
||||
for i = 1, frame:GetNumRegions() do
|
||||
local region = select(i, frame:GetRegions())
|
||||
if region:GetObjectType() == "Texture" then
|
||||
print(region:GetTexture(), region:GetName())
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
SLASH_TEXLIST1 = "/texlist"
|
||||
SlashCmdList["TEXLIST"] = TextureList
|
||||
|
||||
local function GetPoint(frame)
|
||||
if frame ~= "" then
|
||||
frame = _G[frame]
|
||||
else
|
||||
frame = GetMouseFocus()
|
||||
end
|
||||
|
||||
local point, relativeTo, relativePoint, xOffset, yOffset = frame:GetPoint()
|
||||
local frameName = frame.GetName and frame:GetName() or "nil"
|
||||
local relativeToName = relativeTo.GetName and relativeTo:GetName() or "nil"
|
||||
|
||||
print(frameName, point, relativeToName, relativePoint, xOffset, yOffset)
|
||||
end
|
||||
|
||||
SLASH_GETPOINT1 = "/getpoint"
|
||||
SlashCmdList["GETPOINT"] = GetPoint
|
||||
@@ -3,6 +3,6 @@
|
||||
]]
|
||||
|
||||
SLASH_RELOADUI1 = "/rl"
|
||||
SLASH_RELOADUI3 = "/reload"
|
||||
SLASH_RELOADUI2 = "/reloadui"
|
||||
SLASH_RELOADUI2 = "/reload"
|
||||
SLASH_RELOADUI3 = "/reloadui"
|
||||
SlashCmdList.RELOADUI = ReloadUI
|
||||
@@ -1,4 +1,5 @@
|
||||
--Cache global variables
|
||||
--Lua functions
|
||||
local setmetatable, getmetatable = setmetatable, getmetatable
|
||||
local pairs, type = pairs, type
|
||||
local table = table
|
||||
|
||||
Reference in New Issue
Block a user