local VERSION = tonumber(("$Revision: 33467 $"):match("%d+")) local PitBull = PitBull if PitBull.revision < VERSION then PitBull.version = "r" .. VERSION PitBull.revision = VERSION PitBull.date = ("$Date: 2007-04-23 02:43:26 -0400 (Mon, 23 Apr 2007) $"):match("%d%d%d%d%-%d%d%-%d%d") end local PitBull_Aura = nil local DogTag = AceLibrary("DogTag-1.0") local newFrame = PitBull.newFrame local Seerah_db = PitBull:AcquireDBNamespace("Layout-Seerah") PitBull:RegisterDefaults("Layout-Seerah", "profile", { ["**"] = { portraitSide = "left", auraSide = "bottom", --note, these are only used when debuffs are split buffSide = "bottom", debuffSide = "right", classTextCustom = "[classification][level:difficultycolor] [smartclass:classcolor] [smartrace]", classTextStyle = "Standard", healthTextCustom = "[curhp]/[maxhp]", healthTextStyle = "Absolute", nameTextCustom = "[name]", nameTextStyle = "Standard", manaTextCustom = "[curmana]/[maxmana]", manaTextStyle = "Absolute", }, target = { portraitSide = "right", auraSide = "right", comboSide = "bottom", comboTexture = "default", comboText = false, } }) local Seerah = {} local heights = { healthBar = 3, manaBar = 2, castBar = 1, repBar = 1, expBar = 1 } local function figureHeight(multiplier, frame) local num = 0 for k,v in pairs(heights) do if frame[k] and frame[k]:IsShown() then num = num + v end end return heights[multiplier] * frame:GetHeight() / num end function Seerah.healthBar(unit, frame) local height = figureHeight('healthBar', frame) frame.healthBar:SetPoint("TOP", frame, "TOP", 0, 0) if frame.portrait then if Seerah_db.profile[frame.group].portraitSide == "right" then frame.healthBar:SetPoint("LEFT", frame, "LEFT", 0, 0) frame.healthBar:SetPoint("RIGHT", frame.portrait, "LEFT", -2, 0) else frame.healthBar:SetPoint("LEFT", frame.portrait, "RIGHT", 2, 0) frame.healthBar:SetPoint("RIGHT", frame, "RIGHT", 0, 0) end else frame.healthBar:SetPoint("LEFT", frame, "LEFT", 0, 0) frame.healthBar:SetPoint("RIGHT", frame, "RIGHT", 0, 0) end frame.healthBar:SetHeight(height) end function Seerah.manaBar(unit, frame) local height = figureHeight('manaBar', frame) if frame.healthBar then frame.manaBar:SetPoint("TOP", frame.healthBar, "BOTTOM", 0, -1) else frame.manaBar:SetPoint("TOP", frame, "TOP", 0, 0) end if frame.portrait then if Seerah_db.profile[frame.group].portraitSide == "right" then frame.manaBar:SetPoint("LEFT", frame, "LEFT", 0, 0) frame.manaBar:SetPoint("RIGHT", frame.portrait, "LEFT", -2, 0) else frame.manaBar:SetPoint("LEFT", frame.portrait, "RIGHT", 2, 0) frame.manaBar:SetPoint("RIGHT", frame, "RIGHT", 0, 0) end else frame.manaBar:SetPoint("LEFT", frame, "LEFT", 0, 0) frame.manaBar:SetPoint("RIGHT", frame, "RIGHT", 0, 0) end frame.manaBar:SetHeight(height) end function Seerah.castBar(unit, frame) local height = figureHeight('castBar', frame) frame.castBar:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", height, 0) frame.castBar:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 0, 0) frame.castBar:SetHeight( height ) frame.castBar.bg:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", 0, 0) frame.castBar.bg:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 0, 0) frame.castBar.bg:SetHeight(height) end function Seerah.repBar(unit, frame) local height = figureHeight('repBar', frame) frame.repBar:SetPoint("LEFT", frame, "LEFT") frame.repBar:SetPoint("RIGHT", frame, "RIGHT") if frame.expBar then frame.repBar:SetPoint("BOTTOM", frame.expBar, "TOP", 0, 0) elseif frame.castBar then frame.repBar:SetPoint("BOTTOM", frame.castBar, "TOP", 0, 0) else frame.repBar:SetPoint("BOTTOM", frame, "BOTTOM", 0, 0) end frame.repBar:SetHeight(height) end function Seerah.expBar(unit, frame) local height = figureHeight('expBar', frame) frame.expBar:SetPoint("LEFT", frame, "LEFT") frame.expBar:SetPoint("RIGHT", frame, "RIGHT") if frame.castBar then frame.expBar:SetPoint("BOTTOM", frame.castBar, "TOP", 0, 0) else frame.expBar:SetPoint("BOTTOM", frame, "BOTTOM", 0, 0) end frame.expBar:SetHeight(height) end function Seerah.castBarIcon(unit, frame) local height = figureHeight('castBar', frame) frame.castBarIcon:SetHeight( height ) frame.castBarIcon:SetWidth( height ) frame.castBarIcon:SetPoint("RIGHT", frame.castBar, "LEFT" ) frame.castBarIcon:SetTexCoord(0.07, 0.93, 0.07, 0.93) frame.castBarIcon:Hide() end function Seerah.castBarText(unit, frame) frame.castBarText:ClearAllPoints() frame.castBarText:SetAllPoints(frame.castBar) frame.castBarText:SetJustifyH("LEFT") end function Seerah.castBarTimeText(unit, frame) frame.castBarTimeText:ClearAllPoints() frame.castBarTimeText:SetAllPoints(frame.castBar) frame.castBarTimeText:SetJustifyH("RIGHT") end function Seerah.repBarText(unit, frame) frame.repBarText:ClearAllPoints() frame.repBarText:SetAllPoints(frame.repBar) frame.repBarText:SetJustifyH("CENTER") end function Seerah.healthText(unit, frame) if frame.healthBar then frame.healthText:SetJustifyV("MIDDLE") frame.healthText:SetJustifyH("RIGHT") frame.healthText:SetPoint("RIGHT", frame.healthBar, "RIGHT", -3, 0) end end function Seerah.manaText(unit, frame) if frame.manaBar then frame.manaText:SetJustifyV("MIDDLE") frame.manaText:SetJustifyH("RIGHT") frame.manaText:SetPoint("RIGHT", frame.manaBar, "RIGHT", -3, 0) end end function Seerah.nameText(unit, frame) frame.nameText:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", 2, 5) frame.nameText:SetJustifyV("MIDDLE") frame.nameText:SetJustifyH("LEFT") if frame.classText then frame.nameText:SetPoint("RIGHT", frame.classText, "LEFT", 0, 0) end end function Seerah.classText(unit, frame) frame.classText:SetPoint("BOTTOMRIGHT", frame, "TOPRIGHT", -2, 5) frame.classText:SetJustifyV("MIDDLE") frame.classText:SetJustifyH("LEFT") end function Seerah.auraFrame(unit, frame) frame.auraFrame:ClearAllPoints() local size = PitBull:GetModule("Aura").db.profile[frame.group].buffsize frame.auraFrame:SetHeight(size) if PitBull:GetModule("Aura").db.profile[frame.group].split then local buffside = Seerah_db.profile[frame.group].buffSide local w = frame:GetWidth() frame.auraFrame:SetWidth(w) if buffside == "bottom" then frame.auraFrame:SetPoint("TOPLEFT", frame, "BOTTOMLEFT", -2, -2) elseif buffside == "top" then frame.auraFrame:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", -2, 20) elseif buffside == "left" then frame.auraFrame:SetPoint("BOTTOMRIGHT", frame, "LEFT", w-size-2, -2) elseif buffside == "right" then frame.auraFrame:SetPoint("BOTTOMLEFT", frame, "RIGHT", 2, 0) elseif buffside == "topleft" then frame.auraFrame:SetPoint("TOPRIGHT", frame, "TOPLEFT", w-size-2, 0) elseif buffside == "topright" then frame.auraFrame:SetPoint("TOPLEFT", frame, "TOPRIGHT", 2, 0) elseif buffside == "bottomleft" then frame.auraFrame:SetPoint("BOTTOMRIGHT", frame, "BOTTOMLEFT", w-size-2, 0) elseif buffside == "bottomright" then frame.auraFrame:SetPoint("BOTTOMLEFT", frame, "BOTTOMRIGHT", 2, 0) end else local side = Seerah_db.profile[frame.group].auraSide if side == "bottom" then frame.auraFrame:SetPoint("TOPLEFT", frame, "BOTTOMLEFT", -2, -2) frame.auraFrame:SetPoint("TOPRIGHT", frame, "BOTTOMRIGHT", 2, -2) elseif side == "top" then local split = PitBull:GetModule("Aura").db.profile[frame.group].split frame.auraFrame:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", -2, split and 36 or 20) frame.auraFrame:SetPoint("BOTTOMRIGHT", frame, "TOPRIGHT", 2, split and 36 or 20) elseif side == "left" then frame.auraFrame:SetWidth(160) frame.auraFrame:SetPoint("BOTTOMRIGHT", frame, "LEFT", -2, 0) elseif side == "topright" then frame.auraFrame:SetWidth(160) frame.auraFrame:SetPoint("TOPLEFT", frame, "TOPRIGHT", 2, 0) elseif side == "bottomright" then frame.auraFrame:SetWidth(160) frame.auraFrame:SetPoint("BOTTOMLEFT", frame, "BOTTOMRIGHT", 2, 0) elseif side == "bottomleft" then frame.auraFrame:SetWidth(160) frame.auraFrame:SetPoint("BOTTOMRIGHT", frame, "BOTTOMLEFT", -2, 0) elseif side == "topleft" then frame.auraFrame:SetWidth(160) frame.auraFrame:SetPoint("TOPRIGHT", frame, "TOPLEFT", -2, 0) elseif side == "right" then frame.auraFrame:SetWidth(160) frame.auraFrame:SetPoint("BOTTOMLEFT", frame, "RIGHT", 2, 0) end end end function Seerah.auraFrame2(unit, frame) frame.auraFrame2:ClearAllPoints() local size = PitBull:GetModule("Aura").db.profile[frame.group].debuffsize local w = frame:GetWidth() frame.auraFrame2:SetHeight(size) frame.auraFrame2:SetWidth(w) local debuffside = Seerah_db.profile[frame.group].debuffSide if debuffside == "bottom" then frame.auraFrame2:SetPoint("TOPLEFT", frame, "BOTTOMLEFT", -2, -2) elseif debuffside == "top" then frame.auraFrame2:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", -2, 20) elseif debuffside == "left" then frame.auraFrame2:SetPoint("BOTTOMRIGHT", frame, "LEFT", w-size-2, -2) elseif debuffside == "right" then frame.auraFrame2:SetPoint("BOTTOMLEFT", frame, "RIGHT", 2, 0) elseif debuffside == "topleft" then frame.auraFrame2:SetPoint("TOPRIGHT", frame, "TOPLEFT", w-size-2, 0) elseif debuffside == "topright" then frame.auraFrame2:SetPoint("TOPLEFT", frame, "TOPRIGHT", 2, 0) elseif debuffside == "bottomleft" then frame.auraFrame2:SetPoint("BOTTOMRIGHT", frame, "BOTTOMLEFT", w-size-2, 0) elseif debuffside == "bottomright" then frame.auraFrame2:SetPoint("BOTTOMLEFT", frame, "BOTTOMRIGHT", 2, 0) end end function Seerah.portrait(unit, frame) if Seerah_db.profile[frame.group].portraitSide ~= "right" then frame.portrait:SetPoint("TOPLEFT", frame, "TOPLEFT", 0, 0) else frame.portrait:SetPoint("TOPRIGHT", frame, "TOPRIGHT", 0, 0) end local size if frame.manaBar then size = figureHeight('manaBar', frame) + figureHeight('healthBar', frame) + 1 else size = figureHeight('healthBar', frame) + 1 -- add one because of the one pixel between health and mana bar (i don't like that pixel) end frame.portrait:SetWidth( size ) frame.portrait:SetHeight( size ) end function Seerah.combatText(unit, frame) if frame.portrait then frame.combatText:SetPoint("CENTER", frame.portrait, "CENTER", 0, 0) else frame.combatText:SetPoint("CENTER", frame, "CENTER", 0, 0) end end function Seerah.comboPoints(unit, frame) if frame.group ~= "target" then return end local side = Seerah_db.profile[frame.group].comboSide if side == "left" or side == "right" then if side == "left" then frame.comboPoints:SetPoint( "RIGHT", frame, "LEFT", 0, 0) else frame.comboPoints:SetPoint( "LEFT", frame, "RIGHT", 0, 0) end frame.comboPoints:SetWidth( 10 ) frame.comboPoints:SetHeight( 50 ) for i = 1, 5 do local combo = frame.comboPoints["combo"..i] if Seerah_db.profile[frame.group].comboTexture == "default" then combo:SetTexture("Interface\\AddOns\\PitBull\\ComboPoints\\combo.tga") combo:SetWidth( 10 ) combo:SetHeight( 10 ) else combo:SetTexture(PitBull:GetStatusBarTexture()) combo:SetWidth( 5 ) combo:SetHeight( 8 ) end if i == 1 then combo:SetPoint("BOTTOM", frame.comboPoints, "BOTTOM") else combo:SetPoint("BOTTOM", frame.comboPoints["combo"..(i-1)], "TOP", 0, 2) end end elseif side == "top" or side == "bottom" then if side == "top" then frame.comboPoints:SetPoint( "TOPRIGHT", frame, "TOPRIGHT", 0, 0) else frame.comboPoints:SetPoint( "BOTTOMRIGHT", frame, "BOTTOMRIGHT", 0, 0) end frame.comboPoints:SetWidth( 50 ) frame.comboPoints:SetHeight( 10 ) for i = 1, 5 do local combo = frame.comboPoints["combo"..i] if Seerah_db.profile[frame.group].comboTexture == "default" then combo:SetTexture("Interface\\AddOns\\PitBull\\ComboPoints\\combo.tga") combo:SetWidth( 10 ) combo:SetHeight( 10 ) else combo:SetTexture(PitBull:GetStatusBarTexture()) combo:SetWidth( 5 ) combo:SetHeight( 8 ) end if i == 1 then combo:SetPoint("RIGHT", frame.comboPoints, "RIGHT") else combo:SetPoint("RIGHT", frame.comboPoints["combo"..(i-1)], "LEFT") end end end end function Seerah.comboText(unit, frame) if Seerah_db.profile[frame.group].comboText or not frame.manaBar then frame.comboText:Hide() else frame.comboText:SetPoint("CENTER", frame.manaBar, "CENTER") end end function Seerah.combatIcon(unit, frame) frame.combatIcon:SetPoint("CENTER", frame, "BOTTOMLEFT", 0, 0) frame.combatIcon:SetWidth(24) frame.combatIcon:SetHeight(24) end function Seerah.pvpIcon(unit, frame) frame.pvpIcon:SetPoint("CENTER", frame, "TOPRIGHT", 0, 0) frame.pvpIcon:SetWidth(27) frame.pvpIcon:SetHeight(27) end function Seerah.restIcon(unit, frame) if frame.combatIcon then frame.restIcon:SetPoint("LEFT", frame.combatIcon, "RIGHT", 4, 0) else frame.restIcon:SetPoint("CENTER", frame, "BOTTOMLEFT", 0, 0) end frame.restIcon:SetWidth(24) frame.restIcon:SetHeight(24) end function Seerah.leaderIcon(unit, frame) frame.leaderIcon:SetPoint("CENTER", frame, "TOPLEFT", 0, 0) frame.leaderIcon:SetWidth(18) frame.leaderIcon:SetHeight(18) end function Seerah.masterIcon(unit, frame) if frame.leaderIcon then frame.masterIcon:SetPoint("LEFT", frame.leaderIcon, "RIGHT", 4, 0) else frame.masterIcon:SetPoint("CENTER", frame, "TOPLEFT", 0, 0) end frame.masterIcon:SetWidth(20) frame.masterIcon:SetHeight(20) end local function portraitSide_get(group) return Seerah_db.profile[group].portraitSide end local function portraitSide_set(group, value) Seerah_db.profile[group].portraitSide = value for unit, frame in PitBull:IterateUnitFramesByGroup(group) do PitBull:UpdateLayout(frame) end end function Seerah.portrait_options(group) return { name = "Side", desc = "What side of the unit frame to position the portrait at.", type = "text", validate = { left = "Left", right = "Right", }, get = portraitSide_get, set = portraitSide_set, passValue = group } end local function auraSide_get(group) return Seerah_db.profile[group].auraSide end local function auraSide_set(group, value) Seerah_db.profile[group].auraSide = value for unit, frame in PitBull:IterateUnitFramesByGroup(group) do PitBull:UpdateLayout(frame) end end local function buffSide_get(group) return Seerah_db.profile[group].buffSide end local function buffSide_set(group, value) Seerah_db.profile[group].buffSide = value for unit, frame in PitBull:IterateUnitFramesByGroup(group) do PitBull:UpdateLayout(frame) end end local function debuffSide_get(group) return Seerah_db.profile[group].debuffSide end local function debuffSide_set(group, value) Seerah_db.profile[group].debuffSide = value for unit, frame in PitBull:IterateUnitFramesByGroup(group) do PitBull:UpdateLayout(frame) end end local function splitOptions_isHidden(group) return not PitBull:GetModule("Aura").db.profile[group].split end local function nonsplitOptions_isHidden(group) return PitBull:GetModule("Aura").db.profile[group].split end function Seerah.auraFrame_options(group) return { name = "Side", desc = "Options to change the side which the auras are on.", type = "group", disabled = function() if not PitBull_Aura then PitBull_Aura = PitBull:GetModule("Aura") end if not PitBull_Aura then return end return PitBull_Aura.db.profile[group].hidden end, args = { nonsplitside = { name = "Side", desc = "Which side to position all aura icons at.", type = "text", validate = { left = "Left", topleft = "Top-left", bottomleft = "Bottom-left", right = "Right", topright = "Top-right", bottomright = "Bottom-right", top = "Top", bottom = "Bottom", }, get = auraSide_get, set = auraSide_set, passValue = group, disabled = nonsplitOptions_isHidden, }, buffside = { name = "Buff side", desc = "Which side to position buff icons at.", type = "text", validate = { left = "Left", topleft = "Top-left", bottomleft = "Bottom-left", right = "Right", topright = "Top-right", bottomright = "Bottom-right", top = "Top", bottom = "Bottom", }, get = buffSide_get, set = buffSide_set, passValue = group, disabled = splitOptions_isHidden, }, debuffside = { name = "Debuff side", desc = "Which side to position debuff icons at.", type = "text", validate = { left = "Left", topleft = "Top-left", bottomleft = "Bottom-left", right = "Right", topright = "Top-right", bottomright = "Bottom-right", top = "Top", bottom = "Bottom", }, get = debuffSide_get, set = debuffSide_set, passValue = group, disabled = splitOptions_isHidden, }, } } end local function comboText_get(group) return Seerah_db.profile[group].comboText end local function comboText_set(group, value) Seerah_db.profile[group].comboText = value for unit, frame in PitBull:IterateUnitFramesByGroup(group) do PitBull:UpdateLayout(frame) end end local function comboSide_get(group) return Seerah_db.profile[group].comboSide end local function comboSide_set(group, value) Seerah_db.profile[group].comboSide = value for unit, frame in PitBull:IterateUnitFramesByGroup(group) do PitBull:UpdateLayout(frame) end end local function comboTexture_get(group) return Seerah_db.profile[group].comboTexture end local function comboTexture_set(group, value) Seerah_db.profile[group].comboTexture = value for unit, frame in PitBull:IterateUnitFramesByGroup(group) do PitBull:UpdateLayout(frame) end end Seerah.comboPoints_options_name = "Combo points" Seerah.comboPoints_options_desc = "Options for the combo point display." function Seerah.comboPoints_options(group) if group == "target" then return { name = "Side", desc = "What side of the unit frame to position the combo point display at.", type = "text", validate = { left = "Left", right = "Right", top = "Top", bottom = "Bottom", }, get = comboSide_get, set = comboSide_set, passValue = group, }, { name = "Texture", desc = "Set what texture to use for the combo points.", type = "text", validate = { default = "Default", bar = "Bar", }, get = comboTexture_get, set = comboTexture_set, passValue = group, }, { name = "Hide text", desc = "Hides the combo point text.", type = "toggle", get = comboText_get, set = comboText_set, passValue = group, } end end Seerah.extraFrames = {} local classTextStyles = { ["Standard"] = "[classification][difficultycolor][level][white] [classcolor][smartclass][white] [smartrace]", ["Hide"] = "", ["Custom"] = "Custom", ["Player Classes Only"] = "[classification][difficultycolor][level][white] [classcolor][playerclass][white] [smartrace]", ["Short"] = "[difficultycolor][level][plus][white] [smartrace]", } function Seerah.extraFrames.classText(unit, frame) local classText = newFrame("FontString", frame.overlay, "OVERLAY") frame.classText = classText local font, fontsize = PitBull:GetFont() classText:SetFont( font, fontsize ) classText:SetShadowColor(0, 0, 0, 1) classText:SetShadowOffset(0.8, -0.8) classText:SetNonSpaceWrap(false) classText:SetJustifyH("LEFT") local code if Seerah_db.profile[frame.group].classTextStyle == "Custom" then code = Seerah_db.profile[frame.group].classTextCustom else code = classTextStyles[Seerah_db.profile[frame.group].classTextStyle] end DogTag:RegisterFontString(classText, unit, code) end --[[function Seerah.classText(unit, frame) if frame.manaBar then frame.classText:SetPoint("LEFT", frame.manaBar, "LEFT", 3, 0) if frame.manaText then frame.classText:SetPoint("RIGHT", frame.manaText, "LEFT", -5, 0) end end end]]-- local function getTextStyle(group) return Seerah_db.profile[group].classTextStyle end local function setTextStyle(group, value) Seerah_db.profile[group].classTextStyle = value local code if value == "Custom" then code = Seerah_db.profile[group].classTextCustom else code = classTextStyles[value] Seerah_db.profile[group].classTextCustom = code end for unit, frame in PitBull:IterateUnitFramesByGroup(group) do DogTag:RegisterFontString(frame.classText, unit, code) end end local function getTextCustom(group) return Seerah_db.profile[group].classTextCustom end local function setTextCustom(group, value) Seerah_db.profile[group].classTextCustom = value if Seerah_db.profile[group].classTextStyle ~= "Custom" then return end for unit, frame in PitBull:IterateUnitFramesByGroup(group) do DogTag:RegisterFontString(frame.classText, unit, value) end end Seerah.classText_options_name = "Class text" Seerah.classText_options_desc = "Customize the class text." function Seerah.classText_options(group) local textValidate = {} for k in pairs(classTextStyles) do textValidate[k] = k end return { type = "text", name = "Style", desc = "Use a preconfigured style.", validate = textValidate, get = getTextStyle, set = setTextStyle, passValue = group, }, { type = "text", name = "Custom", desc = "Create a custom style for this unit type.", get = getTextCustom, set = setTextCustom, usage = "DogTag-1.0 tags. See http://www.wowace.com/wiki/DogTag-1.0", passValue = group, } end local healthTextStyles = { ["Absolute"] = "[statusgone:smarthp]", ["Absolute Short"] = "[statusgone:smarthp:short]", ["Difference"] = "[statusgone:smartmissinghp]", ["Percent"] = "[statusgone:percenthp:percent]", ["Hide"] = "", ["Mini"] = "[curhp:veryshort]", ["Custom"] = "Custom", ["Smart"] = "[statusgone:missinghp:hidezero:short:color(ff7f7f)]", } function Seerah.extraFrames.healthText(unit, frame) local healthText = newFrame("FontString", frame.overlay, "OVERLAY") frame.healthText = healthText local font, fontsize = PitBull:GetFont() healthText:SetFont(font, fontsize) healthText:SetShadowColor(0, 0, 0, 1) healthText:SetShadowOffset(0.8, -0.8) healthText:SetNonSpaceWrap(false) healthText:SetJustifyH("LEFT") local code if Seerah_db.profile[frame.group].healthTextStyle == "Custom" then code = Seerah_db.profile[frame.group].healthTextCustom else code = healthTextStyles[Seerah_db.profile[frame.group].healthTextStyle] end DogTag:RegisterFontString(healthText, unit, code) end function Seerah.healthText(unit, frame) if frame.healthBar then frame.healthText:SetPoint("RIGHT", frame.healthBar, "RIGHT", -3, 0) end end local function getTextStyle(group) return Seerah_db.profile[group].healthTextStyle end local function setTextStyle(group, value) Seerah_db.profile[group].healthTextStyle = value local code if value == "Custom" then code = Seerah_db.profile[group].healthTextCustom else code = healthTextStyles[value] Seerah_db.profile[group].healthTextCustom = code end for unit, frame in PitBull:IterateUnitFramesByGroup(group) do DogTag:RegisterFontString(frame.healthText, unit, code) end end local function getTextCustom(group) return Seerah_db.profile[group].healthTextCustom end local function setTextCustom(group, value) Seerah_db.profile[group].healthTextCustom = value if Seerah_db.profile[group].healthTextStyle ~= "Custom" then return end for unit, frame in PitBull:IterateUnitFramesByGroup(group) do DogTag:RegisterFontString(frame.healthText, unit, value) end end Seerah.healthText_options_name = "Health text" Seerah.healthText_options_desc = "Customize the health text." function Seerah.healthText_options(group) local textValidate = {} for k in pairs(healthTextStyles) do textValidate[k] = k end return { type = "text", name = "Style", desc = "Use a preconfigured style.", validate = textValidate, get = getTextStyle, set = setTextStyle, passValue = group, }, { type = "text", name = "Custom", desc = "Create a custom style for this unit type.", get = getTextCustom, set = setTextCustom, usage = "DogTag-1.0 tags. See http://www.wowace.com/wiki/DogTag-1.0", passValue = group, } end local nameTextStyles = { ["Standard"] = "[name]", ["Hostility Colored"] = "[namehostile]", ["Hide"] = "", ["Custom"] = "Custom", ["Class Colored"] = "[name:classcolor]", ["Long"] = "[level] [name:classcolor]", } function Seerah.extraFrames.nameText(unit, frame) local nameText = newFrame("FontString", frame.overlay, "OVERLAY") frame.nameText = nameText local font, fontsize = PitBull:GetFont() nameText:SetFont(font, fontsize) nameText:SetShadowColor(0, 0, 0, 1) nameText:SetShadowOffset(0.8, -0.8) nameText:SetNonSpaceWrap(false) nameText:SetJustifyH("LEFT") if Seerah_db.profile[frame.group].nameTextStyle == "Custom" then code = Seerah_db.profile[frame.group].nameTextCustom else code = nameTextStyles[Seerah_db.profile[frame.group].nameTextStyle] end DogTag:RegisterFontString(nameText, unit, code) end --[[function Seerah.nameText(unit, frame) if frame.healthBar then frame.nameText:SetPoint("LEFT", frame.healthBar, "LEFT", 3, 0) if frame.healthText then frame.nameText:SetPoint("RIGHT", frame.healthText, "LEFT", -5, 0) end end end]]-- local function getTextStyle(group) return Seerah_db.profile[group].nameTextStyle end local function setTextStyle(group, value) Seerah_db.profile[group].nameTextStyle = value local code if value == "Custom" then code = Seerah_db.profile[group].nameTextCustom else code = nameTextStyles[value] Seerah_db.profile[group].nameTextCustom = code end for unit, frame in PitBull:IterateUnitFramesByGroup(group) do DogTag:RegisterFontString(frame.nameText, unit, code) end end local function getTextCustom(group) return Seerah_db.profile[group].nameTextCustom end local function setTextCustom(group, value) Seerah_db.profile[group].nameTextCustom = value if Seerah_db.profile[group].nameTextStyle ~= "Custom" then return end for unit, frame in PitBull:IterateUnitFramesByGroup(group) do DogTag:RegisterFontString(frame.nameText, unit, value) end end Seerah.nameText_options_name = "Name text" Seerah.nameText_options_desc = "Customize the name text." function Seerah.nameText_options(group) local textValidate = {} for k in pairs(nameTextStyles) do textValidate[k] = k end return { type = "text", name = "Style", desc = "Use a preconfigured style.", validate = textValidate, get = getTextStyle, set = setTextStyle, passValue = group, }, { type = "text", name = "Custom", desc = "Create a custom style for this unit type.", get = getTextCustom, set = setTextCustom, usage = "DogTag-1.0 tags. See http://www.wowace.com/wiki/DogTag-1.0", passValue = group, } end local manaTextStyles = { ["Absolute"] = "[fractionalmana:hidenomana]", ["Absolute Short"] = "[fractionalmana:hidenomana:short]", ["Difference"] = "[missingmana:negate]", ["Percent"] = "[percentmana:percent]", ["Mini"] = "[curmana:veryshort]", ["Hide"] = "", ["Custom"] = "Custom", ["Smart"] = "[missingmana:hidezero:short:color(7f7fff)]", } function Seerah.extraFrames.manaText(unit, frame) local manaText = newFrame("FontString", frame.overlay, "OVERLAY") frame.manaText = manaText local font, fontsize = PitBull:GetFont() manaText:SetFont(font, fontsize) manaText:SetShadowColor(0, 0, 0, 1) manaText:SetShadowOffset(0.8, -0.8) manaText:SetNonSpaceWrap(false) manaText:SetJustifyH("LEFT") local code if Seerah_db.profile[frame.group].manaTextStyle == "Custom" then code = Seerah_db.profile[frame.group].manaTextCustom else code = manaTextStyles[Seerah_db.profile[frame.group].manaTextStyle] end DogTag:RegisterFontString(manaText, unit, code) end function Seerah.manaText(unit, frame) if frame.manaBar then frame.manaText:SetPoint("RIGHT", frame.manaBar, "RIGHT", -3, 0) end end local function getTextStyle(group) return Seerah_db.profile[group].manaTextStyle end local function setTextStyle(group, value) Seerah_db.profile[group].manaTextStyle = value local code if value == "Custom" then code = Seerah_db.profile[group].manaTextCustom else code = manaTextStyles[value] Seerah_db.profile[group].manaTextCustom = code end for unit, frame in PitBull:IterateUnitFramesByGroup(group) do DogTag:RegisterFontString(frame.manaText, unit, code) end end local function getTextCustom(group) return Seerah_db.profile[group].manaTextCustom end local function setTextCustom(group, value) Seerah_db.profile[group].manaTextCustom = value if Seerah_db.profile[group].manaTextStyle ~= "Custom" then return end for unit, frame in PitBull:IterateUnitFramesByGroup(group) do DogTag:RegisterFontString(frame.manaText, unit, value) end end Seerah.manaText_options_name = "Mana text" Seerah.manaText_options_desc = "Customize the mana text." function Seerah.manaText_options(group) local textValidate = {} for k in pairs(manaTextStyles) do textValidate[k] = k end return { type = "text", name = "Style", desc = "Use a preconfigured style.", validate = textValidate, get = getTextStyle, set = setTextStyle, passValue = group, }, { type = "text", name = "Custom", desc = "Create a custom style for this unit type.", get = getTextCustom, set = setTextCustom, usage = "DogTag-1.0 tags. See http://www.wowace.com/wiki/DogTag-1.0", passValue = group, } end PitBull:RegisterLayout("Seerah", Seerah)