Inheritance: SF4ComboTrainerView.ObservableObject
        static internal TimeLineItemViewModel Deserialize(string stringValue)
        {
            //Deserialize actual timeline item
            TimeLineItem tmpTimeLineItem = TimeLineItem.Deserialize(stringValue);

            //Setup TimeLineItemViewModel
            TimeLineItemViewModel result = new TimeLineItemViewModel();

            result.TimeLineItem = tmpTimeLineItem;
            result.WaitFrames   = tmpTimeLineItem.GetFrameDuration();
            result.Description  = tmpTimeLineItem.Description;
            result.Index        = -1;
            result.PlaySound    = tmpTimeLineItem.PlaySound;

            return(result);
        }
Exemple #2
0
        public void LoadTimeLine(bool append = false)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter           = "SF4 Combo|*.cmb";
            openFileDialog.RestoreDirectory = true;
            openFileDialog.ShowDialog();
            if (openFileDialog.FileName != "")
            {
                string[] lines = System.IO.File.ReadAllLines(openFileDialog.FileName);

                if (!append)
                {
                    ClearTimeLine();
                }

                foreach (String line in lines)
                {
                    timeLineItems.Add(TimeLineItemViewModel.Deserialize(line));
                }
            }
        }
Exemple #3
0
        private void playTimeline()
        {
            recorder.ResetLockupTimer();
            for (int i = 0; i < timeLineItems.Count; i++)
            {
                TimeLineItemViewModel item = (TimeLineItemViewModel)TimeLineItems[i];

                //highlighting of current item
                SelectedItem = item;

                // if we aren't in a match (defined by being on a menu or pause is selected) the play timeline stops.
                if (recorder.InMatch)
                {
                    item.Action(recorder);
                }
                else
                {
                    // Get the last item in the list
                    i    = TimeLineItems.Count - 1;
                    item = (TimeLineItemViewModel)TimeLineItems[i];

                    SelectedItem = item;

                    //also kill loop
                    PlaybackStop();

                    string message = "The combo trainer has detected that SF4 didn't produce any new frames in the last 3 seconds. Make sure that\n\na) Street Fighter 4 is running and inside a match or training mode\nb) Street Fighter is not paused\nc) You are running the latest version of Street Fighter 4 AEv2012\nd) Stage Quality in your SF4 graphic settings is set to HIGH";
                    throw new Exception(message);
                }
            }

            recorder.ReleaseALL();

            //// Get the last item in the list
            //TimeLineItem lastItem = (TimeLineItem)TimeLine.Items[TimeLine.Items.Count - 1];
            SelectedItem = (TimeLineItemViewModel)TimeLineItems[TimeLineItems.Count - 1];
            PlaybackStop();
        }