diff --git a/auto_quest/property_editors/npc_dialog_properties/editor.iss b/auto_quest/property_editors/npc_dialog_properties/editor.iss index 675cb70..18fca70 100644 --- a/auto_quest/property_editors/npc_dialog_properties/editor.iss +++ b/auto_quest/property_editors/npc_dialog_properties/editor.iss @@ -36,12 +36,10 @@ objectdef NPCDialogPropertiesController variable string npcName = "N/A" variable jsonvalue theUi - theUi:SetValue["${this.listViewUi}"] + theUi:SetValue["${This.listViewUi.AsJSON~}"] npcName:Set["${step.Get["params","npc_name"]}"] options:Set["${step.Get["params","dialog_options"]}"] - - theUi:ParseFile["${This.PropertyPath}/list_ui.json"] theUi.Get["children", 2, "children", 2]:SetString["text", "${npcName}"] theUi.Get["children", 3, "children", 2]:SetString["text", "${options}"] diff --git a/auto_quest/property_editors/property_editors.iss b/auto_quest/property_editors/property_editors.iss index 3f4d063..2182299 100644 --- a/auto_quest/property_editors/property_editors.iss +++ b/auto_quest/property_editors/property_editors.iss @@ -12,6 +12,7 @@ objectdef PropertyEditors { static member GetPropertyEditor( string stepType ) { + echo "PropertyEditors::GetPropertyEditor[${stepType}]" if ${stepType.Equal["${MRNPCDialogPropertiesController.StepType}"]} { return MRNPCDialogPropertiesController; diff --git a/auto_quest/property_editors/run_path_properties/editor.iss b/auto_quest/property_editors/run_path_properties/editor.iss index 95d39eb..ff38528 100644 --- a/auto_quest/property_editors/run_path_properties/editor.iss +++ b/auto_quest/property_editors/run_path_properties/editor.iss @@ -31,13 +31,12 @@ objectdef RunPathPropertiesController { variable jsonvalue dialogOptions - ; dialogOptions:SetValue[$$>"{ - ; "type": "${This.StepType}", - ; "params": { - ; "npc_name": ${This.CurrentNPCName.AsJSON~}, - ; "dialog_options": ${This.CurrentDialogOptions.AsJSON~} - ; } - ; }"<$$] + dialogOptions:SetValue[$$>"{ + "type": "${This.StepType}", + "params": { + "path": ${This.PathToRun.AsJSON~} + } + }"<$$] return dialogOptions } @@ -45,13 +44,22 @@ objectdef RunPathPropertiesController member:jsonvalueref GetDisplayForProperties(jsonvalueref step) { variable jsonvalue theUi + variable jsoniterator pathIterator + variable string currentPoint - theUi:SetValue["${this.ListViewUi}"] + theUi:SetValue["${This.ListViewUi.AsJSON~}"] + step.Get["params", "path"]:GetIterator[pathIterator] + if ${pathIterator:First(exists)} + { + do + { + currentPoint:Set["x: ${pathIterator.Value.Get["x"]} y: ${pathIterator.Value.Get["y"]} z: ${pathIterator.Value.Get["z"]}"] + theUi.Get["children", 2, "items"]:Add["${currentPoint.AsJSON~}"] + } + while ${pathIterator:Next(exists)} + } - theUi:ParseFile["${This.PropertyPath}/list_ui.json"] - ; theUi.Get["children", 2, "children", 2]:SetString["text", "${npcName}"] - ; theUi.Get["children", 3, "children", 2]:SetString["text", "${options}"] return theUi } diff --git a/auto_quest/property_editors/run_path_properties/list_ui.json b/auto_quest/property_editors/run_path_properties/list_ui.json index a42f46b..9de4406 100644 --- a/auto_quest/property_editors/run_path_properties/list_ui.json +++ b/auto_quest/property_editors/run_path_properties/list_ui.json @@ -11,41 +11,14 @@ "bold": true, "heightFactor": 1.1 }, - "text": "NPC Dialog" + "text": "Run Path" }, { - "type": "stackpanel", - "orientation": "horizontal", + "type": "listbox", "horizontalAlignment": "stretch", + "borderThickness": 0, "padding": [5, 0, 0, 0], - "children": [ - { - "type": "textblock", - "text": "NPC Name:", - "margin": [0, 0, 5, 0] - }, - { - "type": "textblock", - "text": "" - } - ] - }, - { - "type": "stackpanel", - "orientation": "horizontal", - "horizontalAlignment": "stretch", - "padding": [5, 0, 0, 0], - "children": [ - { - "type": "textblock", - "text": "Options:", - "margin": [0, 0, 5, 0] - }, - { - "type": "textblock", - "text": "" - } - ] + "items": [] } ] } diff --git a/auto_quest/writer.iss b/auto_quest/writer.iss index df8a778..99e841c 100644 --- a/auto_quest/writer.iss +++ b/auto_quest/writer.iss @@ -12,16 +12,16 @@ objectdef QuestWriterController member:jsonvalueref FormatPropertiesForDisplay(jsonvalue step) { + echo "Formatting properties for ${step.Get["type"]}" + variable jsonvalue stepItem - if ${step.Get["type"].Equal["${MRNPCDialogPropertiesController.StepType}"]} - { - stepItem:SetValue["${MRNPCDialogPropertiesController.GetDisplayForProperties[step].AsJSON~}"] - return stepItem - } - else - { - return null - } + variable weakref stepProperties + stepProperties:SetReference[${PropertyEditors.GetPropertyEditor[${step.Get["type"]}]}] + + + stepItem:SetValue["${stepProperties.GetDisplayForProperties[step]}"] + + return stepItem } member:string GetQuestStepsForDisplay()