Add JSON import/export support for dialogues#21
Open
pixeru wants to merge 10 commits into
Open
Conversation
Adds FDlgJsonDialogueHelper with non-destructive and destructive JSON import/export for UDlgDialogue assets. Uses existing DlgJsonWriter/ DlgJsonParser and FDlgDialogue_FormatHumanReadable infrastructure. - ExportDialogueToJson: serializes dialogue to JSON string - ImportDialogueFromJson: updates existing dialogue text/speakers/edges - ImportDialogueFromJsonDestructive: rebuilds dialogue from JSON
- Add ImportDialogueJSON and ExportDialogueJSON UI commands - Add DesktopPlatform module dependency for file dialogs - Wire Import JSON... and Export JSON... buttons into the Dialogue Editor toolbar - Add OnCommandImportDialogueJSON and OnCommandExportDialogueJSON handlers with file picker dialogs and success/failure message boxes
Author
|
Still waiting for approval! :) |
vampy
requested changes
May 25, 2026
| else | ||
| { | ||
| // Create speech node | ||
| UDlgNode_Speech* SpeechNode = Dialogue->ConstructDialogueNode<UDlgNode_Speech>(); |
Member
There was a problem hiding this comment.
The destructive import is not a faithful full overwrite. SpeechSequenceNodes are recreated separately, but SpeechNodes also contains fallback exports for unsupported node types from ExportDialogueToHumanReadableFormat (End/Proxy/Selector/Custom/etc.).
This branch recreates every non-root SpeechNodes entry as UDlgNode_Speech, so those node types are changed into speech nodes and their original data is lost. Please either serialize enough type-specific data to reconstruct the original nodes, or avoid offering this as a destructive full-dialogue import.
This reverts commit 93bd5a7.
This reverts commit 717ce97.
Rename the node-update JSON import helpers so callers can tell they only update matching existing nodes. Rename the destructive helpers as replacement imports and document the public JSON helper behavior in the header.
Record the rebuilt dialogue node index returned by AddNode for each imported JSON node and use that remapped index when recreating FDlgEdge targets. This keeps edges valid when replacement import reorders speech and speech sequence nodes.
Keep node-update imports successful when matching JSON produces no changes, while preserving failure reporting for imports that process no nodes due to structure mismatches.
Author
|
Alright, the adjustments are applied! :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added json support so it's easier to import/export! :)
Added
Design notes