Initial commit

This commit is contained in:
2023-03-15 17:13:01 +01:00
commit 86825dd6e5
18 changed files with 1912 additions and 0 deletions

76
src/frames.lua Normal file
View File

@@ -0,0 +1,76 @@
-- Copyright 2023 <omicron.me@protonmail.com>
--
-- This file is part of Omicron Frames
--
-- Omicron Frames is free software: you can redistribute it and/or modify it
-- under the terms of the GNU General Public License as published by the Free
-- Software Foundation, either version 3 of the License, or (at your option)
-- any later version.
--
-- Omicron Frames is distributed in the hope that it will be useful, but
-- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-- more details.
--
-- You should have received a copy of the GNU General Public License along with
-- Omicron Frames. If not, see <https://www.gnu.org/licenses/>.
local omif = select(2, ...)
local UnitFrame = omif.GetModule("types").UnitFrame
local frames = omif.GetModule("frames")
-- re-parent all blizzard frames and then hide the new parent
function HideBlizzardFrames()
local toggleFrame = CreateFrame("Frame", nil, UIParent)
blizzardFrames = {
PlayerFrame,
TargetFrame,
FocusFrame,
PartyFrame,
CompactRaidFrameContainer
}
for _, frame in ipairs(blizzardFrames) do
frame:SetParent(toggleFrame)
end
toggleFrame:Hide()
end
function CreateRaidFrames(left, top, width, height)
for i=0,5 do
for j=0,4 do
local num = i*5 + j + 1
local frame = UnitFrame:new("raid" .. num, width, height)
frame:SetPosition(left + (j-2)*width, top - i*height)
end
end
local player = UnitFrame:new("player", width, height)
player:SetPosition(left-3*width - 50, top)
local target = UnitFrame:new("target", width, height)
target:SetPosition(left+3*width + 50, top)
end
function CreatePartyFrames(left, top, width, height)
local player = UnitFrame:new("player", width, height)
player:SetPosition(-2*width, top)
for i=1,4 do
local frame = UnitFrame:new("party" .. i, width, height)
frame:SetPosition((i-2)*width, top)
end
local target = UnitFrame:new("target", width, height)
target:SetPosition(3*width + 50, top)
local focus = UnitFrame:new("focus", width, height)
focus:SetPosition(3*width + 50, top - height)
end
function CreateFrames()
CreatePartyFrames(0, -290, 110, 45)
--CreateRaidFrames(-850, 400, 110, 45)
--CreateRaidFrames(0, -290, 100, 45)
HideBlizzardFrames()
end
omif.SetEventHandler("OMICRON_LOADING", CreateFrames)