/
## Version: 1.4.2 |
## Title: LevelSnap |
## Notes: Automatically snaps a screen shot when you level. |
## OptionalDeps: Chronos, Portfolio |
## SavedVariablesPerCharacter: LevelSnap_SavedVars |
## Author: Ryan "Gryphon" Snook |
## X-Category: Miscellaneous |
## X-Embeds: Chronos, Portfolio |
## X-Email: rsnook@gmail.com |
## X-Website: http://www.wowinterface.com/downloads/info5028-LevelSnap.html |
## X-Website: http://ryan.snook.cc, http://www.wowinterface.com/downloads/info5028-LevelSnap.html |
LevelSnap.xml |
LS_CLOSEALL = "Automatically close all windows %s."; |
LS_HELP_ONOFF = "Enable/Disable LevelSnap."; |
LS_HELP_MINMAX = "Set the minimum / maximum levels in which LevelSnap is active."; |
LS_HELP_MIN = "Set the minimum level in which LevelSnap is active."; |
LS_HELP_MAX = "Set the maximum level in which LevelSnap is active."; |
LS_HELP_CLOSEWIN = "Closes all open windows before LevelSnap takes a screen shot."; |
LS_CLOSEALL = "Schlie\195\159e alle Fenster automatisch %s."; |
LS_HELP_ONOFF = "Aktiviere/Deaktiviere LevelSnap."; |
LS_HELP_MINMAX = "Setzt Minimum-Level / Maximum-Level in welchem LevelSnap aktiv ist."; |
LS_HELP_MIN = "Setzt Minimum-Level in welchem LevelSnap aktiv ist."; |
LS_HELP_MAX = "Setzt Maximum-Level in welchem LevelSnap aktiv ist."; |
LS_HELP_CLOSEWIN = "Schlie\195\159t alle offnen Fenster, bevor LevelSnap einen Screenshot schie\195\159t."; |
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd"> |
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd"> |
<!-- $Id$ --> |
<!-- Embedded Libs --> |
<Script file="Libs\Chronos\Chronos.lua"/> |
<Script file="Libs\Portfolio\Portfolio.lua"/> |
<!-- Libs --> |
<Include file="Libs\Chronos\Chronos.xml"/> |
<Include file="Libs\Portfolio\Loader.xml"/> |
<!-- Default Localization --> |
<Script file="localization.us.lua"/> |
<!-- Scripts --> |
<Script file="LevelSnap.lua"/> |
<Script file="PortfolioRegistration.lua"/> |
</Ui> |
]]-- |
local CHARACTER_MAXLEVEL = 80; |
if (not LevelSnap) then |
LevelSnap = {} |
end |
Event = function(event) |
if (event == "PLAYER_LEVEL_UP" and LevelSnap_SavedVars.Enabled == "1") then |
if (event == "PLAYER_LEVEL_UP" and LevelSnap_SavedVars.Enabled) then |
if (arg1 >= LevelSnap_SavedVars.MinLevel and arg1 <= LevelSnap_SavedVars.MaxLevel) then |
if (LevelSnap_SavedVars.CloseWindows == "1") then |
if (LevelSnap_SavedVars.CloseWindows) then |
CloseAllWindows() |
RequestTimePlayed() |
LevelSnap.Function.TakeScreenshot() |
LevelSnap.Out = { |
Print = function(msg) |
local color = NORMAL_FONT_COLOR; |
DEFAULT_CHAT_FRAME:AddMessage(LS_TITLE..": "..msg, color.r, color.g, color.b) |
DEFAULT_CHAT_FRAME:AddMessage(LS_TITLE..": "..msg, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b) |
end; |
Status = function() |
local uihide = LevelSnap.Color.Green(LS_ENABLED) |
local closeall = LevelSnap.Color.Green(LS_ENABLED) |
if (LevelSnap_SavedVars.Enabled == "0") then |
if (not LevelSnap_SavedVars.Enabled) then |
active = LevelSnap.Color.Red(LS_DISABLED) |
end |
if (LevelSnap_SavedVars.CloseWindows == "0") then |
if (not LevelSnap_SavedVars.CloseWindows) then |
closeall = LevelSnap.Color.Red(LS_DISABLED) |
end |
LevelSnap.Out.Print("AddOn "..active..". "..string.format(LS_MINMAXSET2, LS_MINIMUM, LevelSnap.Color.Green(LevelSnap_SavedVars.MinLevel)).." "..string.format(LS_MINMAXSET2, LS_MAXIMUM, LevelSnap.Color.Green(LevelSnap_SavedVars.MaxLevel)).." "..string.format(LS_CLOSEALL, closeall).." "..string.format(LS_SHOWHIDE, uihide)) |
LevelSnap.Out.Print("AddOn "..active) |
LevelSnap.Out.Print(format(LS_MINMAXSET2, LS_MINIMUM, LevelSnap.Color.Green(LevelSnap_SavedVars.MinLevel))) |
LevelSnap.Out.Print(format(LS_MINMAXSET2, LS_MAXIMUM, LevelSnap.Color.Green(LevelSnap_SavedVars.MaxLevel))) |
LevelSnap.Out.Print(format(LS_CLOSEALL, closeall)) |
end; |
Version = function() |
frame:Hide() |
frame:SetScript("OnEvent", LevelSnap.On.Event) |
frame:RegisterEvent("PLAYER_LEVEL_UP") |
end |
--[[ Portfolio Registration ]]-- |
local Portfolio = LibStub("Portfolio", true) |
if (Portfolio) then |
local optionTable = { |
id = "LevelSnap"; |
options = { |
{ |
id = "Enabled", |
text = LS_ENABLED, |
tooltipText = LS_HELP_ONOFF, |
type = CONTROLTYPE_CHECKBOX, |
defaultValue = 1, |
}, |
{ |
id = "CloseWindows", |
text = LS_CLOSEWIN, |
tooltipText = LS_HELP_CLOSEWIN, |
type = CONTROLTYPE_CHECKBOX, |
defaultValue = 1, |
}, |
{ |
id = "MinMaxLevelHeader", |
text = LS_MINIMUM.." / "..LS_MAXIMUM, |
subText = LS_HELP_MINMAX, |
type = CONTROLTYPE_HEADER, |
}, |
{ |
id = "MinLevel", |
text = LS_MINIMUM, |
subText = LS_HELP_MIN, |
type = CONTROLTYPE_SLIDER, |
minText = "Min", |
maxText = "Max", |
defaultValue = 1, |
minValue = 1, |
maxValue = CHARACTER_MAXLEVEL, |
valueStep = 1, |
callback = function(value) |
if (value >= LevelSnap_SavedVars["MaxLevel"]) then |
LevelSnap_SavedVars["MaxLevel"] = value |
end |
end, |
}, |
{ |
id = "MaxLevel", |
text = LS_MAXIMUM, |
subText = LS_HELP_MAX, |
type = CONTROLTYPE_SLIDER, |
minText = "Min", |
maxText = "Max", |
defaultValue = CHARACTER_MAXLEVEL, |
minValue = 1, |
maxValue = CHARACTER_MAXLEVEL, |
valueStep = 1, |
callback = function(value) |
if (value <= LevelSnap_SavedVars["MinLevel"]) then |
LevelSnap_SavedVars["MinLevel"] = value |
end |
end, |
point = {"TOPLEFT", "MinLevel", "TOPRIGHT", 80, 0}, |
}, |
--[[ |
{ |
id = "Status", |
text = LS_STATUS, |
tooltipText = LS_HELP_STATUS, |
type = CONTROLTYPE_BUTTON, |
callback = LevelSnap.Out.Status, |
point = {nil, "MinLevel", nil, nil, nil}, |
}, |
]]-- |
}, |
savedVarTable = "LevelSnap_SavedVars", |
} |
Portfolio.RegisterOptionSet(optionTable) |
end |