49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Client.UserInterface.Controls;
|
|
using Robust.Client.UserInterface.XAML;
|
|
|
|
namespace Content.Client._Sunrise.UserActions;
|
|
|
|
[GenerateTypedNameReferences]
|
|
public sealed partial class UserActionsPanel : Control
|
|
{
|
|
private UserActionUIController _controller;
|
|
|
|
public UserActionsPanel()
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
IoCManager.InjectDependencies(this);
|
|
|
|
_controller = UserInterfaceManager.GetUIController<UserActionUIController>();
|
|
_controller.RegisterPanel(this);
|
|
|
|
RegisterTabs();
|
|
}
|
|
|
|
private void RegisterTabs()
|
|
{
|
|
_controller.RegisterTab(EmotesTabControl);
|
|
TabContainer.SetTabTitle(EmotesTabControl, Loc.GetString("user-action-control-tab-emote"));
|
|
|
|
_controller.RegisterTab(VerbTabControl);
|
|
TabContainer.SetTabTitle(VerbTabControl, Loc.GetString("user-action-control-tab-verbs"));
|
|
}
|
|
|
|
public void UpdateTabs()
|
|
{
|
|
var anyVisible = false;
|
|
|
|
foreach (var tab in _controller.GetTabs())
|
|
{
|
|
var visible = tab.UpdateState();
|
|
TabContainer.SetTabVisible(tab, visible);
|
|
|
|
if (visible)
|
|
anyVisible = true;
|
|
}
|
|
|
|
MainPanel.Visible = true;
|
|
NoContentLabel.Visible = !anyVisible;
|
|
}
|
|
}
|