public bool DoGUI() { bool enabled = GUI.enabled; if (this.constants == null) { this.constants = new ASUpdateWindow.Constants(); this.maxNickLength = 1; for (int index = 0; index < this.changesets.Length; ++index) { int x = (int)this.constants.serverUpdateInfo.CalcSize(new GUIContent(this.changesets[index].owner)).x; if (x > this.maxNickLength) { this.maxNickLength = x; } } } EditorGUIUtility.SetIconSize(this.iconSize); if (this.showingConflicts) { if (!this.asResolveWin.DoGUI(this)) { this.showingConflicts = false; } } else { this.UpdateGUI(); } EditorGUIUtility.SetIconSize(Vector2.zero); if (!this.showingConflicts) { GUILayout.BeginHorizontal(); GUI.enabled = !this.isDirSelected && this.selectedGUID != string.Empty && enabled; if (GUILayout.Button("Compare", this.constants.button, new GUILayoutOption[0])) { this.DoShowDiff(false); GUIUtility.ExitGUI(); } GUI.enabled = enabled; GUILayout.FlexibleSpace(); if (this.changesets.Length == 0) { GUI.enabled = false; } if (GUILayout.Button("Update", this.constants.bigButton, new GUILayoutOption[1] { GUILayout.MinWidth(100f) })) { if (this.changesets.Length == 0) { Debug.Log((object)"Nothing to update."); } else { this.DoUpdate(false); } this.parentWin.Repaint(); GUIUtility.ExitGUI(); } if (this.changesets.Length == 0) { GUI.enabled = enabled; } GUILayout.EndHorizontal(); if (AssetServer.GetAssetServerError() != string.Empty) { GUILayout.Space(10f); GUILayout.Label(AssetServer.GetAssetServerError(), this.constants.errorLabel, new GUILayoutOption[0]); GUILayout.Space(10f); } } GUILayout.Space(10f); return(true); }
public bool DoGUI() { bool enabled = GUI.enabled; if (this.constants == null) { this.constants = new ASUpdateWindow.Constants(); this.maxNickLength = 1; for (int index = 0; index < this.changesets.Length; ++index) { int x = (int) this.constants.serverUpdateInfo.CalcSize(new GUIContent(this.changesets[index].owner)).x; if (x > this.maxNickLength) this.maxNickLength = x; } } EditorGUIUtility.SetIconSize(this.iconSize); if (this.showingConflicts) { if (!this.asResolveWin.DoGUI(this)) this.showingConflicts = false; } else this.UpdateGUI(); EditorGUIUtility.SetIconSize(Vector2.zero); if (!this.showingConflicts) { GUILayout.BeginHorizontal(); GUI.enabled = !this.isDirSelected && this.selectedGUID != string.Empty && enabled; if (GUILayout.Button("Compare", this.constants.button, new GUILayoutOption[0])) { this.DoShowDiff(false); GUIUtility.ExitGUI(); } GUI.enabled = enabled; GUILayout.FlexibleSpace(); if (this.changesets.Length == 0) GUI.enabled = false; if (GUILayout.Button("Update", this.constants.bigButton, new GUILayoutOption[1] { GUILayout.MinWidth(100f) })) { if (this.changesets.Length == 0) Debug.Log((object) "Nothing to update."); else this.DoUpdate(false); this.parentWin.Repaint(); GUIUtility.ExitGUI(); } if (this.changesets.Length == 0) GUI.enabled = enabled; GUILayout.EndHorizontal(); if (AssetServer.GetAssetServerError() != string.Empty) { GUILayout.Space(10f); GUILayout.Label(AssetServer.GetAssetServerError(), this.constants.errorLabel, new GUILayoutOption[0]); GUILayout.Space(10f); } } GUILayout.Space(10f); return true; }