Fixed bugs related to C# script serialization and deserialization #277

Merged
Pycorax merged 4 commits from SP3-6-c-scripting into main 2022-11-25 00:08:58 +08:00
1 changed files with 10 additions and 1 deletions
Showing only changes of commit 72c8a504c5 - Show all commits

View File

@ -200,7 +200,16 @@ namespace SHADE
{
if (SHEditorUI::Button("Add Item"))
{
System::Object^ obj = System::Activator::CreateInstance(listType);
System::Object^ obj;
if (listType == System::String::typeid)
{
// Special case for string
obj = gcnew System::String("");
}
else
{
obj = System::Activator::CreateInstance(listType);
}
iList->Add(obj);
registerUndoListAddAction(listType, iList, iList->Count - 1, obj);
}