using Godot; public partial class SessionHandler : Panel { Options _Options; Reference _Reference; [Export] LineEdit UsernameBox; [Export] LineEdit PasswordBox; public override void _Ready() { _Options = GetNode( "/root/Options" ); _Reference = GetNode("/root/Reference"); _Reference.SessionHandler = this; } public async void onLogin() { (bool, string) tSessionToken = await _Reference.MistoxNet.TryGetSessionToken( UsernameBox.Text, PasswordBox.Text ); if( tSessionToken.Item1 ) { _Reference.Alert.PerformAlert( "Login Success" ); _Options._SettingsFile.Game.UserName = UsernameBox.Text; _Options._SettingsFile.Game.SessionToken = tSessionToken.Item2; _Options._SettingsFile.Save(); GetParent().Visible = false; } else { _Reference.Alert.PerformAlert("Login Failed"); } } public void onRegister() { OS.ShellOpen("https://auth.mistox.com/account/register"); } }