diff --git a/SHADE_Managed/src/Editor/Editor.cxx b/SHADE_Managed/src/Editor/Editor.cxx index 018a9591..1097e203 100644 --- a/SHADE_Managed/src/Editor/Editor.cxx +++ b/SHADE_Managed/src/Editor/Editor.cxx @@ -197,7 +197,7 @@ namespace SHADE void Editor::renderScriptInInspector(Entity entity, Script^ script, int index) { // Constants - const std::string LABEL = Convert::ToNative(script->GetType()->Name); + const std::string LABEL = Convert::ToNative(script->GetType()->Name); // Header SHEditorUI::PushID(index); @@ -302,6 +302,10 @@ namespace SHADE title += ">"; if (SHEditorUI::CollapsingHeader(Convert::ToNative(title))) { + // Constants + const std::string LABEL = Convert::ToNative(field->Name); + SHEditorUI::PushID(LABEL); + ICallbackEvent^ callbackEvent = safe_cast(field->GetValue(object)); if (callbackEvent == nullptr) { @@ -313,27 +317,39 @@ namespace SHADE if (action->IsRuntimeAction) continue; - if (action->TargetObject == nullptr) - SHEditorUI::Text("Target Object"); - else - SHEditorUI::Text(Convert::ToNative(action->TargetObject->GetType()->Name)); + // Attempt to get the object if any + int entityId = static_cast(-1); + if (action->TargetObject) + { + Script^ script = safe_cast(action->TargetObject); + if (script) + { + entityId = static_cast(script->Owner.GetEntity()); + } + } + SHEditorUI::InputInt("", entityId); SHEditorUI::SameLine(); - - if (action->TargetMethodName == nullptr) - SHEditorUI::Text("Target Method Name"); - else - SHEditorUI::Text(Convert::ToNative(action->TargetMethodName)); + System::String^ methodName = ""; + if (action->TargetMethodName != nullptr) + { + methodName = action->TargetMethodName; + } + std::string methodNameNative = Convert::ToNative(methodName); + SHEditorUI::InputTextField("", methodNameNative); + SHEditorUI::SameLine(); + if (SHEditorUI::Button("-")) + { + callbackEvent->DeregisterAction(action); + break; + } } if (SHEditorUI::Button("Add Action")) { callbackEvent->RegisterAction(); } + + SHEditorUI::PopID(); } - // Needs to present - // - name and param list - // Needs to present for each callbackaction - // - object, methodinfo OR action - // - Ways to add or remove items } else {