Added test support for List<int> display in editor
This commit is contained in:
parent
717f82f231
commit
e8d2179d76
|
@ -302,6 +302,29 @@ namespace SHADE
|
|||
registerUndoAction(object, field, newVal, gameObj);
|
||||
}
|
||||
}
|
||||
// Any List
|
||||
else if (field->FieldType->IsGenericType && field->FieldType->GetGenericTypeDefinition() == System::Collections::Generic::List<int>::typeid->GetGenericTypeDefinition())
|
||||
{
|
||||
System::Type^ listType = field->FieldType->GenericTypeArguments[0];
|
||||
System::Collections::IEnumerable^ listEnummerable = safe_cast<System::Collections::IEnumerable^>(field->GetValue(object));
|
||||
|
||||
|
||||
SHEditorUI::Text(Convert::ToNative(field->Name));
|
||||
SHEditorUI::SameLine();
|
||||
SHEditorUI::Button("+");
|
||||
|
||||
SHEditorUI::Indent();
|
||||
int i = 0;
|
||||
for each (System::Object^ obj in listEnummerable)
|
||||
{
|
||||
int val = safe_cast<int>(obj);
|
||||
SHEditorUI::InputInt(std::to_string(i), val, &isHovered);
|
||||
SHEditorUI::SameLine();
|
||||
SHEditorUI::Button("-");
|
||||
++i;
|
||||
}
|
||||
SHEditorUI::Unindent();
|
||||
}
|
||||
else
|
||||
{
|
||||
array<System::Type^>^ interfaces = field->FieldType->GetInterfaces();
|
||||
|
|
Loading…
Reference in New Issue