Putting unread dialogue option in Bold

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Matt_VoxPrima
Posts: 20
Joined: Tue Apr 22, 2025 3:33 pm

Putting unread dialogue option in Bold

Post by Matt_VoxPrima »

Hello!

How would you go about to make an unread, unused dialogue choice written in bold characters, and having it in regular characters when it is "used" or spent or exhausted? So that the player knows what he's already interacted with and what is fresh and new in a dialogue branching hub.
Similar to classic CRPGs.
User avatar
Tony Li
Posts: 23250
Joined: Thu Jul 18, 2013 1:27 pm

Re: Putting unread dialogue option in Bold

Post by Tony Li »

Hi,

Normally you'd set the Dialogue Manager's Display Settings > Input Settings > [em#] Tag For Old Responses to something such as Em 1. Then in the Dialogue Editor's Database section > Database Properties > Emphasis Settings set the appearance of options that have already been selected (e.g., set to grayed out italic font).

However, in your case you want to change the appearance of options that haven't been selected. To do this, you'll need to add a script with an OnConversationResponseMenu() method to the Dialogue Manager. Something like:

Code: Select all

void OnConversationResponseMenu(Response[] responses)
{
    foreach (var response in responses)
    {
        var isNew = DialogueLua.GetSimStatus(response.destinationEntry) != DialogueLua.WasDisplayed;
        if (isNew) response.formattedText.text = $"<b>{response.formattedText.text}</b>";
    }
}
You can use this in combination with [em#1] Tag For Old Responses, too, if you want.
Matt_VoxPrima
Posts: 20
Joined: Tue Apr 22, 2025 3:33 pm

Re: Putting unread dialogue option in Bold

Post by Matt_VoxPrima »

Oh I see!

I've added a script component to the dialogue manager and pasted your code in it but it created the following errors.
(I'm not a programmer '^^)
Attachments
Capture.PNG
Capture.PNG (64.52 KiB) Viewed 887 times
User avatar
Tony Li
Posts: 23250
Joined: Thu Jul 18, 2013 1:27 pm

Re: Putting unread dialogue option in Bold

Post by Tony Li »

Hi,

Try this:

DialogueChoiceBoldText.cs

Code: Select all

using UnityEngine;
using PixelCrushers.DialogueSystem;

public class DialogueChoiceBoldText : MonoBehaviour
{
    void OnConversationResponseMenu(Response[] responses)
    {
        foreach (var response in responses)
        {
            var isNew = DialogueLua.GetSimStatus(response.destinationEntry) != DialogueLua.WasDisplayed;
            if (isNew) response.formattedText.text = $"<b>{response.formattedText.text}</b>";
        }
    }
}
Matt_VoxPrima
Posts: 20
Joined: Tue Apr 22, 2025 3:33 pm

Re: Putting unread dialogue option in Bold

Post by Matt_VoxPrima »

Perfect! THank you so much!
User avatar
Tony Li
Posts: 23250
Joined: Thu Jul 18, 2013 1:27 pm

Re: Putting unread dialogue option in Bold

Post by Tony Li »

Glad to help!
Post Reply