Example #1
0
        public static void PlayWithoutDeletions(this IEditorMode mode)
        {
            var ms    = mode.Model.WindowState.CurrentPosition;
            var index = mode.Model.Montage.Chunks.FindIndex(ms);

            if (index == -1)
            {
                mode.Model.WindowState.Paused = true;
                return;
            }

            if (mode.Model.Montage.Chunks[index].IsNotActive)
            {
                while (index < mode.Model.Montage.Chunks.Count && mode.Model.Montage.Chunks[index].IsNotActive)
                {
                    index++;
                }

                if (index >= mode.Model.Montage.Chunks.Count)
                {
                    mode.Model.WindowState.Paused = true;
                    return;
                }
                ms = mode.Model.WindowState.CurrentPosition = mode.Model.Montage.Chunks[index].StartTime;
            }

            mode.Model.WindowState.FaceVideoIsVisible    = mode.Model.Montage.Chunks[index].Mode == Mode.Face;
            mode.Model.WindowState.DesktopVideoIsVisible = mode.Model.Montage.Chunks[index].Mode == Mode.Desktop;
        }
Example #2
0
        public static bool ProcessNavigationKey(this IEditorMode mode, KeyboardCommandData key)
        {
            var model = mode.Model;
            var delta = 1000;

            if (key.Shift)
            {
                delta = 200;
            }
            if (key.Ctrl)
            {
                delta = 50;
            }


            switch (key.Command)
            {
            case KeyboardCommands.Left:
                model.WindowState.CurrentPosition = ((int)(model.WindowState.CurrentPosition - delta));
                return(true);

            case KeyboardCommands.Right:
                model.WindowState.CurrentPosition = ((int)(model.WindowState.CurrentPosition + delta));
                return(true);

            case KeyboardCommands.PauseResume:
                model.WindowState.Paused = !model.WindowState.Paused;
                return(true);
            }
            return(false);
        }
Example #3
0
        internal void ChangeEditorModeTo(IEditorMode mode)
        {
            ResetCurrentEditorMode();

            var newSelectedMode = EditorModes.Where(m => m.Selected);

            changeTo(newSelectedMode.First());
        }
Example #4
0
 /// <summary>
 /// Remove all callbackes from mode
 /// </summary>
 /// <param name="mode"></param>
 internal void ResetCurrentEditorMode()
 {
     if (CurrentSelectedMode != null)
     {
         CurrentSelectedMode.Selected = false;
         CurrentSelectedMode.Reset();
         CurrentSelectedMode = null;
     }
 }
Example #5
0
        /// <summary>
        /// do mode initialization here
        /// </summary>
        /// <param name="newSelectedMode"></param>
        private void changeTo(IEditorMode newSelectedMode)
        {
            CurrentSelectedMode = newSelectedMode;

            visual.CurrentHighlightingColor = CurrentSelectedMode.GetPrimaryColor();

            if (OnEditorModeChange != null)
            {
                OnEditorModeChange(CurrentSelectedMode);
            }
        }
Example #6
0
        public static bool ProcessCommonMarkupKey(this IEditorMode mode, KeyboardCommandData key)
        {
            var model = mode.Model;

            switch (key.Command)
            {
            case KeyboardCommands.InsertDeletion:
                model.InsertDeletion(model.WindowState.CurrentPosition);
                return(true);

            case KeyboardCommands.NewEpisodeHere:
                model.NewEpisodeHere();
                return(true);
            }
            return(false);
        }
Example #7
0
        private void SwitchMode(IEditorMode old_mode, IEditorMode new_mode)
        {
            if (new_mode == null)
            {
                throw new System.Exception("World.SwitchMode: new_mode parameter was null!");
            }

            if (old_mode != null)
            {
                old_mode.OnBecomeInactive();
                old_mode.GenerateUndoEvent -= UndoEventHandler;
            }

            new_mode.GenerateUndoEvent += UndoEventHandler;
            new_mode.OnBecomeActive();
        }
Example #8
0
 void ModeChanged()
 {
     if (model.WindowState.CurrentMode == EditorModes.Border)
     {
         currentMode = new BorderMode(model);
         model.WindowState.ArrangeMode = ArrangeModes.Overlay;
     }
     if (model.WindowState.CurrentMode == EditorModes.General)
     {
         currentMode = new GeneralMode(model);
     }
     if (model.WindowState.CurrentMode == EditorModes.Patch)
     {
         currentMode = new PatchMode(model);
         model.WindowState.ArrangeMode = ArrangeModes.Patching;
     }
     panel.Refresh();
 }
Example #9
0
        public static bool DefaultSpeedKey(this IEditorMode mode, KeyboardCommandData key)
        {
            var Model = mode.Model;

            switch (key.Command)
            {
            case KeyboardCommands.SpeedUp:
                Model.WindowState.SpeedRatio += 0.5;
                Model.WindowState.SpeedRatio  = Math.Min(3, Model.WindowState.SpeedRatio);
                return(true);

            case KeyboardCommands.SpeedDown:
                Model.WindowState.SpeedRatio -= 0.5;
                Model.WindowState.SpeedRatio  = Math.Max(0.5, Model.WindowState.SpeedRatio);
                return(true);
            }
            return(false);
        }
Example #10
0
        public WWorld()
        {
            m_dtStopwatch     = new System.Diagnostics.Stopwatch();
            m_persistentLines = new WLineBatcher();
            m_undoStack       = new WUndoStack();
            //m_actorEditor = new WActorEditor(this);

            m_ActorMode     = new ActorMode(this);
            m_CollisionMode = new CollisionMode(this);

            CurrentMode = m_ActorMode;

            m_sceneViews = new List <WSceneView>();

            WSceneView perspectiveView = new WSceneView();

            m_sceneViews.AddRange(new[] { perspectiveView });
        }
Example #11
0
        //private readonly WActorEditor m_actorEditor;

        public Selection(IEditorMode mode)
        {
            SelectedObjects = new List <T>();
            m_mode          = mode;
        }
Example #12
0
 void ModeChanged()
 {
     if (model.WindowState.CurrentMode == EditorModes.Border)
         currentMode = new BorderMode(model);
     if (model.WindowState.CurrentMode == EditorModes.General)
         currentMode = new GeneralMode(model);
     if (model.WindowState.CurrentMode == Tuto.Model.EditorModes.Fixes)
         currentMode = new FixesMode(model);
 }
Example #13
0
 public void SwitchToEventMode()
 {
     CurrentMode = m_EventMode;
 }
Example #14
0
 public void SwitchToCollisionMode()
 {
     CurrentMode = m_CollisionMode;
 }
Example #15
0
 public void SwitchToActorMode()
 {
     CurrentMode = m_ActorMode;
 }