Dialogue Plugin

In Dialogue.h on above line 62, add:



    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Dialogue Node")
    FText AlternativeText;

In DialoguePluginEditorSettingsDetails.h, below line 15, add:


    void TextAlternativeCommited(const FText& InText, ETextCommit::Type InCommitType, UDialogue* Dialogue, int32 id);

In DialoguePluginEditorSettingsDetails.cpp, below line 68, add:


        CurrentNodeCategory.AddCustomRow(LOCTEXT("AltTextLabel", "AltTextLabel"))
        .WholeRowContent()
        
            SNew(STextBlock).Font(IDetailLayoutBuilder::GetDetailFont())
            .Text(LOCTEXT("AlternativeText", "Alternative Text"))
        ];

        CurrentNodeCategory.AddCustomRow(LOCTEXT("AltTextValue", "AltTextValue"))
        .WholeRowContent()
        
            SNew(SBox)
            .HeightOverride(100)
            
                SNew(SMultiLineEditableTextBox).Text(CurrentNode.AlternativeText)
                .AutoWrapText(true)
                .OnTextCommitted(this, &FDialoguePluginEditorSettingsDetails::TextAlternativeCommited, Dialogue, Dialogue->CurrentNodeId)
                .ModiferKeyForNewLine(EModifierKey::Shift)
            ]
        ];

Then in the same file, at the end of the file (but above the #undef macro), add:


void FDialoguePluginEditorSettingsDetails::TextAlternativeCommited(const FText& NewText, ETextCommit::Type CommitInfo, UDialogue* Dialogue, int32 id)
{
    int32 index;
    FDialogueNode CurrentNode = Dialogue->GetNodeById(id, index);

    // we don't commit text if it hasn't changed
    if (Dialogue->Data[index].AlternativeText.EqualTo(NewText))
    {
        return;
    }

    const FScopedTransaction Transaction(LOCTEXT("AltTextCommited", "Edited Node Alternative Text"));
    Dialogue->Modify();

    Dialogue->Data[index].AlternativeText = NewText;
}

Now compile, open the project and check if an additional text window has appeared like this:

https://i.gyazo./2daf02620305e4981d493c1f2bc3befe.png

If it has, check that it functions correctly, and check if the Ctrl+Z works correctly.