// width and height are between [0,1] and represent a percentage of the total screen area public ToolsWindow(AmplifyShaderEditorWindow parentWindow) : base(parentWindow, 0, 0, 0, 64, "Tools", MenuAnchor.TOP_LEFT, MenuAutoSize.NONE) { m_updateButton = new ToolsMenuButton(m_parentWindow, ToolButtonType.Update, 0, 0, -1, -1, IOUtils.UpdateOutdatedGUID, string.Empty, "Create and apply shader to material.", 5); m_updateButton.ToolButtonPressedEvt += OnButtonPressedEvent; m_updateButton.AddState(IOUtils.UpdateOFFGUID); m_updateButton.AddState(IOUtils.UpdateUpToDatedGUID); m_liveButton = new ToolsMenuButton(m_parentWindow, ToolButtonType.Live, 0, 0, -1, -1, IOUtils.LiveOffGUID, string.Empty, "Automatically saves shader when canvas is changed.", 50); m_liveButton.ToolButtonPressedEvt += OnButtonPressedEvent; m_liveButton.AddState(IOUtils.LiveOnGUID); m_liveButton.AddState(IOUtils.LivePendingGUID); //ToolsMenuButton cleanUnusedNodesButton = new ToolsMenuButton( m_parentWindow, ToolButtonType.CleanUnusedNodes, 0, 0, -1, -1, IOUtils.CleanupOFFGUID, string.Empty, "Remove all nodes not connected to the master node.", 77 ); //cleanUnusedNodesButton.ToolButtonPressedEvt += OnButtonPressedEvent; //cleanUnusedNodesButton.AddState( IOUtils.CleanUpOnGUID ); //m_list[ ( int ) ToolButtonType.CleanUnusedNodes ] = cleanUnusedNodesButton; m_openSourceCodeButton = new ToolsMenuButton(m_parentWindow, ToolButtonType.OpenSourceCode, 0, 0, -1, -1, IOUtils.OpenSourceCodeOFFGUID, string.Empty, "Open shader file in your default shader editor.", 80, false); m_openSourceCodeButton.ToolButtonPressedEvt += OnButtonPressedEvent; m_openSourceCodeButton.AddState(IOUtils.OpenSourceCodeONGUID); // middle right m_cleanUnusedNodesButton = new ToolsMenuButton(m_parentWindow, ToolButtonType.CleanUnusedNodes, 0, 0, -1, -1, IOUtils.CleanupOFFGUID, string.Empty, "Remove all nodes not connected to the master node.", 77); m_cleanUnusedNodesButton.ToolButtonPressedEvt += OnButtonPressedEvent; m_cleanUnusedNodesButton.AddState(IOUtils.CleanUpOnGUID); m_focusOnMasterNodeButton = new ToolsMenuButton(m_parentWindow, ToolButtonType.FocusOnMasterNode, 0, 0, -1, -1, IOUtils.FocusNodeGUID, string.Empty, "Focus on active master node.", -1, false); m_focusOnMasterNodeButton.ToolButtonPressedEvt += OnButtonPressedEvent; m_focusOnSelectionButton = new ToolsMenuButton(m_parentWindow, ToolButtonType.FocusOnSelection, 0, 0, -1, -1, IOUtils.FitViewGUID, string.Empty, "Focus on selection or fit to screen if none selected."); m_focusOnSelectionButton.ToolButtonPressedEvt += OnButtonPressedEvent; // right m_shareButton = new ToolsMenuButton(m_parentWindow, ToolButtonType.Share, 0, 0, -1, -1, IOUtils.ShareOFFGUID, string.Empty, "Share selection", 100); m_shareButton.ToolButtonPressedEvt += OnButtonPressedEvent; m_shareButton.AddState(IOUtils.ShareONGUID); m_takeScreenshotButton = new ToolsMenuButton(m_parentWindow, ToolButtonType.TakeScreenshot, 0, 0, -1, -1, IOUtils.TakeScreenshotOFFGUID, string.Empty, "Take ScreenShot (WINDOWS ONLY).", 100); m_takeScreenshotButton.ToolButtonPressedEvt += OnButtonPressedEvent; m_takeScreenshotButton.AddState(IOUtils.TakeScreenshotONGUID); m_showInfoWindowButton = new ToolsMenuButton(m_parentWindow, ToolButtonType.ShowInfoWindow, 0, 0, -1, -1, IOUtils.ShowInfoWindowGUID, string.Empty, "Open Helper Window."); m_showInfoWindowButton.ToolButtonPressedEvt += OnButtonPressedEvent; // hidden m_showTipsWindowButton = new ToolsMenuButton(m_parentWindow, ToolButtonType.ShowTipsWindow, 0, 0, -1, -1, IOUtils.ShowTipsWindowGUID, string.Empty, "Open Quick Tips!"); m_showTipsWindowButton.ToolButtonPressedEvt += OnButtonPressedEvent; m_showConsoleWindowButton = new ToolsMenuButton(m_parentWindow, ToolButtonType.ShowConsole, 0, 0, -1, -1, IOUtils.ShowConsoleWindowGUID, string.Empty, "Show internal console", 74); m_showConsoleWindowButton.ToolButtonPressedEvt += OnButtonPressedEvent; m_showConsoleWindowButton.AddState(IOUtils.ShowConsoleWindowGUID); m_searchBarSize = new Rect(0, TabY + 4, 110, 60); }
// width and height are between [0,1] and represent a percentage of the total screen area public ToolsWindow() : base(0, 0, 0, 64, "Tools", MenuAnchor.TOP_LEFT, MenuAutoSize.NONE) { m_list = new ToolsMenuButton[4]; ToolsMenuButton updateButton = new ToolsMenuButton(ToolButtonType.Update, 0, 0, -1, -1, IOUtils.UpdateOutdatedGUID, string.Empty, "Create and apply shader to material.", 5); updateButton.ToolButtonPressedEvt += OnButtonPressedEvent; updateButton.AddState(IOUtils.UpdateOFFGUID); updateButton.AddState(IOUtils.UpdateUpToDatedGUID); m_list[( int )ToolButtonType.Update] = updateButton; ToolsMenuButton liveButton = new ToolsMenuButton(ToolButtonType.Live, 0, 0, -1, -1, IOUtils.LiveOffGUID, string.Empty, "Automatically saves shader when canvas is changed.", 50); liveButton.ToolButtonPressedEvt += OnButtonPressedEvent; liveButton.AddState(IOUtils.LiveOnGUID); liveButton.AddState(IOUtils.LivePendingGUID); m_list[( int )ToolButtonType.Live] = liveButton; ToolsMenuButton cleanUnusedNodesButton = new ToolsMenuButton(ToolButtonType.CleanUnusedNodes, 0, 0, -1, -1, IOUtils.CleanupOFFGUID, string.Empty, "Remove all nodes not connected to the master node.", 77); cleanUnusedNodesButton.ToolButtonPressedEvt += OnButtonPressedEvent; cleanUnusedNodesButton.AddState(IOUtils.CleanUpOnGUID); m_list[( int )ToolButtonType.CleanUnusedNodes] = cleanUnusedNodesButton; ToolsMenuButton openSourceCodeButton = new ToolsMenuButton(ToolButtonType.OpenSourceCode, 0, 0, -1, -1, IOUtils.OpenSourceCodeOFFGUID, string.Empty, "Open shader file in your default shader editor.", 110); openSourceCodeButton.ToolButtonPressedEvt += OnButtonPressedEvent; openSourceCodeButton.AddState(IOUtils.OpenSourceCodeONGUID); m_list[( int )ToolButtonType.OpenSourceCode] = openSourceCodeButton; //ToolsMenuButton selectShaderButton = new ToolsMenuButton( eToolButtonType.SelectShader, 0, 0, -1, -1, "UI/Buttons/ShaderSelectOFF", string.Empty, "Select current shader.", 140 ); //selectShaderButton.ToolButtonPressedEvt += OnButtonPressedEvent; //selectShaderButton.AddState( "UI/Buttons/ShaderSelectON" ); //_list[ ( int ) eToolButtonType.SelectShader ] = selectShaderButton; m_focusOnMasterNodeButton = new ToolsMenuButton(ToolButtonType.FocusOnMasterNode, 0, 0, -1, -1, IOUtils.FocusNodeGUID, string.Empty, "Focus on active master node."); m_focusOnMasterNodeButton.ToolButtonPressedEvt += OnButtonPressedEvent; m_focusOnSelectionButton = new ToolsMenuButton(ToolButtonType.FocusOnSelection, 0, 0, -1, -1, IOUtils.FitViewGUID, string.Empty, "Focus on selection or fit to screen if none selected."); m_focusOnSelectionButton.ToolButtonPressedEvt += OnButtonPressedEvent; m_showInfoWindowButton = new ToolsMenuButton(ToolButtonType.ShowInfoWindow, 0, 0, -1, -1, IOUtils.ShowInfoWindowGUID, string.Empty, "Open Helper Window."); m_showInfoWindowButton.ToolButtonPressedEvt += OnButtonPressedEvent; }