Make movable

This commit is contained in:
2025-01-06 19:12:52 +01:00
parent ba77555cab
commit 9e344aed64

View File

@@ -182,13 +182,25 @@ StaticGridFrame = {
end
end
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
}
local configFrame = StaticGridFrame.new("HeimdallConfig",
UIParent,
40, 24,
{ w = 512, h = 512 + 256 })
40, 12,
{ w = 1024+512, h = 1024 })
configFrame:MakeMovable()
local colors = {
{ 1, 0, 0, 1 },
@@ -199,7 +211,7 @@ local colors = {
{ 0, 1, 1, 1 },
{ 1, 1, 1, 1 },
}
for i = 1, 20 do
for i = 1, 200 do
local frame = CreateFrame("Frame", "HeimdallConfigFrame" .. i, UIParent)
frame:SetBackdrop({
bgFile = "Interface/Tooltips/UI-Tooltip-Background",
@@ -280,42 +292,8 @@ function shared.Config.Init()
-- PutRight(a, b, offset)
-- end
-- 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")
-- title:SetText("Heimdall Config")