dev #17

Merged
JacobTech merged 29 commits from dev into main 2024-04-11 15:50:14 -04:00
Showing only changes of commit 086e5d157c - Show all commits

View File

@ -0,0 +1,43 @@
using GraphicsManager.Interfaces;
using GraphicsManager.Objects;
using GraphicsManager.Objects.Core;
using Luski.GUI.MainScreen.Interfaces;
using Luski.net.JsonTypes;
namespace Luski.GUI.MainScreen.UI;
public class Friend : UserControl, IChannelPick
{
public SocketRemoteUser User;
public SocketTextChannel Channel
{
get
{
return User.Channel;
}
}
private Rectangle r;
private Label Username, Status;
public Friend(SocketRemoteUser person)
{
User = person;
Size = new(370, 96);
BackgroundColor = new(34, 34, 34, 255);
Controls.Add( r = new Rectangle(new Texture(person.GetAvatar().Result)) { Location = new(15,17), Size = new(58,58)});
Controls.Add(Username = new Label() { Text = person.Username, Location = new(77,20)});
Controls.Add(Status = new Label() { Text = person.Status.ToString(), Location = new(77,48)});
//r.Clicked += AllOnClicked;
//Username.Clicked += AllOnClicked;
//Status.Clicked += AllOnClicked;
this.Clicked += AllOnClicked;
}
private Task AllOnClicked(IRenderObject arg)
{
if (ClickCon is not null) _ = ClickCon.Invoke(this);
return Task.CompletedTask;
}
public event Func<IChannelPick, Task>? ClickCon;
}