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; }
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); }
internal void ChangeEditorModeTo(IEditorMode mode) { ResetCurrentEditorMode(); var newSelectedMode = EditorModes.Where(m => m.Selected); changeTo(newSelectedMode.First()); }
/// <summary> /// Remove all callbackes from mode /// </summary> /// <param name="mode"></param> internal void ResetCurrentEditorMode() { if (CurrentSelectedMode != null) { CurrentSelectedMode.Selected = false; CurrentSelectedMode.Reset(); CurrentSelectedMode = null; } }
/// <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); } }
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); }
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(); }
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(); }
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); }
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 }); }
//private readonly WActorEditor m_actorEditor; public Selection(IEditorMode mode) { SelectedObjects = new List <T>(); m_mode = mode; }
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); }
public void SwitchToEventMode() { CurrentMode = m_EventMode; }
public void SwitchToCollisionMode() { CurrentMode = m_CollisionMode; }
public void SwitchToActorMode() { CurrentMode = m_ActorMode; }