// Mouse moves public virtual void OnMouseMove(MouseEventArgs e) { // Dragging UV? if (uvdragging) { UpdateDragUV(); } else { // Select button pressed? if (General.Actions.CheckActionActive(General.ThisAssembly, "visualselect")) { // Check if tolerance is exceeded to start UV dragging float deltaxy = General.Map.VisualCamera.AngleXY - dragstartanglexy; float deltaz = General.Map.VisualCamera.AngleZ - dragstartanglez; if ((Math.Abs(deltaxy) + Math.Abs(deltaz)) > DRAG_ANGLE_TOLERANCE) { mode.PreAction(UndoGroup.TextureOffsetChange); mode.CreateUndo("Change texture offsets"); // Start drag now uvdragging = true; mode.Renderer.ShowSelection = false; mode.Renderer.ShowHighlight = false; UpdateDragUV(); } } } }
// Moving the mouse public virtual void OnMouseMove(MouseEventArgs e) { // biwa. Paint selection going on? if (mode.PaintSelectPressed) { // toggle selected state if (mode.PaintSelectType == this.GetType().BaseType&& mode.Highlighted != this) // using BaseType so that both floor and ceiling can be selected in one go { if (General.Interface.ShiftState ^ BuilderPlug.Me.AdditiveSelect) { this.selected = true; mode.AddSelectedObject(this); } else if (General.Interface.CtrlState) { this.selected = false; mode.RemoveSelectedObject(this); } else { if (this.selected) { mode.RemoveSelectedObject(this); } else { mode.AddSelectedObject(this); } this.selected = !this.selected; } } return; } if (!General.Map.UDMF) { return; //mxd. Cannot change texture offsets in other map formats... } // Dragging UV? if (uvdragging) { UpdateDragUV(); } else { // Select button pressed? if (General.Actions.CheckActionActive(General.ThisAssembly, "visualselect")) { // Check if tolerance is exceeded to start UV dragging float deltaxy = General.Map.VisualCamera.AngleXY - dragstartanglexy; float deltaz = General.Map.VisualCamera.AngleZ - dragstartanglez; if ((Math.Abs(deltaxy) + Math.Abs(deltaz)) > DRAG_ANGLE_TOLERANCE) { mode.PreAction(UndoGroup.TextureOffsetChange); mode.CreateUndo("Change texture offsets"); // Start drag now uvdragging = true; mode.Renderer.ShowSelection = false; mode.Renderer.ShowHighlight = false; UpdateDragUV(); } } } }