This is the code I have so far. Redrawing will make the video appear to never play. Regardless, AttractMode does not launch rom in the background. I am thinking that a true loading screen is impossible at the moment.
// Layout User Options
class UserConfig </ help="A plugin that helps create await screens." /> {
</ label="Video Path",
help="The path of the video you want to display.",
order=1 />
videoPath="loading.mp4";
</ label="Run Time",
help="The run time of the video you want to display.",
order=2 />
runTime="5000";
}
// Load Debug Module
local log = null;
if (fe.load_module("Debug")) log = Log();
// Await
class Await {
config = null;
videoPath = "";
runTime = 0;
video = null;
constructor() {
config = fe.get_config();
videoPath = config["videoPath"];
runTime = config["runTime"].tointeger();
video = fe.add_image(videoPath, 0, 0, fe.layout.width, fe.layout.height);
video.video_flags = Vid.NoAutoStart;
video.video_playing = false;
video.visible = false;
video.zorder = 9999;
fe.add_transition_callback(this, "transitions");
}
function transitions(ttype, var, ttime) {
switch(ttype) {
case Transition.ToGame:
if (ttime < runTime) {
video.visible = true;
video.video_playing = true;
return true;
}
break;
case Transition.FromGame:
video.visible = false;
break;
}
return false;
}
}
fe.plugin["Await"] <- Await();