Make movable
This commit is contained in:
@@ -182,13 +182,25 @@ StaticGridFrame = {
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
print("No available space in the grid.")
|
print("No available space in the grid.")
|
||||||
|
end,
|
||||||
|
MakeMovable = function(self)
|
||||||
|
self.frame:SetMovable(true)
|
||||||
|
self.frame:EnableMouse(true)
|
||||||
|
self.frame:RegisterForDrag("LeftButton")
|
||||||
|
self.frame:SetScript("OnDragStart", function(self)
|
||||||
|
self:StartMoving()
|
||||||
|
end)
|
||||||
|
self.frame:SetScript("OnDragStop", function(self)
|
||||||
|
self:StopMovingOrSizing()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
local configFrame = StaticGridFrame.new("HeimdallConfig",
|
local configFrame = StaticGridFrame.new("HeimdallConfig",
|
||||||
UIParent,
|
UIParent,
|
||||||
40, 24,
|
40, 12,
|
||||||
{ w = 512, h = 512 + 256 })
|
{ w = 1024+512, h = 1024 })
|
||||||
|
configFrame:MakeMovable()
|
||||||
|
|
||||||
local colors = {
|
local colors = {
|
||||||
{ 1, 0, 0, 1 },
|
{ 1, 0, 0, 1 },
|
||||||
@@ -199,7 +211,7 @@ local colors = {
|
|||||||
{ 0, 1, 1, 1 },
|
{ 0, 1, 1, 1 },
|
||||||
{ 1, 1, 1, 1 },
|
{ 1, 1, 1, 1 },
|
||||||
}
|
}
|
||||||
for i = 1, 20 do
|
for i = 1, 200 do
|
||||||
local frame = CreateFrame("Frame", "HeimdallConfigFrame" .. i, UIParent)
|
local frame = CreateFrame("Frame", "HeimdallConfigFrame" .. i, UIParent)
|
||||||
frame:SetBackdrop({
|
frame:SetBackdrop({
|
||||||
bgFile = "Interface/Tooltips/UI-Tooltip-Background",
|
bgFile = "Interface/Tooltips/UI-Tooltip-Background",
|
||||||
@@ -282,40 +294,6 @@ function shared.Config.Init()
|
|||||||
-- return editBox
|
-- return editBox
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
--configFrame:SetSize(256 + 256, 512)
|
|
||||||
--configFrame:SetPoint("CENTER")
|
|
||||||
--configFrame:SetFrameStrata("HIGH")
|
|
||||||
--configFrame:EnableMouse(true)
|
|
||||||
--configFrame:SetMovable(true)
|
|
||||||
--configFrame:SetResizable(false)
|
|
||||||
--configFrame:SetBackdrop({
|
|
||||||
-- bgFile = "Interface/Tooltips/UI-Tooltip-Background",
|
|
||||||
-- edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
|
|
||||||
-- tile = true,
|
|
||||||
-- tileSize = 4,
|
|
||||||
-- edgeSize = 4,
|
|
||||||
-- insets = {
|
|
||||||
-- left = 4,
|
|
||||||
-- right = 4,
|
|
||||||
-- top = 4,
|
|
||||||
-- bottom = 4
|
|
||||||
-- }
|
|
||||||
--})
|
|
||||||
--configFrame:SetBackdropColor(0, 0, 0, 0.8)
|
|
||||||
--configFrame:SetBackdropBorderColor(0.5, 0.5, 0.5, 1)
|
|
||||||
|
|
||||||
-- configFrame.frame:SetMovable(true)
|
|
||||||
-- configFrame.frame:EnableMouse(true)
|
|
||||||
-- configFrame.frame:RegisterForDrag("LeftButton")
|
|
||||||
-- configFrame.frame:SetScript("OnDragStart", function(self)
|
|
||||||
-- self:StartMoving()
|
|
||||||
-- end)
|
|
||||||
-- configFrame.frame:SetScript("OnDragStop", function(self)
|
|
||||||
-- self:StopMovingOrSizing()
|
|
||||||
-- end)
|
|
||||||
-- configFrame.frame:SetScript("OnShow", function(self)
|
|
||||||
-- self:SetScale(1)
|
|
||||||
-- end)
|
|
||||||
--
|
--
|
||||||
-- local title = configFrame.frame:CreateFontString(nil, "ARTWORK", "GameFontNormal")
|
-- local title = configFrame.frame:CreateFontString(nil, "ARTWORK", "GameFontNormal")
|
||||||
-- title:SetText("Heimdall Config")
|
-- title:SetText("Heimdall Config")
|
||||||
|
Reference in New Issue
Block a user