/// <summary> /// Provides specialized functionality for a classic (2D) Doom Builder editing mode. /// </summary> public ClassicMode() { // Initialize this.renderer = General.Map.Renderer2D; this.renderer2d = (Renderer2D)General.Map.Renderer2D; // If the current mode is a ClassicMode, copy mouse properties if (General.Editing.Mode is ClassicMode) { ClassicMode oldmode = General.Editing.Mode as ClassicMode; // Copy mouse properties mousepos = oldmode.mousepos; mousemappos = oldmode.mousemappos; mousedownpos = oldmode.mousedownpos; mousedownmappos = oldmode.mousedownmappos; mousebuttons = oldmode.mousebuttons; mouseinside = oldmode.mouseinside; mousedragging = oldmode.mousedragging; } }
// This switches to the mode by user command (when user presses shortcut key) public void UserSwitchToMode() { // Only when a map is opened if (General.Map != null) { //mxd. Not the same mode? if (type != General.Editing.Mode.GetType()) { // Switching from volatile mode to a different volatile mode? if ((General.Editing.Mode != null) && General.Editing.Mode.Attributes.Volatile && this.attribs.Volatile) { // First cancel previous volatile mode General.Editing.CancelVolatileMode(); } // Create instance EditMode newmode = plugin.CreateObject <EditMode>(type); //mxd. Switch mode? if (newmode != null) { General.Editing.ChangeMode(newmode); } } // When in VisualMode and switching to the same VisualMode, switch back to the previous classic mode else if (General.Editing.Mode is VisualMode) { // Switch back to last classic mode General.Editing.ChangeMode(General.Editing.PreviousClassicMode.Name); } //mxd. Switch between view floor and view ceiling textures? else if (General.Editing.Mode is ClassicMode && General.Settings.SwitchViewModes) { ClassicMode.SetViewMode(General.Map.Renderer2D.ViewMode == ViewMode.FloorTextures ? ViewMode.CeilingTextures : ViewMode.FloorTextures); } } }