Change background of dialogue option depending on state
Change background of dialogue option depending on state
Hi, so my dialogue options once read should have grey background as a highlight that player already ask about tha for example. I want to do it as simple as possible. One way to do that is make variable for each dialogue option, but that is very not optimal I would say. Do dialogue system supports that feature?
Re: Change background of dialogue option depending on state
Without any scripting, you can set the format of the text (color, italics, bold, etc.), but not the background. To do this:
1. Tick the Dialogue Manager GameObject's Other Settings > Include SimStatus.
2. Set the Dialogue Manager's Input Settings > [em#] Tag For Old Responses.
3. In the Dialogue Editor window's Database tab, set the appearance of the selected [em#] tag under the Emphasis Settings foldout.
If you want to change the background, you'll need to do a little scripting. You can make a subclass of StandardUIMenuPanel. (See this post for how to replace your StandardUIMenuPanel component.) Override SetResponseButton(). Something like:
1. Tick the Dialogue Manager GameObject's Other Settings > Include SimStatus.
2. Set the Dialogue Manager's Input Settings > [em#] Tag For Old Responses.
3. In the Dialogue Editor window's Database tab, set the appearance of the selected [em#] tag under the Emphasis Settings foldout.
If you want to change the background, you'll need to do a little scripting. You can make a subclass of StandardUIMenuPanel. (See this post for how to replace your StandardUIMenuPanel component.) Override SetResponseButton(). Something like:
Code: Select all
public class MyMenuPanel : StandardUIMenuPanel
{
protected override void SetResponseButton(StandardUIResponseButton button, Response response, Transform target, int buttonNumber)
{
base.SetResponseButton(button, response, target, buttonNumber);
var alreadyAsked = DialogueLua.GetSimStatus(response.destinationEntry) == DialogueLua.WasDisplayed;
var backgroundImage = button.GetComponent<Image>();
backgroundImage.color = alreadyAsked ? Color.gray : Color.clear;
}
}