/
local CHARACTER_MAXLEVEL = 80; |
LevelSnap = {} |
LevelSnap = { |
LevelSnap.Setting = { |
Setting = { |
Version = GetAddOnMetadata("LevelSnap", "Version"); |
Revision = tonumber(strsub("$Rev$", 7, strlen("$Rev$") - 2)); |
} |
}, |
LevelSnap.On = { |
On = { |
Event = function(event) |
end; |
} |
}, |
LevelSnap.Function = { |
Function = { |
TakeScreenshot = function() |
Chronos.schedule(1, TakeScreenshot) |
end; |
SetMinLevel = function(value) |
if (value >= LevelSnap.maxControl:GetValue()) then |
LevelSnap.maxControl:SetValue(value) |
LevelSnap.maxControl:Update() |
end |
end; |
SetMaxLevel = function(value) |
if (value <= LevelSnap.minControl:GetValue()) then |
LevelSnap.minControl:SetValue(value) |
LevelSnap.minControl:Update() |
end |
end; |
} |
}, |
LevelSnap.Out = { |
Out = { |
Print = function(msg) |
DEFAULT_CHAT_FRAME:AddMessage(LS_TITLE..": "..msg, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b) |
LevelSnap.Out.Print(LS_VERSION..": "..LevelSnap.Color.Green(version)) |
end; |
} |
}, |
LevelSnap.Color = { |
Color = { |
Green = function(msg) |
return "|cff00cc00"..msg.."|r"; |
return "|cffff0000"..msg.."|r"; |
end; |
}, |
} |
if (not LevelSnapFrame) then |
frame:RegisterEvent("PLAYER_LEVEL_UP") |
end |
SLASH_LSNAP1 = "/lsnap"; |
SlashCmdList["LSNAP"] = function() |
InterfaceOptionsFrame_OpenToCategory("LevelSnap") |
end |
--[[ Portfolio Registration ]]-- |
local Portfolio = LibStub("Portfolio", true) |
}, |
{ |
id = "MinLevel", |
text = LS_MINIMUM.." (%s)", |
text = LS_MINIMUM, |
subText = LS_HELP_MIN, |
type = CONTROLTYPE_SLIDER, |
minText = "Min", |
minValue = 1, |
maxValue = CHARACTER_MAXLEVEL, |
valueStep = 1, |
callback = LevelSnap.Function.SetMinLevel, |
callback = function(value) |
if (value >= LevelSnap_SavedVars["MaxLevel"]) then |
LevelSnap_SavedVars["MaxLevel"] = value |
end |
end, |
}, |
{ |
id = "MaxLevel", |
text = LS_MAXIMUM.." (%s)", |
text = LS_MAXIMUM, |
subText = LS_HELP_MAX, |
type = CONTROLTYPE_SLIDER, |
minText = "Min", |
minValue = 1, |
maxValue = CHARACTER_MAXLEVEL, |
valueStep = 1, |
callback = LevelSnap.Function.SetMaxLevel, |
callback = function(value) |
if (value <= LevelSnap_SavedVars["MinLevel"]) then |
LevelSnap_SavedVars["MinLevel"] = value |
end |
end, |
point = {"TOPLEFT", "MinLevel", "TOPRIGHT", 80, 0}, |
}, |
--[[ |
savedVarTable = "LevelSnap_SavedVars", |
} |
local optionsFrame = Portfolio.RegisterOptionSet(optionTable) |
LevelSnap.minControl = optionsFrame:GetControl("MinLevel") |
LevelSnap.maxControl = optionsFrame:GetControl("MaxLevel") |
Portfolio.RegisterOptionSet(optionTable) |
end |