internal override IList <DrawingInstruction> CreateInstructions(ProjectInstructions projectInstructions, IList <ScriptedInstruction> script, IList <DrawingInstruction> currentInstructions) { var frameCount = Length / Delay; frameCount = frameCount % 2 == 0 ? frameCount + 1 : frameCount; var previousFrame = PreviousFrame(currentInstructions).Copy(); var newFrameTemplate = new DrawingInstruction { Cursor = false, Delay = Delay, Text = string.Concat(previousFrame.Text, Text) }; var results = new List <DrawingInstruction>(); for (int frameIndex = 0; frameIndex < frameCount; frameIndex++) { var on = frameIndex % 2 == 0; var newFrame = on ? newFrameTemplate.Copy() : previousFrame; results.Add(newFrame); } return(results); }
internal override IList <DrawingInstruction> CreateInstructions(ProjectInstructions projectInstructions, IList <ScriptedInstruction> script, IList <DrawingInstruction> currentInstructions) { var results = new List <DrawingInstruction>(); var previousFrame = PreviousFrame(currentInstructions); if (!FlashCursor) { var newFrame = new DrawingInstruction { Cursor = DrawCursor, Delay = Length, Text = previousFrame.Text }; results.Add(newFrame); if (DrawCursor) { var newFrame2 = new DrawingInstruction { Cursor = false, Delay = Length, Text = previousFrame.Text }; results.Add(newFrame2); } } else { var frameCount = Length / Delay; frameCount = frameCount % 2 == 0 ? frameCount : frameCount + 1; var newFrameTemplate = new DrawingInstruction { Cursor = true, Delay = Delay, Text = previousFrame.Text }; for (int frameIndex = 0; frameIndex < frameCount; frameIndex++) { var on = frameIndex % 2 == 0; var newFrame = on ? newFrameTemplate.Copy() : previousFrame.Copy(); results.Add(newFrame); } var lastFrame = new DrawingInstruction { Cursor = false, Delay = Delay, Text = previousFrame.Text }; results.Add(lastFrame); } return(results); }