You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.2 KiB

4 years ago
--File Revision: 1
--Last Modification: 19/04/2014
--Change Log:
-- 19/04/2014: File Created.
--Description:
-- this file maintain the main function for row animations
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local _detalhes = _G._detalhes
3 years ago
local Loc = LibStub("AceLocale-3.0"):GetLocale ( "Details" )
4 years ago
local _
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 years ago
--basic functions
4 years ago
_detalhes.current_row_animation = ""
_detalhes.row_animation_pool = {}
function _detalhes:InstallRowAnimation (name, desc, func, options)
if (not name) then
return false
elseif (not func) then
return false
end
if (not desc) then
desc = ""
end
3 years ago
tinsert(_detalhes.row_animation_pool, {name = name, desc = desc, func = func, options = options})
4 years ago
return true
end
function _detalhes:SelectRowAnimation (name)
3 years ago
for key, value in ipairs(_detalhes.row_animation_pool) do
4 years ago
if (value.name == name) then
_detalhes.current_row_animation = name
return true
end
end
return false
end
function _detalhes:GetRowAnimationList()
local t = {}
3 years ago
for key, value in ipairs(_detalhes.row_animation_pool) do
tinsert(t, value.name)
4 years ago
end
return t
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 years ago
--install default animations
4 years ago
do
3 years ago
local fade_func = function(row, state)
4 years ago
if (state) then
3 years ago
Details.FadeHandler.Fader(row, "out")
4 years ago
else
3 years ago
Details.FadeHandler.Fader(row, "in")
4 years ago
end
end
local fade_desc = "Default animation, makes the bar fade in or fade out when showing or hiding in the window"
_detalhes:InstallRowAnimation ("Fade", fade_desc , fade_func, nil)
_detalhes:SelectRowAnimation ("Fade")
end