/
sStats.callbacks = sStats.callbacks or LibStub("CallbackHandler-1.0"):New(sStats) |
local LSM = LibStub("LibSharedMedia-3.0") |
local widgetLists = AceGUIWidgetLSMlists |
local r, g, b = 1, 0, 0 |
local db, preHex, sufHex |
local _,class = UnitClass("player") |
local modules = {} |
local fontFlags = {"None", "Outline", "Thick Outline", "Monochrome"} |
local alignments = {"RIGHT", "LEFT", "CENTER"} |
locked = false, |
preColor = {r=1, g=1, b=1}, |
sufColor = {r=1, g=1, b=1}, |
classColor = false, |
} |
if not db.locked then |
frame:SetMovable(true) |
frame:SetBackdropColor(0,0,0,.4) |
else |
frame:SetMovable(false) |
frame:SetBackdropColor(0,0,0,0) |
end |
local fstring = _G[frame:GetName().."Text"] |
fstring:ClearAllPoints() |
local f = CreateFrame("Frame", "sStats_"..module, UIParent) |
f:SetWidth(100) |
f:SetHeight(20) |
f:SetBackdrop({bgFile ="Interface\\Buttons\\WHITE8x8",}) |
f:EnableMouse(true) |
f:SetScript("OnMouseDown", function(self) if self:IsMovable() then self:StartMoving() end end) |
f:SetScript("OnMouseUp", function(self) |
sStats.optionsFrame[f:GetName()]:Show() |
end |
end) |
f:SetBackdrop({bgFile ="Interface\\Buttons\\WHITE8x8",}) |
local fstring = f:CreateFontString("sStats_"..module.."Text") |
-- ConfigModule(f, fstring) |
name = "Suffix Text Color", |
desc = "The color of the module's suffix text.", |
type = "color", |
disabled = function() return db.classColor end, |
get = function() return db.sufColor.r, db.sufColor.g, db.sufColor.b end, |
set = function(_,r,g,b) |
db.sufColor.r = r |
end, |
order = 7, |
}, |
classColor = { |
name = "Class colored suffix", |
desc = "Color the module's suffix text by class.", |
type = "toggle", |
get = function() return db.classColor end, |
set = function() |
db.classColor = not db.classColor |
if db.classColor then |
sufHex = RGBPercToHex(colors[class].r,colors[class].g,colors[class].b) |
else |
sufHex = RGBPercToHex(db.sufColor.r,db.sufColor.g,db.sufColor.b) |
end |
end, |
order = 8, |
}, |
}, |
}, |
profile = { |
end |
sStats.optionsFrame.profile = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("sStats", "Profile", "sStats", "profile") |
colors = CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS --support for CUSTOM_CLASS_COLORS addons |
if CUSTOM_CLASS_COLORS then |
CUSTOM_CLASS_COLORS:RegisterCallback(function() |
colors = CUSTOM_CLASS_COLORS |
if db.classColor then |
sufHex = RGBPercToHex(colors[class].r,colors[class].g,colors[class].b) |
end |
end) |
end |
preHex = RGBPercToHex(db.preColor.r,db.preColor.g,db.preColor.b) |
sufHex = RGBPercToHex(db.sufColor.r,db.sufColor.g,db.sufColor.b) |
if db.classColor then |
sufHex = RGBPercToHex(colors[class].r,colors[class].g,colors[class].b) |
else |
sufHex = RGBPercToHex(db.sufColor.r,db.sufColor.g,db.sufColor.b) |
end |
for k,v in pairs(modules) do |
ConfigModule(v) |
## Interface: 30200 |
## Title: sStats |
## Author: Seerah |
## Version: 1.0 beta 1 |
## Version: 1.0 beta 2 |
## Notes: memory, latency, fps, and durability display |
## SavedVariables: sStatsDB |
## SavedVariablesPerCharacter: sStatsPCDB |