2014-07-08 20:01:33 -06:00
-- If you are a common themer, DO NOT INCLUDE THIS FILE IN YOUR THEME.
-- This layer is purely for error reporting, so that you can see errors on screen easily while running stepmania.
-- If you include this file in your theme, you will not benefit from any improvements in error reporting.
-- If you want to adjust how long errors stay on screen for, call the "SetErrorMessageTime" function. (see usage notes in comments above that function)
2015-01-05 16:53:52 -07:00
if PREFSMAN : GetPreference ( " IgnoredDialogs " ) ~= " " then
return Def.Actor { }
end
2014-07-08 20:01:33 -06:00
local line_height = 12 -- A good line height for Common Normal at .5 zoom.
local min_message_time = { show = 1 , hide = .03125 }
local default_message_time = { show = 4 , hide = .125 }
local message_time = { }
for k , v in pairs ( default_message_time ) do
message_time [ k ] = v
end
-- Example usage:
-- "SetErrorMessageTime('show' 5)" sets errors to show for 5 seconds before beginning to hide.
-- "SetErrorMessageTime('hide' .5)" sets errors to hide one error every .5 seconds after the show time has passed.
function SetErrorMessageTime ( which , t )
if not min_message_time [ which ] then
MESSAGEMAN : Broadcast (
" ScriptError " , {
Message = " Attempted to set invalid overlay message time field: " ..
tostring ( which ) } )
return
end
if t < min_message_time [ which ] then
MESSAGEMAN : Broadcast (
" ScriptError " , {
Message = " Attempted to set overlay message " .. which ..
" time to below minimum of " .. min_message_time [ which ] .. " . " } )
return
end
message_time [ which ] = t
end
function GetErrorMessageTime ( which )
return message_time [ which ]
end
function GetErrorMessageTimeMin ( which )
return min_message_time [ which ]
end
function GetErrorMessageTimeDefault ( which )
return default_message_time [ which ]
end
2014-07-18 16:29:46 -06:00
local log_args = {
Name = " ScriptError " ,
ReplaceLinesWhenHidden = true ,
2014-07-22 17:51:40 -06:00
IgnoreIdentical = true ,
2014-07-18 16:29:46 -06:00
Times = message_time ,
2014-07-18 18:04:51 -06:00
Font = " Common Error " ,
2014-07-08 20:01:33 -06:00
}
2014-07-18 16:29:46 -06:00
return Def.LogDisplay ( log_args )