Alternate servers.

Now, using the new alternate servers.
This commit is contained in:
JacobTech 2023-08-25 12:13:06 -04:00
parent c178ec62cf
commit a6fc28e2ab
4 changed files with 17 additions and 17 deletions

View File

@ -273,7 +273,7 @@ public class MainScreen : Window
Location = new(ser.Size.X, 0), Location = new(ser.Size.X, 0),
Size = new(Size.X - ser.Size.X, Size.Y), Size = new(Size.X - ser.Size.X, Size.Y),
Anchor = ObjectAnchor.All, Anchor = ObjectAnchor.All,
BackgroundColor = Color4.DarkRed BackgroundColor = new(20,20,20,255)
}; };
Controls.Add(SerBox); Controls.Add(SerBox);
SerBox.LoadToParent(this, this); SerBox.LoadToParent(this, this);
@ -283,9 +283,12 @@ public class MainScreen : Window
#endregion #endregion
#region Channel Selector Init #region Channel Selector Init
SocketChannel currentchannel = await Server.User.GetSelectedChannel(CancellationToken.None); SocketChannel current_channel = await Server.User.GetSelectedChannel(CancellationToken.None);
Channel.SelectedTextures[0] = Globals.ms.TextureManager.AddTexture(Tools.GetResourceStream(Assembly.GetExecutingAssembly(), "Luski.Resources.Textures.al.png"));
Channel.SelectedTextures[1] = Globals.ms.TextureManager.AddTexture(Tools.GetResourceStream(Assembly.GetExecutingAssembly(), "Luski.Resources.Textures.ac.png"));
Channel.SelectedTextures[2] = Globals.ms.TextureManager.AddTexture(Tools.GetResourceStream(Assembly.GetExecutingAssembly(), "Luski.Resources.Textures.ar.png"));
List<SocketCategory> parents = new(); List<SocketCategory> parents = new();
SocketCategory? cur = await currentchannel.GetParent(); SocketCategory? cur = await current_channel.GetParent();
while (cur is not null) while (cur is not null)
{ {
parents.Add(cur); parents.Add(cur);
@ -296,16 +299,13 @@ public class MainScreen : Window
ChannelSelector cs = new(parents[0]) ChannelSelector cs = new(parents[0])
{ {
BackgroundColor = new(34, 34, 34, 255), BackgroundColor = new(34, 34, 34, 255),
Size = new((int)(307 * Globals.Settings.Scale), SerBox.Size.Y - 150), Size = new((int)(307 * Globals.Settings.Scale), SerBox.Size.Y - 106),
Anchor = ObjectAnchor.Top | ObjectAnchor.Left | ObjectAnchor.Bottom Anchor = ObjectAnchor.Top | ObjectAnchor.Left | ObjectAnchor.Bottom
}; };
parents.RemoveAt(0); parents.RemoveAt(0);
SerBox.Controls.Add(cs); SerBox.Controls.Add(cs);
cs.LoadToParent(SerBox, this); cs.ForceDistanceUpdate(SerBox);
cs.ForceDistanceUpdate();
Channel.SelectedTextures[0] = Globals.ms.TextureManager.AddTexture(Tools.GetResourceStream(Assembly.GetExecutingAssembly(), "Luski.Resources.Textures.al.png"));
Channel.SelectedTextures[1] = Globals.ms.TextureManager.AddTexture(Tools.GetResourceStream(Assembly.GetExecutingAssembly(), "Luski.Resources.Textures.ac.png"));
Channel.SelectedTextures[2] = Globals.ms.TextureManager.AddTexture(Tools.GetResourceStream(Assembly.GetExecutingAssembly(), "Luski.Resources.Textures.ar.png"));
#endregion #endregion
#region Chat Init #region Chat Init
@ -322,7 +322,7 @@ public class MainScreen : Window
#endregion #endregion
#region Channel Selector Loader #region Channel Selector Loader
_ = cs.Load(currentchannel, parents); _ = cs.Load(current_channel, parents);
#endregion #endregion
#region User Icon #region User Icon
@ -396,9 +396,7 @@ public class MainScreen : Window
Texture uut = Texture uut =
TextureManager.AddTexture(Globals.Luski.MainServer.User.GetAvatar(CancellationToken.None).Result); TextureManager.AddTexture(Globals.Luski.MainServer.User.GetAvatar(CancellationToken.None).Result);
uut.Unit = TextureUnit.Texture1; uut.Unit = TextureUnit.Texture1;
// u.Shader = Rectangle.DefaultAlphaTextureShader[Context];
//u.Textures.Add(uut);
//Controls.Add(u);
Label ul = new Label(Globals.DefaultFont) Label ul = new Label(Globals.DefaultFont)
{ {
Anchor = ObjectAnchor.Bottom | ObjectAnchor.Left, Anchor = ObjectAnchor.Bottom | ObjectAnchor.Left,

View File

@ -8,9 +8,9 @@ using GraphicsManager.Objects.Core;
using Luski.net.Interfaces; using Luski.net.Interfaces;
using Luski.net.Structures.Main; using Luski.net.Structures.Main;
using Luski.net.Structures.Public; using Luski.net.Structures.Public;
using OpenTK.Graphics.OpenGL4;
using OpenTK.Mathematics; using OpenTK.Mathematics;
using OpenTK.Windowing.Common.Input; using OpenTK.Windowing.Common.Input;
using Label = GraphicsManager.Objects.Label;
namespace Luski.GUI.MainScreen.UI.PublicServers; namespace Luski.GUI.MainScreen.UI.PublicServers;
@ -178,8 +178,10 @@ public class ChatMessage : UserControl
if (OperatingSystem.IsWindows()) if (OperatingSystem.IsWindows())
Process.Start(m.Text); Process.Start(m.Text);
else if (OperatingSystem.IsLinux()) else if (OperatingSystem.IsLinux())
if (m.Tag is string s) Process.Start("xdg-open",s); {
if (m.Tag is string s) Process.Start("xdg-open", s);
else Process.Start("xdg-open", m.Text); else Process.Start("xdg-open", m.Text);
}
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -20,7 +20,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="GraphicsManager" Version="1.0.6-alpha89" /> <PackageReference Include="GraphicsManager" Version="1.0.6-alpha89" />
<PackageReference Include="Luski.net" Version="2.0.0-alpha12" /> <PackageReference Include="Luski.net" Version="2.0.0-alpha23" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -50,7 +50,7 @@ try
Globals.ms = new MainScreen(); Globals.ms = new MainScreen();
Globals.ms.CustomF11 = false; Globals.ms.CustomF11 = false;
Globals.ms.DrawFrame(); Globals.ms.DrawFrame();
Globals.ms.Cursor = new MouseCursor(0, 0, Logo.Width, Logo.Height, pixels); //Globals.ms.Cursor = new MouseCursor(0, 0, Logo.Width, Logo.Height, pixels);
pixels = Array.Empty<byte>(); pixels = Array.Empty<byte>();
Globals.ms.StartRender(); Globals.ms.StartRender();
Globals.ms.Dispose(); Globals.ms.Dispose();