mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Fix VV handling of remote KVPair types
There was a bunch of complex code to analyze the full type string the server sent, except I have no idea what use this was. It's both incorrect (the type string isn't guaranteed to work if the remote .NET version is different) and unnecessary as PropertyFor already handles all the cases.
This commit is contained in:
@@ -73,30 +73,10 @@ namespace Robust.Client.ViewVariables
|
||||
public VVPropEditor SetProperty(ViewVariablesBlobMembers.MemberData member)
|
||||
{
|
||||
NameLabel.Text = member.Name;
|
||||
var type = Type.GetType(member.Type);
|
||||
var type = member.Value?.GetType();
|
||||
|
||||
_bottomLabel.Text = $"Type: {member.TypePretty}";
|
||||
VVPropEditor editor;
|
||||
if (type == null || !_robustSerializer.CanSerialize(type))
|
||||
{
|
||||
// Type is server-side only.
|
||||
// Info whether it's reference or value type can be figured out from the sent value.
|
||||
if (type?.IsValueType == true || member.Value is ViewVariablesBlobMembers.ServerValueTypeToken)
|
||||
{
|
||||
// Value type, just display it stringified read-only.
|
||||
editor = new VVPropEditorDummy();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Has to be a reference type at this point.
|
||||
DebugTools.Assert(member.Value is ViewVariablesBlobMembers.ReferenceToken || member.Value == null || type?.IsClass == true || type?.IsInterface == true);
|
||||
editor = _viewVariablesManager.PropertyFor(type ?? typeof(object));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
editor = _viewVariablesManager.PropertyFor(type);
|
||||
}
|
||||
var editor = _viewVariablesManager.PropertyFor(type);
|
||||
|
||||
var view = editor.Initialize(member.Value, !member.Editable);
|
||||
if (!view.HorizontalExpand)
|
||||
|
||||
Reference in New Issue
Block a user