- add: new lobby and ui tweaks. (#7)
* base * arrow pointer for buttons * some progress for text buttons, need cleaning * fixed observe button, remove fraction * just for now * ui tweaks * more ui tweaks * feat: ченджлог в лобби --------- Co-authored-by: Remuchi <RemuchiOfficial@gmail.com>
This commit is contained in:
34
Content.Client/_Ohio/Buttons/OhioCommandButton.cs
Normal file
34
Content.Client/_Ohio/Buttons/OhioCommandButton.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Robust.Client.Console;
|
||||
|
||||
namespace Content.Client._Ohio.Buttons;
|
||||
|
||||
[Virtual]
|
||||
public class OhioCommandButton : OhioLobbyTextButton
|
||||
{
|
||||
public string? Command { get; set; }
|
||||
|
||||
public OhioCommandButton()
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user