Ejemplo n.º 1
0
        public static bool Playback_PEGI(this PlaytimePainter trg)
        {
            bool changed = false;

            pegi.newLine();

            if (PlaytimePainter.playbackPainters.Count > 0)
            {
                "Playback In progress".nl();

                if (icon.Close.Click("Cancel All Playbacks", 20))
                {
                    TexMGMT.CancelAllPlaybacks();
                }

                if (StrokeVector.PausePlayback)
                {
                    if (icon.Play.Click("Continue Playback", 20))
                    {
                        StrokeVector.PausePlayback = false;
                    }
                }
                else if (icon.Pause.Click("Pause Playback", 20))
                {
                    StrokeVector.PausePlayback = true;
                }
            }
            else
            {
                var id = trg.ImgData;

                bool gotVectors = Cfg.recordingNames.Count > 0;

                Cfg.browsedRecord = Mathf.Max(0, Mathf.Min(Cfg.browsedRecord, Cfg.recordingNames.Count - 1));

                if (gotVectors)
                {
                    pegi.select(ref Cfg.browsedRecord, Cfg.recordingNames);
                    if (icon.Play.Click("Play stroke vectors on current mesh", 18))
                    {
                        trg.PlayByFilename(Cfg.recordingNames[Cfg.browsedRecord]);
                        changed = true;
                    }

                    if (icon.Record.Click("Continue Recording", 18))
                    {
                        id.SaveName = Cfg.recordingNames[Cfg.browsedRecord];
                        id.ContinueRecording();
                        "Recording resumed".showNotification();
                    }

                    if (icon.Delete.Click("Delete", 18))
                    {
                        changed = true;
                        Cfg.recordingNames.RemoveAt(Cfg.browsedRecord);
                    }
                }

                if ((gotVectors && icon.Add.Click("Start new Vector recording", 18)) ||
                    (!gotVectors && "New Vector Recording".Click("Start New recording")
                    ))
                {
                    id.SaveName = "Unnamed";
                    id.StartRecording();
                    "Recording started".showNotification();
                }
            }

            pegi.newLine();
            pegi.Space();
            pegi.newLine();
            return(changed);
        }