Files
RobustToolbox/Robust.Client/ViewVariables/Editors/ViewVariablesPropertyEditorReference.cs
T
SilverandGitHub 25926a17b7 Renames SS14.* to Robust.* (#793)
RobustToolbox projects should be named Robust.* 

This PR changes the RobustToolbox projects from SS14.* to Robust.*

Updates SS14.* prefixes/namespaces to Robust.*
Updates SpaceStation14.sln to RobustToolbox.sln
Updates MSBUILD/SS14.* to MSBUILD/Robust.*
Updates CSProject and MSBuild references for the above
Updates git_helper.py
Removes Runserver and Runclient as they are unusable
2019-04-15 20:24:59 -06:00

40 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.IoC;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
namespace Robust.Client.ViewVariables.Editors
{
internal sealed class ViewVariablesPropertyEditorReference : ViewVariablesPropertyEditor
{
public event Action OnPressed;
protected override Control MakeUI(object value)
{
if (value == null)
{
return new Label {Text = "null", Align = Label.AlignMode.Right};
}
// NOTE: value is NOT always the actual object.
// Only thing we can really rely on is that ToString works out correctly.
// This is because of reference tokens, but due to simplicity the object ref is still passed.
var button = new Button
{
Text = $"Reference: {value}",
ClipText = true,
SizeFlagsHorizontal = Control.SizeFlags.FillExpand
};
button.OnPressed += _ =>
{
OnPressed?.Invoke();
};
return button;
}
}
}