/
"BOTTOM", "BOTTOMRIGHT", "BOTTOMLEFT", |
"RIGHT", "LEFT", "CENTER"} |
local formats = {"100/100", "100%", "100/100 (100%)", "1.2k/1.2k"} |
local fontFlags = {"None", "Outline", "Thick Outline", "Monochrome"} |
local fontFlags = {"None", "Outline", "Monochrome Outline", "Monochrome"} |
local defaults = { |
raidIconPosition = "TOP", |
raidIconX = "0", |
raidIconY = "0", |
factionIcon = false, |
factionIconSize = 32, |
factionIconPosition = "TOPRIGHT", |
factionIconX = "-16", |
factionIconY = "-4", |
onCursor = false, |
anchor = "BOTTOMRIGHT", |
offsetX = "-2", |
end, |
order = 42, |
}, |
factionIcon = { |
name = "Faction Icon", |
desc = "Display the faction icon for player controlled characters.", |
type = "toggle", |
get = function() return db.factionIcon end, |
set = function() |
db.factionIcon = not db.factionIcon |
TipTop:FactionIcon() |
end, |
order = 43, |
}, |
fIconOpts = { |
name = "Faction Icon Settings", |
type = "group", |
inline = true, |
order = 44, |
args = { |
factionIconSize = { |
name = "Faction icon size", |
desc = "Width and height of the faction icon on the tooltip", |
type = "range", |
disabled = function() return not db.factionIcon end, |
min = 8, |
max = 64, |
step = 1, |
get = function() return db.factionIconSize end, |
set = function(_, factionIconSize) |
db.factionIconSize = factionIconSize |
TipTop:FactionIcon() |
end, |
order = 44, |
}, |
factionIconPosition = { |
name = "Faction icon position", |
desc = "What side of the tip you would like the icon located at.", |
type = "select", |
disabled = function() return not db.factionIcon end, |
values = positions, |
get = function() |
for k, v in pairs(positions) do |
if db.factionIconPosition == v then |
return k |
end |
end |
end, |
set = function(_, factionIconPosition) |
db.factionIconPosition = positions[factionIconPosition] |
TipTop:FactionIcon() |
end, |
order = 45, |
}, |
factionIconX = { |
name = "X Offset", |
desc = "Offsets from the icon's position left/right", |
type = "input", |
width = "half", |
disabled = function() return not db.factionIcon end, |
get = function() return db.factionIconX end, |
set = function(_,factionIconX) |
if factionIconX == nil or factionIconX == "" then |
factionIconX = "0" |
end |
db.factionIconX = factionIconX |
TipTop:FactionIcon() |
end, |
order = 47, |
}, |
factionIconY = { |
name = "Y Offset", |
desc = "Offsets from the icon's position up/down", |
type = "input", |
width = "half", |
disabled = function() return not db.factionIcon end, |
get = function() return db.factionIconY end, |
set = function(_,factionIconY) |
if factionIconY == nil or factionIconY == "" then |
factionIconY = "0" |
end |
db.factionIconY = factionIconY |
TipTop:FactionIcon() |
end, |
order = 48, |
}, |
}, |
}, |
}, |
}, |
profile = { |
local LSM = LibStub("LibSharedMedia-3.0") |
local player = UnitName("player") |
local server = GetRealmName() |
local _, db, BGPosition, color, font, classif, talentsGUID |
local _, db, BGPosition, color, font, classif, talentsGUID, factionIcon, factionTable |
local tooltips = { GameTooltip, |
ItemRefTooltip, |
ShoppingTooltip1, |
local UnitLevel = _G.UnitLevel |
local UnitHealthMax = _G.UnitHealthMax |
local UnitName = _G.UnitName |
local UnitFactionGroup = _G.UnitFactionGroup |
local UnitPlayerControlled = _G.UnitPlayerControlled |
local GameTooltipTextLeft1 = GameTooltipTextLeft1 |
local qualityColor = ITEM_QUALITY_COLORS |
end |
end |
function TipTop:FactionIcon() |
if not factionIcon then |
factionIcon = ttSBar:CreateTexture(nil, "OVERLAY") |
factionTable = { |
["Alliance"] = "Interface\\Timer\\Alliance-Logo", |
["Horde"] = "Interface\\Timer\\Horde-Logo", |
["Neutral"] = "Interface\\Timer\\Panda-Logo", |
} |
end |
factionIcon:SetWidth(db.factionIconSize) |
factionIcon:SetHeight(db.factionIconSize) |
factionIcon:SetPoint("CENTER", TipTop, db.factionIconPosition, db.factionIconX, db.factionIconY) |
factionIcon:Hide() |
end |
function TipTop:RaidIcon() |
raidIcon:SetWidth(db.raidIconSize) |
raidIcon:SetHeight(db.raidIconSize) |
raidIcon:SetTexture("Interface\\TARGETINGFRAME\\UI-RaidTargetingIcons") |
raidIcon:SetPoint("CENTER", tt, db.raidIconPosition, db.raidIconX, db.raidIconY) |
raidIcon:SetPoint("CENTER", TipTop, db.raidIconPosition, db.raidIconX, db.raidIconY) |
raidIcon:Hide() |
end |
local function FactionIconUpdate() |
if UnitPlayerControlled("mouseover") then |
factionIcon:SetTexture(factionTable[UnitFactionGroup("mouseover")]) |
factionIcon:Show() |
else |
factionIcon:Hide() |
end |
end |
local function RaidIconUpdate() |
local icon = GetRaidTargetIndex("mouseover") |
if icon then |
RaidIconUpdate() |
TalentQuery() |
FadedTip() |
if db.factionIcon then |
FactionIconUpdate() |
end |
--sets min size for aesthetics and for extended health text |
ttWidth = tt:GetWidth() |
if ttWidth < 175 and db.healthText and db.textformat == "100/100 (100%)" then |
TipTop:SBarPosition() |
TipTop:SetFonts() |
TipTop:RaidIcon() |
if db.factionIcon then |
TipTop:FactionIcon() |
end |
color = CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS --support for CUSTOM_CLASS_COLORS addons |
if CUSTOM_CLASS_COLORS then |