private void DrawMenuAccountItem(ref Rect rect, OpenLoaderAccount account) { var position = rect; position.x += 2f; var isActive = _currentAccount != null && _currentAccount.host == account.host && _currentAccount.login == account.login; EditorGUI.BeginChangeCheck(); GUI.Toggle(position, isActive, new GUIContent { text = $"{account.login}@{account.host}" }, "MenuItem"); if (EditorGUI.EndChangeCheck() && !isActive) { _view.CurrentAccount = account; editorWindow.Close(); GUIUtility.ExitGUI(); return; } rect.y += 18f; }
private void OnFocus() { if (_settings == null) { _settings = OpenLoaderSettings.Load(); CurrentAccount = _settings.SavedAccounts.Count > 0 ? _settings.SavedAccounts[0] : null; } }
public OpenLoaderAccountsPopup(OpenLoaderWindow view, float width, List <OpenLoaderAccount> savedAccounts, OpenLoaderAccount currentAccount, int accountsLimit) { _width = width; _view = view; _savedAccounts = savedAccounts; _currentAccount = currentAccount; _accountsLimit = accountsLimit; }