Page 3 of 3

Re: Different Conversation UI

Posted: Fri Oct 14, 2016 6:15 pm
by nrvllrgrs
I cannot rename the button because it is created by the Dialogue System. For each PC response option, the system clones the template and adds it is an item to the response list. In your provided example, it lists all of the emails, [Logout], and Reply. Ideally, the logout and reply options should not be listed as emails, instead using predefined buttons.

Edit: I'm assuming the easiest solution is to prevent cloning a template if that option has a predefined button.

Re: Different Conversation UI

Posted: Fri Oct 14, 2016 7:37 pm
by Tony Li
Hi,

Using a predefined button work certainly work, as in the example.

Or download and import an advance copy of the updated Unity UI Support scripts that will be in the next release of the Dialogue System:

UnityUI_Support_2016-10-14.unitypackage

Response buttons cloned from the template are now renamed "Response: <your response text>" instead of "Response Button Template(Clone)".

Or, if you don't want to downnload and import the Unity UI Support scripts, create a C# script named "RemoveCloneFromName" containing this:

Code: Select all

using UnityEngine;

public class RemoveCloneFromName : MonoBehaviour {

    void Awake() {
        name = name.Replace("(Clone)", string.Empty);
    }
}
and add it to the template, or any GameObject really. It will remove "(Clone)" from the name if present.

Re: Different Conversation UI

Posted: Sat Oct 15, 2016 12:19 am
by nrvllrgrs
I could not figure out how to use Sequences to disable the buttons in the template list. However, I added an if-check around the template instantiation in to UnityUIResponseMenuControls (line 236) and it worked.

Code: Select all

// Instantiate buttons from template:
// Instantiate buttons from template:
for (int i = 0; i < responses.Length; i++) {
	if (responses[i].formattedText.position == FormattedText.NoAssignedPosition)
	{
		GameObject buttonGameObject = GameObject.Instantiate(buttonTemplate.gameObject) as GameObject;
		if (buttonGameObject == null)
		{
			Debug.LogError(string.Format("{0}: Couldn't instantiate response button template", DialogueDebug.Prefix));
		}
		else
		{
			...
		}
	}
}

Re: Different Conversation UI

Posted: Sat Oct 15, 2016 8:57 am
by Tony Li
Great; glad you got it working.