mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-18 05:59:03 +03:00
* add: animation background * add:lobby UI * tweak * WD EDIT * fix * tweak: button color * fix * test * feat: add changelog button to lobby --------- Co-authored-by: Remuchi <RemuchiOfficial@gmail.com>
35 lines
767 B
C#
35 lines
767 B
C#
using Robust.Client.Console;
|
|
|
|
namespace Content.Client._White.UI.Buttons;
|
|
|
|
[Virtual]
|
|
public class WhiteCommandButton : WhiteLobbyTextButton
|
|
{
|
|
public string? Command { get; set; }
|
|
|
|
public WhiteCommandButton()
|
|
{
|
|
OnPressed += Execute;
|
|
}
|
|
|
|
private bool CanPress()
|
|
{
|
|
return string.IsNullOrEmpty(Command) ||
|
|
IoCManager.Resolve<IClientConGroupController>().CanCommand(Command.Split(' ')[0]);
|
|
}
|
|
|
|
protected override void EnteredTree()
|
|
{
|
|
if (!CanPress())
|
|
{
|
|
Visible = false;
|
|
}
|
|
}
|
|
|
|
protected virtual void Execute(ButtonEventArgs obj)
|
|
{
|
|
if (!string.IsNullOrEmpty(Command))
|
|
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand(Command);
|
|
}
|
|
}
|