26 lines
644 B
C#
26 lines
644 B
C#
using Godot;
|
|
using System;
|
|
using BITKit;
|
|
using BITKit.Auth;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace IDIS.Entities.License;
|
|
public partial class IDIS_License : EntityComponent
|
|
{
|
|
[Export] private PackedScene initialScene;
|
|
[Export] private Control licenseNode;
|
|
|
|
private IAuthService _authService;
|
|
public override void OnAwake()
|
|
{
|
|
_authService = Entity.ServiceProvider.GetRequiredService<IAuthService>();
|
|
_authService.OnAuthorized += OnAuthorized;
|
|
}
|
|
private async void OnAuthorized(string obj)
|
|
{
|
|
await BITApp.SwitchToMainThread();
|
|
GetParent().AddChild(initialScene.Instantiate());
|
|
licenseNode.QueueFree();
|
|
}
|
|
}
|