I would like to put some icons inline in the dialogue text according to the console, for example "press <action1 ... /> to attack".
I'm making a research for put the icons inline but i would like to know if i can parse this stuff in the normal flow of the logic, some method that i can override or something like that or a need to make my own Parser and call before the base.showSubtitle(...) in my UnityUIDialogueUI.cs.
The main idea is to use a generic custom tag like <action1 ... /> and according the console show the device button icon if XBOX show "A" icon, if is PS "X" icon, ...
using UnityEngine;
using PixelCrushers.DialogueSystem;
public class MyDialogueUI : UnityUIDialogueUI {
public override void ShowSubtitle(Subtitle subtitle) {
// Extract <action1>:
bool hasAction1 = subtitle.formattedText.text.Contains("<action1>");
subtitle.formattedText.text = subtitle.formattedText.text.Replace("<action1>", string.Empty);
// Show the subtitle without the action tags:
base.ShowSubtitle(subtitle);
// Show the action buttons:
if (hasAction1) ShowActionButton(1); // example.
}
Option 2:
Add a script to the Dialogue Manager that has an OnConversationLine method. Something like this: