コード例 #1
0
ファイル: PlayerWindow.cs プロジェクト: Strati/FantasyPlayer
        private void LoginWindow(IPlayerProvider playerProvider)
        {
            ImGui.SetNextWindowSize(_playerWindowSize);
            if (!ImGui.Begin($"Fantasy Player: {playerProvider.PlayerState.ServiceName} Login",
                             ref _plugin.Configuration.PlayerSettings.PlayerWindowShown,
                             ImGuiWindowFlags.NoResize))
            {
                return;
            }

            if (!playerProvider.PlayerState.IsAuthenticating)
            {
                InterfaceUtils.TextCentered($"Please login to {playerProvider.PlayerState.ServiceName} to start.");
                if (InterfaceUtils.ButtonCentered("Login"))
                {
                    playerProvider.StartAuth();
                }
            }
            else
            {
                InterfaceUtils.TextCentered("Waiting for a response to login... Please check your browser.");
                if (InterfaceUtils.ButtonCentered("Re-open Url"))
                {
                    playerProvider.RetryAuth();
                }
            }

            ImGui.End();
        }