local function createPartyFrames(i)
-- Main Frame
local frame = CreateFrame("Frame", "GUI_Party" .. i .. "Frame", UIParent, "SecureUnitButtonTemplate")
frame.unit = "party" .. i
-- Pedestal Frame
frame.PedestalFrame = CreateFrame("Frame", nil, frame)
-- Health Bar
frame.HealthBorder = CreateFrame("button", nil, frame)
frame.HealthBar = CreateFrame("StatusBar", nil, frame)
frame.HealthNumTxtFrame = CreateFrame("Frame", nil, frame)
-- Mana Bar
frame.ManaBorder = CreateFrame("button", nil, frame)
frame.ManaBar = CreateFrame("StatusBar", nil, frame)
frame.ManaNumTxtFrame = CreateFrame("Frame", nil, frame)
-- Misc Frames
frame.InfoTextFrame = CreateFrame("button", nil, frame)
frame.LetterFrame = CreateFrame("Frame", nil, frame)
frame.LeaderFrame = CreateFrame("Frame", nil, frame)
frame.pvpIconFrame = CreateFrame("Frame", nil, frame)
frame.offDeadGhostTxtFrame = CreateFrame("Frame", nil, frame)
-- Target Bar
frame.targetOfFrame = CreateFrame("Frame", nil, frame)
frame.targetOfClickFrame = CreateFrame("button", nil, frame)
-- texture creation
frame.PedestalFrame.texture = frame.PedestalFrame:CreateTexture()
frame.LeaderFrame.texture = frame.LeaderFrame:CreateTexture()
frame.pvpIconFrame.texture = frame.pvpIconFrame:CreateTexture()
frame.targetOfFrame.texture = frame.targetOfPartyFrame:CreateTexture(nil, "BACKGROUND")
-- font creation
frame.HealthBorder.percentHText = frame.HealthBorder:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
frame.ManaBorder.percentMText = frame.ManaBorder:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
frame.InfoTextFrame.NameText = frame.InfoTextFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
frame.LetterFrame.LetterHText = frame.LetterFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
frame.LetterFrame.LetterMText = frame.LetterFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
frame.HealthNumTxtFrame.chnumtxt = frame.HealthNumTxtFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
frame.HealthNumTxtFrame.mhnumtxt = frame.HealthNumTxtFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
frame.ManaNumTxtFrame.CMNumTxt = frame.ManaNumTxtFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
frame.ManaNumTxtFrame.MMNumTxt = frame.ManaNumTxtFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
frame.InfoTextFrame.LvlClassText = frame.InfoTextFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
frame.offDeadGhostTxtFrame.DeadOfflineTxt = frame.offDeadGhostTxtFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
frame.targetOfFrame.targetOfText = frame.targetOfFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
end
for id = 1, 4 do
createPartyFrame(id)
end
local function PFClearAllPoints(id)
local frame = _G['GrimUIPartyFrame' .. id]
-- frames
frame.PedestalFrame:ClearAllPoints()
frame.HealthBorder:ClearAllPoints()
frame.HealthBar:ClearAllPoints()
frame.ManaBorder:ClearAllPoints()
frame.ManaBar:ClearAllPoints()
frame.InfoTextFrame:ClearAllPoints()
frame.LetterFrame:ClearAllPoints()
frame.HealthNumTxtFrame:ClearAllPoints()
frame.ManaNumTxtFrame:ClearAllPoints()
frame.LeaderFrame:ClearAllPoints()
frame.pvpIconFrame:ClearAllPoints()
frame.offDeadGhostTxtFrame:ClearAllPoints()
frame.targetOfPartyFrame:ClearAllPoints()
frame.targetOfPartyClickFrame:ClearAllPoints()
-- Textblocks
frame.HealthBorder.percentHText:ClearAllPoints()
frame.ManaBorder.percentMText:ClearAllPoints()
frame.InfoTextFrame.NameText:ClearAllPoints()
frame.LetterFrame.LetterHText:ClearAllPoints()
frame.LetterFrame.LetterMText:ClearAllPoints()
frame.HealthNumTxtFrame.chnumtxt:ClearAllPoints()
frame.HealthNumTxtFrame.mhnumtxt:ClearAllPoints()
frame.ManaNumTxtFrame.CMNumTxt:ClearAllPoints()
frame.ManaNumTxtFrame.MMNumTxt:ClearAllPoints()
frame.InfoTextFrame.LvlClassText:ClearAllPoints()
frame.offDeadGhostTxtFrame.DeadOfflineTxt:ClearAllPoints()
frame.targetOfFrame.targetOfText:ClearAllPoints()
-- Textures
frame.targetOfFrame.texture:ClearAllPoints()
end
--########################################################################
--####### PARTY STYLES START ############
--########################################################################
-----------------------------
-- Grim Layout Style 1 ------------
-----------------------------
local function GrimStyle1(id)
local frame = _G['GrimUIPartyFrame' .. id]
-- ClearAllPoints for all frames in this style.
PFClearAllPoints(id)
--Party1 main frame set height/width start
frame:SetWidth(223)
frame:SetHeight(135)
--Party1 pedestal
frame.PedestalFrame:SetPoint("BOTTOM", "GUI_Party"..i.."Frame", "BOTTOM", -62, 0)
frame.PedestalFrame:SetHeight(15)
frame.PedestalFrame:SetWidth(49)
frame.PedestalFrame.texture:SetAllPoints(PedestalFrame)
frame.PedestalFrame.texture:SetTexture("Interface\\AddOns\\!GrimUI\\Art\\pedestal.tga")
frame.PedestalFrame:SetFrameStrata("LOW")
frame.PedestalFrame:SetFrameLevel("2")
-- party 1 health bar start
frame.HealthBorder:SetHeight(100)
frame.HealthBorder:SetWidth(31)
frame.HealthBorder:SetPoint("BOTTOMLEFT", "GUI_Party"..i.."Frame", "BOTTOMLEFT", 0, 0)
frame.HealthBorder:SetBackdrop{
bgFile = nil,
edgeFile = "Interface/DialogFrame/UI-DialogBox-Border", tile = false, tileSize = 0, edgeSize = 5,
insets = { left = 0, right = 0, top = 0, bottom = 0 }
}
frame.HealthBorder:SetBackdropBorderColor(0, 0, 0, 1)
frame.HealthBorder:SetFrameStrata("BACKGROUND")
frame.HealthBorder:SetFrameLevel("3")
frame.HealthBorder:RegisterForClicks("AnyUp")
frame.HealthBorder:SetAttribute("unit", "Party1")
frame.HealthBorder:SetAttribute("*type1", "target")
local showPartymenu = ToggleDropDownMenu(1, nil, "PartyMemberFrame"..id.."DropDown", "cursor", 0, 0)
frame.HealthBorder.showPartymenu = showPartymenu
frame.HealthBorder.unit = "party" .. id
frame.HealthBorder:SetAttribute("*type2", "showPartymenu")
frame.HealthBorder:SetScript("OnEnter", UnitFrame_OnEnter)
frame.HealthBorder:SetScript("OnLeave", UnitFrame_OnLeave)
frame.HealthBorder:SetFrameStrata("HIGH")
frame.HealthBorder:SetFrameLevel("2")
frame.HealthBar:SetWidth(29)
frame.HealthBar:SetHeight(98)
frame.HealthBar:SetPoint("CENTER", HealthBorder, "CENTER", 0, 0)
frame.HealthBar:SetStatusBarTexture("Interface\\AddOns\\!GrimUI\\Art\\VBarTexture.tga")
frame.HealthBar:SetStatusBarColor(.231, .682, .419, 1)
frame.HealthBar:SetOrientation("VERTICAL")
frame.HealthBar:SetFrameStrata("BACKGROUND")
frame.HealthBar:SetFrameLevel("2")
frame.HealthBarpercentHText:SetPoint("TOP", HealthBorder, "TOP", 0, -1)
frame.HealthBarpercentHText:SetTextColor(1, 1, 1, 1)
frame.HealthBarpercentHText:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 10, "NORMAL")
----------------------------------
-- party 1 health bar end
-----------------------------------
end