47 lines
1.4 KiB
C#
47 lines
1.4 KiB
C#
|
using System.ComponentModel;
|
||
|
using System.Reflection;
|
||
|
using GraphicsManager;
|
||
|
using GraphicsManager.Enums;
|
||
|
using GraphicsManager.Interfaces;
|
||
|
using GraphicsManager.Objects;
|
||
|
using GraphicsManager.Objects.Core;
|
||
|
using Luski.GUI.StartPage.UI;
|
||
|
using Luski.net;
|
||
|
using OpenTK.Graphics.OpenGL4;
|
||
|
using OpenTK.Mathematics;
|
||
|
using OpenTK.Windowing.Desktop;
|
||
|
using OpenTK.Windowing.Common;
|
||
|
|
||
|
namespace Luski.GUI.MainScreen;
|
||
|
|
||
|
public class MainScreen : Window
|
||
|
{
|
||
|
private static readonly NativeWindowSettings Settings = new()
|
||
|
{
|
||
|
Title = "Luski Login",
|
||
|
WindowBorder = WindowBorder.Fixed,
|
||
|
APIVersion = new Version(3, 2),
|
||
|
StartFocused = true,
|
||
|
Size = new OpenTK.Mathematics.Vector2i(481, 838),
|
||
|
};
|
||
|
|
||
|
public MainScreen() : base(Settings)
|
||
|
{
|
||
|
Login login;
|
||
|
Controls.Add(login = new Login());
|
||
|
login.ChangeToApp += LoginOnChangeToApp;
|
||
|
}
|
||
|
|
||
|
private Task LoginOnChangeToApp()
|
||
|
{
|
||
|
Controls.Clear();
|
||
|
Title = "Luski";
|
||
|
Size = new(2048, 1334);
|
||
|
WindowBorder = WindowBorder.Resizable;
|
||
|
BackgroundColor = new Color4(34, 34, 34, 255);
|
||
|
Controls.Add(new Rectangle(new Texture(Globals.Luski.CurrentUser.GetAvatar().Result)) { Size = new(70, 70), Location = new(14 + 132, 16 + 62 + 1170)});
|
||
|
Controls.Add(new Label(){Location = new(132 + 92, 39 + 62+1170), Text = Globals.Luski.CurrentUser.Username});
|
||
|
DrawFrame();
|
||
|
return Task.CompletedTask;
|
||
|
}
|
||
|
}
|