Skip to content

Commit

Permalink
[Legendary] webview is unsupported on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
suchmememanyskill committed Sep 1, 2022
1 parent fcd28da commit adecf92
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions LegendaryIntegration/Gui/LoginForm.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using LauncherGamePlugin;
using LauncherGamePlugin.Enums;
using LauncherGamePlugin.Forms;

namespace LegendaryIntegration.Gui;
Expand All @@ -15,15 +16,24 @@ public LoginForm(LegendaryGameSource source)

public void Show(string warningMessage = "")
{
List<FormEntry> entries = new()
List<FormEntry> entries = new();
entries.Add(Form.TextBox("Log into Epic Games", alignment: FormAlignment.Center, fontWeight: "Bold"));

if (PlatformExtensions.CurrentPlatform == Platform.Windows)
{
entries.AddRange(new List<FormEntry>()
{
Form.Separator(),
Form.TextBox("Option 1: Login via embedded webpage", FormAlignment.Center),
Form.TextBox("Click the button below to launch a new window with the Epic Game Store's login page"),
Form.Button("Back", _ => _source.App.HideForm(), "Login using embedded page", _ => _source.Login()),
Form.Separator(),
Form.TextBox("Option 2: Login via authorizationCode", FormAlignment.Center),
});
}

entries.AddRange(new List<FormEntry>()
{
Form.TextBox("Log into Epic Games", alignment: FormAlignment.Center, fontWeight: "Bold"),
Form.Separator(),
Form.TextBox("Option 1: Login via embedded webpage", FormAlignment.Center),
Form.TextBox("Click the button below to launch a new window with the Epic Game Store's login page"),
Form.Button("Back", _ => _source.App.HideForm(), "Login using embedded page", _ => _source.Login()),
Form.Separator(),
Form.TextBox("Option 2: Login via authorizationCode", FormAlignment.Center),
Form.TextBox("Click the link below, log in, and copy the authorizationCode value into the field below"),
Form.ClickableLinkBox(EPICLOGINLINK, _ => Utils.OpenUrl(EPICLOGINLINK)),
Form.TextInput("authorizationCode:"),
Expand All @@ -40,7 +50,7 @@ public void Show(string warningMessage = "")
_source.Login(authcode);
})
};
});

if (warningMessage != "")
{
Expand Down

0 comments on commit adecf92

Please sign in to comment.