public override void OnGUI(Rect rect) { GUIStyle collabButtonStyle = "AppCommand"; var disable = EditorApplication.isPlaying; using (new EditorGUI.DisabledScope(disable)) { if (m_CurrentState == ToolbarButtonState.Plastic) { var icon = GetIconForPlastic(PlasticWindow.HasNotification); EditorGUIUtility.SetIconSize(new Vector2(16, 16)); if (GUI.Button(rect, icon, collabButtonStyle)) { PlasticWindow.Open(); } EditorGUIUtility.SetIconSize(Vector2.zero); } else { var icon = GetIconForState(); EditorGUIUtility.SetIconSize(new Vector2(16, 16)); if (GUI.Button(rect, icon, collabButtonStyle)) { CollaborateWindow.Init(); } EditorGUIUtility.SetIconSize(Vector2.zero); } } }
void IAssetFilesFilterPatternsMenuOperations.AddFilesFilterPatterns( FilterTypes type, FilterActions action, FilterOperationType operation) { PlasticWindow plasticWindow = EditorWindow.GetWindow <PlasticWindow>(); plasticWindow.AddFilesFilterPatterns(type, action, operation); }
void DoCollabDropDown(Rect rect) { UpdateCollabToolbarState(); GUIStyle plasticButtonStyle = "ToolbarButton"; GUIStyle collabButtonStyle = "OffsetDropDown"; bool openPlastic = false; bool showPopup = Toolbar.requestShowCollabToolbar; Toolbar.requestShowCollabToolbar = false; bool enable = !EditorApplication.isPlaying; using (new EditorGUI.DisabledScope(!enable)) { bool animate = m_CollabToolbarState == CollabToolbarState.InProgress; EditorGUIUtility.SetIconSize(new Vector2(12, 12)); if (m_CollabToolbarState == CollabToolbarState.Plastic) { GUIContent content = currentCollabContent; content.image = PlasticWindow.GetWindowIcon(); Width = kPlasticButtonWidth; if (GUI.Button(rect, content, plasticButtonStyle)) { openPlastic = true; } } else { Width = kCollabButtonWidth; if (GetCollabButton().OnGUI(rect, currentCollabContent, animate, collabButtonStyle)) { showPopup = true; } } EditorGUIUtility.SetIconSize(Vector2.zero); } if (m_CollabToolbarState == CollabToolbarState.Disabled) { return; } if (openPlastic) { PlasticWindow.Open(); } if (showPopup) { ShowPopup(rect); } }
internal static void IfRepositoryIsEmpty( WorkspaceInfo wkInfo, string repository, bool isGluonWorkspace, IPlasticAPI plasticApi, IProgressControls progressControls, ICreateWorkspaceListener createWorkspaceListener, PlasticWindow plasticWindow) { RepositoryInfo repInfo = null; bool isEmptyRepository = false; progressControls.ShowProgress(string.Empty); IThreadWaiter waiter = ThreadWaiter.GetWaiter(10); waiter.Execute( /*threadOperationDelegate*/ delegate { RepositorySpec repSpec = new SpecGenerator(). GenRepositorySpec(false, repository); repInfo = plasticApi.GetRepositoryInfo(repSpec); isEmptyRepository = IsEmptyRepositoryCondition. Evaluate(wkInfo, repSpec, plasticApi); }, /*afterOperationDelegate*/ delegate { progressControls.HideProgress(); if (waiter.Exception != null) { DisplayException(progressControls, waiter.Exception); return; } if (!SetupCloudProjectId.HasCloudProjectId()) { SetupCloudProjectId.ForRepository(repInfo); } if (!isEmptyRepository) { plasticWindow.RefreshWorkspaceUI(); AssetMenu.AssetMenuItems.Enable(); return; } CheckinPackagesAndProjectSettingsFolders( wkInfo, isGluonWorkspace, plasticApi, progressControls, createWorkspaceListener); }); }
PlasticWindow GetPlasticWindow() { var windows = Resources.FindObjectsOfTypeAll <PlasticWindow>(); PlasticWindow plasticWindow = windows.Length > 0 ? windows[0] : null; if (plasticWindow == null) { plasticWindow = ShowWindow.Plastic(); } return(plasticWindow); }
internal static PlasticWindow Plastic() { PlasticWindow window = EditorWindow.GetWindow <PlasticWindow>( UnityConstants.PLASTIC_WINDOW_TITLE, true, mConsoleWindowType, mProjectBrowserType); SetIcon( window, Images.GetImage(Images.Name.IconPlasticView)); return(window); }
static PlasticWindow ShowPlasticWindow(bool disableCollabWhenLoaded) { PlasticWindow window = EditorWindow.GetWindow <PlasticWindow>( UnityConstants.PLASTIC_WINDOW_TITLE, true, mConsoleWindowType, mProjectBrowserType); if (disableCollabWhenLoaded) { window.DisableCollabIfEnabledWhenLoaded(); } window.SetupWindowTitle(false); return(window); }
internal WelcomeView( PlasticWindow parentWindow, CreateWorkspaceView.ICreateWorkspaceListener createWorkspaceListener, PlasticAPI plasticApi, CmConnection cmConnection, IPlasticWebRestApi plasticWebRestApi) { mParentWindow = parentWindow; mCreateWorkspaceListener = createWorkspaceListener; mPlasticApi = plasticApi; mCmConnection = cmConnection; mPlasticWebRestApi = plasticWebRestApi; mGuiMessage = new UnityPlasticGuiMessage(parentWindow); mConfigureProgress = new ProgressControlsForViews(); mInstallerFile = GetInstallerTmpFileName.ForPlatform(); }
internal CreateWorkspaceView( PlasticWindow parentWindow, ICreateWorkspaceListener listener, PlasticAPI plasticApi, IPlasticWebRestApi plasticWebRestApi, string workspacePath) { mParentWindow = parentWindow; mCreateWorkspaceListener = listener; mWorkspacePath = workspacePath; mPlasticWebRestApi = plasticWebRestApi; mProgressControls = new ProgressControlsForViews(); mWorkspaceOperations = new WorkspaceOperations(this, mProgressControls); mCreateWorkspaceState = CreateWorkspaceViewState.BuildForProjectDefaults(); Initialize(plasticApi, plasticWebRestApi); }
internal IncomingChangesNotifier( PlasticWindow plasticWindow) { mPlasticWindow = plasticWindow; }
void IAssetMenuOperations.ShowPendingChanges() { PlasticWindow plasticWindow = EditorWindow.GetWindow <PlasticWindow>(); plasticWindow.ShowPendingChanges(); }
void IAssetMenuOperations.ShowHistory() { PlasticWindow plasticWindow = EditorWindow.GetWindow <PlasticWindow>(); plasticWindow.ShowHistory(); }
void IAssetMenuOperations.Undo() { PlasticWindow plasticWindow = EditorWindow.GetWindow <PlasticWindow>(); plasticWindow.Undo(); }
void IAssetMenuOperations.Checkout() { PlasticWindow plasticWindow = EditorWindow.GetWindow <PlasticWindow>(); plasticWindow.Checkout(); }
internal IncomingChangesNotificationPanel( PlasticWindow plasticWindow) { mPlasticWindow = plasticWindow; }