Exemple #1
0
 public void DisableSpecificTool(BaseTool.ToolType rType)
 {
     //only disable the tool if it's the one we've got selected
     if (ActiveTool.m_Type == rType)
     {
         EnableDefaultTool();
     }
 }
Exemple #2
0
 bool IsScrollableTool(BaseTool.ToolType rType)
 {
     return((rType == BaseTool.ToolType.SketchSurface) ||
            (rType == BaseTool.ToolType.ColorPicker) ||
            (rType == BaseTool.ToolType.BrushPicker) ||
            (rType == BaseTool.ToolType.BrushAndColorPicker) ||
            (rType == BaseTool.ToolType.Selection) ||
            (rType == BaseTool.ToolType.EraserTool));
 }
Exemple #3
0
 public BaseTool GetToolOfType(BaseTool.ToolType type)
 {
     for (int i = 0; i < m_Tools.Length; ++i)
     {
         if (m_Tools[i].m_Type == type)
         {
             return(m_Tools[i]);
         }
     }
     return(null);
 }
Exemple #4
0
 // If the user has a tool reserved for advanced mode, revert back to default tool.
 public void EnsureUserHasBasicToolEnabled()
 {
     BaseTool.ToolType activeToolType = ActiveTool.m_Type;
     if (activeToolType == BaseTool.ToolType.Selection ||
         activeToolType == BaseTool.ToolType.ColorPicker ||
         activeToolType == BaseTool.ToolType.DropperTool ||
         activeToolType == BaseTool.ToolType.BrushPicker ||
         activeToolType == BaseTool.ToolType.BrushAndColorPicker ||
         activeToolType == BaseTool.ToolType.RepaintTool ||
         activeToolType == BaseTool.ToolType.RecolorTool ||
         activeToolType == BaseTool.ToolType.RebrushTool ||
         activeToolType == BaseTool.ToolType.PinTool ||
         activeToolType == BaseTool.ToolType.SelectionTool)
     {
         EnableDefaultTool();
     }
 }
        /// Select a group that a widget belongs to and then return the corresponding selection widget.
        public SelectionWidget StartGrabbingGroupWithWidget(GrabWidget grabWidget)
        {
            m_IsGrabbingGroup = true;

            // Save off the current tool and selection.
            m_ToolTypeBeforeGrabbingGroup           = SketchSurfacePanel.m_Instance.ActiveToolType;
            m_SelectedStrokesCopyWhileGrabbingGroup = new HashSet <Stroke>(m_SelectedStrokes);
            m_SelectedWidgetsCopyWhileGrabbingGroup = new HashSet <GrabWidget>(m_SelectedWidgets);

            // Select the group that the widget belongs to.
            ClearActiveSelection();
            SketchMemoryScript.m_Instance.PerformAndRecordCommand(
                new SelectCommand(null, new[] { grabWidget },
                                  SelectionTransform,
                                  deselect: false, initial: true, isGrabbingGroup: true));
            UpdateSelectionWidget();
            ResolveChanges();

            SketchSurfacePanel.m_Instance.ActiveTool.HideTool(true);
            return(m_SelectionWidget);
        }
Exemple #6
0
        public void EnableSpecificTool(BaseTool.ToolType rType)
        {
            if (ActiveTool.m_Type == rType)
            {
                return;
            }

            for (int i = 0; i < m_Tools.Length; ++i)
            {
                if (m_Tools[i].m_Type == rType)
                {
                    ActiveTool.EnableTool(false);

                    m_ActiveToolIndex = i;
                    ActiveTool.EnableTool(true);
                    m_ToolSelectionAggregateValue = 0.0f;
                    App.Switchboard.TriggerToolChanged();
                    return;
                }
            }
        }