public bool DoGUI() { if (constants == null) { constants = new ASMainWindow.Constants(); } if (this.resetKeyboardControl) { this.resetKeyboardControl = false; GUIUtility.keyboardControl = 0; } GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(constants.groupBox, new GUILayoutOption[0]); GUILayout.Box("Server Connection", constants.title, new GUILayoutOption[0]); GUILayout.BeginVertical(constants.contentBox, new GUILayoutOption[0]); this.DoConfigGUI(); if (AssetServer.GetAssetServerError() != string.Empty) { GUILayout.Space(10f); GUILayout.Label(AssetServer.GetAssetServerError(), constants.errorLabel, new GUILayoutOption[0]); GUILayout.Space(10f); } GUILayout.EndVertical(); GUILayout.EndVertical(); this.DoProjectsGUI(); GUILayout.EndHorizontal(); return(true); }
public bool DoGUI() { bool enabled = GUI.enabled; if (this.constants == null) { this.constants = new Constants(); this.maxNickLength = 1; for (int i = 0; i < this.changesets.Length; i++) { int x = (int)this.constants.serverUpdateInfo.CalcSize(new GUIContent(this.changesets[i].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(new GUILayoutOption[0]); 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; } GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.MinWidth(100f) }; if (GUILayout.Button("Update", this.constants.bigButton, options)) { if (this.changesets.Length == 0) { Debug.Log("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 (ASServerAdminWindow.constants == null) { ASServerAdminWindow.constants = new ASMainWindow.Constants(); ASServerAdminWindow.constants.toggleSize = ASServerAdminWindow.constants.toggle.CalcSize(new GUIContent("X")); } if (this.resetKeyboardControl) { this.resetKeyboardControl = false; GUIUtility.keyboardControl = 0; } GUILayout.BeginHorizontal(); GUILayout.BeginVertical(ASServerAdminWindow.constants.groupBox, new GUILayoutOption[0]); GUILayout.Box("Server Connection", ASServerAdminWindow.constants.title, new GUILayoutOption[0]); GUILayout.BeginVertical(ASServerAdminWindow.constants.contentBox, new GUILayoutOption[0]); Event current = Event.current; if (current.type == EventType.KeyDown && current.keyCode == KeyCode.Return && this.CanPerformCurrentAction()) { this.PerformCurrentAction(); } if (current.type == EventType.KeyDown && current.keyCode == KeyCode.Escape && this.currAction != ASServerAdminWindow.Action.Main) { this.currAction = ASServerAdminWindow.Action.Main; current.Use(); } GUILayout.BeginHorizontal(); this.server = EditorGUILayout.TextField("Server Address:", this.server, new GUILayoutOption[0]); this.ServersPopup(); GUILayout.EndHorizontal(); this.user = EditorGUILayout.TextField("User Name:", this.user, new GUILayoutOption[0]); this.password = EditorGUILayout.PasswordField("Password:"******"Connect", ASServerAdminWindow.constants.smallButton, new GUILayoutOption[0])) { this.PerformCurrentAction(); } GUI.enabled = enabled; GUILayout.EndHorizontal(); if (AssetServer.GetAssetServerError() != string.Empty) { GUILayout.Label(AssetServer.GetAssetServerError(), ASServerAdminWindow.constants.errorLabel, new GUILayoutOption[0]); } GUILayout.EndVertical(); GUILayout.EndVertical(); GUILayout.BeginVertical(ASServerAdminWindow.constants.groupBox, new GUILayoutOption[0]); GUILayout.Box("Admin Actions", ASServerAdminWindow.constants.title, new GUILayoutOption[0]); GUILayout.BeginVertical(ASServerAdminWindow.constants.contentBox, new GUILayoutOption[0]); this.ActionBox(); GUILayout.EndVertical(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(ASServerAdminWindow.constants.groupBox, new GUILayoutOption[0]); GUILayout.Box("Project", ASServerAdminWindow.constants.title, new GUILayoutOption[0]); foreach (ListViewElement listViewElement in ListViewGUILayout.ListView(this.lv, ASServerAdminWindow.constants.background)) { if (listViewElement.row == this.lv.row && Event.current.type == EventType.Repaint) { ASServerAdminWindow.constants.entrySelected.Draw(listViewElement.position, false, false, false, false); } GUILayout.Label(this.databases[listViewElement.row].name); } if (this.lv.selectionChanged) { if (this.lv.row > -1) { this.projectSelected = true; } this.currAction = ASServerAdminWindow.Action.Main; this.DoGetUsers(); } GUILayout.EndVertical(); GUILayout.BeginVertical(ASServerAdminWindow.constants.groupBox, new GUILayoutOption[0]); SplitterGUILayout.BeginHorizontalSplit(this.lvSplit); GUILayout.Box(string.Empty, ASServerAdminWindow.constants.columnHeader, new GUILayoutOption[0]); GUILayout.Box("User", ASServerAdminWindow.constants.columnHeader, new GUILayoutOption[0]); GUILayout.Box("Full Name", ASServerAdminWindow.constants.columnHeader, new GUILayoutOption[0]); GUILayout.Box("Email", ASServerAdminWindow.constants.columnHeader, new GUILayoutOption[0]); SplitterGUILayout.EndHorizontalSplit(); int left = EditorStyles.label.margin.left; foreach (ListViewElement listViewElement in ListViewGUILayout.ListView(this.lv2, ASServerAdminWindow.constants.background)) { if (listViewElement.row == this.lv2.row && Event.current.type == EventType.Repaint) { ASServerAdminWindow.constants.entrySelected.Draw(listViewElement.position, false, false, false, false); } bool flag1 = this.users[listViewElement.row].enabled != 0; bool flag2 = GUI.Toggle(new Rect(listViewElement.position.x + 2f, listViewElement.position.y - 1f, ASServerAdminWindow.constants.toggleSize.x, ASServerAdminWindow.constants.toggleSize.y), flag1, string.Empty); GUILayout.Space(ASServerAdminWindow.constants.toggleSize.x); if (flag1 != flag2 && AssetServer.AdminSetUserEnabled(this.databases[this.lv.row].dbName, this.users[listViewElement.row].userName, this.users[listViewElement.row].fullName, this.users[listViewElement.row].email, !flag2 ? 0 : 1)) { this.users[listViewElement.row].enabled = !flag2 ? 0 : 1; } GUILayout.Label(this.users[listViewElement.row].userName, new GUILayoutOption[1] { GUILayout.Width((float)(this.lvSplit.realSizes[1] - left)) }); GUILayout.Label(this.users[listViewElement.row].fullName, new GUILayoutOption[1] { GUILayout.Width((float)(this.lvSplit.realSizes[2] - left)) }); GUILayout.Label(this.users[listViewElement.row].email); } if (this.lv2.selectionChanged) { if (this.lv2.row > -1) { this.userSelected = true; } if (this.currAction == ASServerAdminWindow.Action.SetPassword) { this.currAction = ASServerAdminWindow.Action.Main; } } GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.Space(10f); if (!this.splittersOk && Event.current.type == EventType.Repaint) { this.splittersOk = true; this.parentWin.Repaint(); } return(true); }
public bool DoGUI() { bool enabled = GUI.enabled; if (constants == null) { constants = new ASMainWindow.Constants(); constants.toggleSize = constants.toggle.CalcSize(new GUIContent("X")); } if (this.resetKeyboardControl) { this.resetKeyboardControl = false; GUIUtility.keyboardControl = 0; } GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(constants.groupBox, new GUILayoutOption[0]); GUILayout.Box("Server Connection", constants.title, new GUILayoutOption[0]); GUILayout.BeginVertical(constants.contentBox, new GUILayoutOption[0]); Event current = Event.current; if (((current.type == EventType.KeyDown) && (current.keyCode == KeyCode.Return)) && this.CanPerformCurrentAction()) { this.PerformCurrentAction(); } if (((current.type == EventType.KeyDown) && (current.keyCode == KeyCode.Escape)) && (this.currAction != Action.Main)) { this.currAction = Action.Main; current.Use(); } GUILayout.BeginHorizontal(new GUILayoutOption[0]); this.server = EditorGUILayout.TextField("Server Address:", this.server, new GUILayoutOption[0]); this.ServersPopup(); GUILayout.EndHorizontal(); this.user = EditorGUILayout.TextField("User Name:", this.user, new GUILayoutOption[0]); this.password = EditorGUILayout.PasswordField("Password:"******"Connect", constants.smallButton, new GUILayoutOption[0])) { this.PerformCurrentAction(); } GUI.enabled = enabled; GUILayout.EndHorizontal(); if (AssetServer.GetAssetServerError() != string.Empty) { GUILayout.Label(AssetServer.GetAssetServerError(), constants.errorLabel, new GUILayoutOption[0]); } GUILayout.EndVertical(); GUILayout.EndVertical(); GUILayout.BeginVertical(constants.groupBox, new GUILayoutOption[0]); GUILayout.Box("Admin Actions", constants.title, new GUILayoutOption[0]); GUILayout.BeginVertical(constants.contentBox, new GUILayoutOption[0]); this.ActionBox(); GUILayout.EndVertical(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.BeginVertical(constants.groupBox, new GUILayoutOption[0]); GUILayout.Box("Project", constants.title, new GUILayoutOption[0]); IEnumerator enumerator = ListViewGUILayout.ListView(this.lv, constants.background, new GUILayoutOption[0]).GetEnumerator(); try { while (enumerator.MoveNext()) { ListViewElement element = (ListViewElement)enumerator.Current; if ((element.row == this.lv.row) && (Event.current.type == EventType.Repaint)) { constants.entrySelected.Draw(element.position, false, false, false, false); } GUILayout.Label(this.databases[element.row].name, new GUILayoutOption[0]); } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } if (this.lv.selectionChanged) { if (this.lv.row > -1) { this.projectSelected = true; } this.currAction = Action.Main; this.DoGetUsers(); } GUILayout.EndVertical(); GUILayout.BeginVertical(constants.groupBox, new GUILayoutOption[0]); SplitterGUILayout.BeginHorizontalSplit(this.lvSplit, new GUILayoutOption[0]); GUILayout.Box("", constants.columnHeader, new GUILayoutOption[0]); GUILayout.Box("User", constants.columnHeader, new GUILayoutOption[0]); GUILayout.Box("Full Name", constants.columnHeader, new GUILayoutOption[0]); GUILayout.Box("Email", constants.columnHeader, new GUILayoutOption[0]); SplitterGUILayout.EndHorizontalSplit(); int left = EditorStyles.label.margin.left; IEnumerator enumerator2 = ListViewGUILayout.ListView(this.lv2, constants.background, new GUILayoutOption[0]).GetEnumerator(); try { while (enumerator2.MoveNext()) { ListViewElement element2 = (ListViewElement)enumerator2.Current; if ((element2.row == this.lv2.row) && (Event.current.type == EventType.Repaint)) { constants.entrySelected.Draw(element2.position, false, false, false, false); } bool flag2 = this.users[element2.row].enabled != 0; bool flag3 = GUI.Toggle(new Rect(element2.position.x + 2f, element2.position.y - 1f, constants.toggleSize.x, constants.toggleSize.y), flag2, ""); GUILayout.Space(constants.toggleSize.x); if ((flag2 != flag3) && AssetServer.AdminSetUserEnabled(this.databases[this.lv.row].dbName, this.users[element2.row].userName, this.users[element2.row].fullName, this.users[element2.row].email, !flag3 ? 0 : 1)) { this.users[element2.row].enabled = !flag3 ? 0 : 1; } GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.Width((float)(this.lvSplit.realSizes[1] - left)) }; GUILayout.Label(this.users[element2.row].userName, options); GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.Width((float)(this.lvSplit.realSizes[2] - left)) }; GUILayout.Label(this.users[element2.row].fullName, optionArray2); GUILayout.Label(this.users[element2.row].email, new GUILayoutOption[0]); } } finally { IDisposable disposable2 = enumerator2 as IDisposable; if (disposable2 != null) { disposable2.Dispose(); } } if (this.lv2.selectionChanged) { if (this.lv2.row > -1) { this.userSelected = true; } if (this.currAction == Action.SetPassword) { this.currAction = Action.Main; } } GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.Space(10f); if (!this.splittersOk && (Event.current.type == EventType.Repaint)) { this.splittersOk = true; this.parentWin.Repaint(); } return(true); }