/
local CHARACTER_MAXLEVEL = 80; |
DeathSnap = {} |
DeathSnap = { |
Setting = { |
Version = GetAddOnMetadata("DeathSnap", "Version"); |
Revision = tonumber(strsub("$Rev: 1056 $", 7, strlen("$Rev: 1056 $") - 2)); |
} |
}, |
DeathSnap.On = { |
On = { |
Event = function(event) |
end; |
} |
}, |
DeathSnap.Function = { |
Function = { |
TakeScreenshot = function() |
Chronos.schedule(1, TakeScreenshot) |
end; |
SetMinLevel = function(value) |
if (value >= DeathSnap.maxControl:GetValue()) then |
DeathSnap.maxControl:SetValue(value) |
DeathSnap.maxControl:Update() |
end |
end; |
SetMaxLevel = function(value) |
if (value <= DeathSnap.minControl:GetValue()) then |
DeathSnap.minControl:SetValue(value) |
DeathSnap.minControl:Update() |
end |
end; |
} |
}, |
DeathSnap.Out = { |
Out = { |
Print = function(msg) |
DEFAULT_CHAT_FRAME:AddMessage(DS_TITLE..": "..msg, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b) |
DeathSnap.Out.Print(DS_VERSION..": "..DeathSnap.Color.Green(version)) |
end; |
} |
}, |
DeathSnap.Color = { |
Color = { |
Green = function(msg) |
return "|cff00cc00"..msg.."|r"; |
return "|cffff0000"..msg.."|r"; |
end; |
}, |
} |
if (not DeathSnapFrame) then |
frame:RegisterEvent("PLAYER_DEAD") |
end |
SLASH_DSNAP1 = "/dsnap"; |
SlashCmdList["DSNAP"] = function() |
InterfaceOptionsFrame_OpenToCategory("DeathSnap") |
end |
--[[ Portfolio Registration ]]-- |
local Portfolio = LibStub("Portfolio", true) |
}, |
{ |
id = "MinLevel", |
text = DS_MINIMUM.." (%s)", |
text = DS_MINIMUM, |
subText = DS_HELP_MIN, |
type = CONTROLTYPE_SLIDER, |
minText = "Min", |
minValue = 1, |
maxValue = CHARACTER_MAXLEVEL, |
valueStep = 1, |
callback = DeathSnap.Function.SetMinLevel, |
callback = function(value) |
if (value >= DeathSnap_SavedVars["MaxLevel"]) then |
DeathSnap_SavedVars["MaxLevel"] = value |
end |
end, |
}, |
{ |
id = "MaxLevel", |
text = DS_MAXIMUM.." (%s)", |
text = DS_MAXIMUM, |
subText = DS_HELP_MAX, |
type = CONTROLTYPE_SLIDER, |
minText = "Min", |
minValue = 1, |
maxValue = CHARACTER_MAXLEVEL, |
valueStep = 1, |
callback = DeathSnap.Function.SetMaxLevel, |
callback = function(value) |
if (value <= DeathSnap_SavedVars["MinLevel"]) then |
DeathSnap_SavedVars["MinLevel"] = value |
end |
end, |
point = {"TOPLEFT", "MinLevel", "TOPRIGHT", 80, 0}, |
}, |
--[[ |
savedVarTable = "DeathSnap_SavedVars", |
} |
local optionsFrame = Portfolio.RegisterOptionSet(optionTable) |
DeathSnap.minControl = optionsFrame:GetControl("MinLevel") |
DeathSnap.maxControl = optionsFrame:GetControl("MaxLevel") |
Portfolio.RegisterOptionSet(optionTable) |
end |