Ejemplo n.º 1
0
        public static void SetToolState(ToolStates state = ToolStates.Default, MT_Tools tool = MT_Tools.Off, ushort toolPhase = 0)
        {
            ToolStates previousState = ToolState;

            if (ToolState != state)
            {
                if (state != ToolStates.ToolActive && state != ToolStates.Aligning)
                {
                    UIMoreTools.m_activeToolMenu = null;
                }

                if (ToolState == ToolStates.ToolActive)
                {
                    if (MT_Tool == MT_Tools.MoveTo)
                    {
                        m_moveToPanel.Visible(false);
                    }
                }
            }

            ToolState        = state;
            m_toolsMode      = tool;
            m_alignToolPhase = toolPhase;

            if (state == ToolStates.ToolActive || state == ToolStates.Aligning || previousState == ToolStates.ToolActive || previousState == ToolStates.Aligning)
            {
                UIMoreTools.UpdateMoreTools();
            }
            m_debugPanel?.UpdatePanel();
        }
Ejemplo n.º 2
0
 public void ProcessAligning(MT_Tools mode)
 {
     if (ToolState == ToolStates.Aligning && MT_Tool == mode)
     {
         StopTool();
     }
     else
     {
         StartTool(ToolStates.Aligning, mode);
     }
 }
Ejemplo n.º 3
0
        public bool StartTool(ToolStates newToolState, MT_Tools mode)
        {
            if (ToolState == ToolStates.Cloning || ToolState == ToolStates.RightDraggingClone)
            {
                StopCloning();
            }

            if (ToolState != ToolStates.Default && ToolState != ToolStates.Aligning && ToolState != ToolStates.ToolActive)
            {
                return(false);
            }

            if (!Action.HasSelection())
            {
                return(false);
            }

            SetToolState(newToolState, mode, 1);
            UIMoreTools.CheckCloseMenu();
            return(true);
        }