Refactor Context Menus and make them use XAML & stylesheets (#4768)
* XAML verb menu * fix ghost FOV * spacing * rename missed "ContextMenu"->"EntityMenu" instances * move visibility checks to verb system * update comment * Remove CanSeeContainerCheck * use ScrollContainer measure option * MaxWidth / texxt line wrapping * verb category default Now when you click on a verb category, it should default to running the first member of that category. This makes it much more convenient to eject/insert when there is only a single option * only apply style to first verb category entry * Use new visibility flags * FoV -> Fov * Revert "only apply style to first verb category entry" This reverts commit 9a6a17dba600e3ae0421caed59fcab145c260c99. * make all entity menu visibility checks clientside * Fix empty unbuckle category * fix merge
This commit is contained in:
43
Content.Client/Commands/GroupingEntityMenuCommand.cs
Normal file
43
Content.Client/Commands/GroupingEntityMenuCommand.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Content.Client.ContextMenu.UI;
|
||||
using Content.Shared.CCVar;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Client.Commands
|
||||
{
|
||||
public class GroupingEntityMenuCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "entitymenug";
|
||||
|
||||
public string Description => "Sets the entity menu grouping type.";
|
||||
|
||||
public string Help => $"Usage: entitymenug <0:{EntityMenuPresenter.GroupingTypesCount}>";
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
shell.WriteLine(Help);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!int.TryParse(args[0], out var id))
|
||||
{
|
||||
shell.WriteLine($"{args[0]} is not a valid integer.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (id < 0 ||id > EntityMenuPresenter.GroupingTypesCount - 1)
|
||||
{
|
||||
shell.WriteLine($"{args[0]} is not a valid integer.");
|
||||
return;
|
||||
}
|
||||
|
||||
var configurationManager = IoCManager.Resolve<IConfigurationManager>();
|
||||
var cvar = CCVars.EntityMenuGroupingType;
|
||||
|
||||
configurationManager.SetCVar(cvar, id);
|
||||
shell.WriteLine($"Context Menu Grouping set to type: {configurationManager.GetCVar(cvar)}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user