示例#1
0
        private void DrawAlertsStage()
        {
            if (DialogueManager.Instance.displaySettings.alertSettings == null)
            {
                DialogueManager.Instance.displaySettings.alertSettings = new DisplaySettings.AlertSettings();
            }
            EditorGUILayout.LabelField("Alerts", EditorStyles.boldLabel);
            EditorWindowTools.StartIndentedSection();
            EditorGUILayout.HelpBox("Alerts are gameplay messages. They can be delivered from conversations or other sources.", MessageType.Info);
            EditorGUILayout.BeginHorizontal();
            DialogueManager.Instance.displaySettings.alertSettings.allowAlertsDuringConversations = EditorGUILayout.Toggle("Allow In Conversations", DialogueManager.Instance.displaySettings.alertSettings.allowAlertsDuringConversations);
            EditorGUILayout.HelpBox("Tick to allow alerts to be displayed while in conversations. If unticked, alerts won't be displayed until the conversation has ended.", MessageType.None);
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            bool monitorAlerts = EditorGUILayout.Toggle("Monitor Alerts", (DialogueManager.Instance.displaySettings.alertSettings.alertCheckFrequency > 0));

            EditorGUILayout.HelpBox("Tick to constantly monitor the Lua value \"Variable['Alert']\" and display its contents as an alert. This runs as a background process. The value is automatically checked at the end of conversations, and you can check it manually. Unless you have a need to constantly monitor the value, it's more efficient to leave this unticked.", MessageType.None);
            EditorGUILayout.EndHorizontal();
            if (monitorAlerts)
            {
                if (Tools.ApproximatelyZero(DialogueManager.Instance.displaySettings.alertSettings.alertCheckFrequency))
                {
                    DialogueManager.Instance.displaySettings.alertSettings.alertCheckFrequency = DefaultAlertCheckFrequency;
                }
                DialogueManager.Instance.displaySettings.alertSettings.alertCheckFrequency = EditorGUILayout.FloatField("Frequency (Seconds)", DialogueManager.Instance.displaySettings.alertSettings.alertCheckFrequency);
            }
            else
            {
                DialogueManager.Instance.displaySettings.alertSettings.alertCheckFrequency = 0;
            }
            EditorWindowTools.EndIndentedSection();
            DrawNavigationButtons(true, true, false);
        }
示例#2
0
        private void DrawInputsStage()
        {
            if (DialogueManager.Instance.displaySettings.inputSettings == null)
            {
                DialogueManager.Instance.displaySettings.inputSettings = new DisplaySettings.InputSettings();
            }
            EditorGUILayout.LabelField("Input Settings", EditorStyles.boldLabel);
            EditorWindowTools.StartIndentedSection();
            EditorGUILayout.HelpBox("In this section, you'll specify input settings for the dialogue UI.", MessageType.Info);
            EditorWindowTools.StartIndentedSection();

            EditorWindowTools.DrawHorizontalLine();
            EditorGUILayout.LabelField("Player Response Menu", EditorStyles.boldLabel);
            EditorGUILayout.BeginHorizontal();
            DialogueManager.Instance.displaySettings.inputSettings.alwaysForceResponseMenu = EditorGUILayout.Toggle("Always Force Menu", DialogueManager.Instance.displaySettings.inputSettings.alwaysForceResponseMenu);
            EditorGUILayout.HelpBox("Tick to always force the response menu. If unticked, then when the player only has one valid response, the UI will automatically select it without showing the response menu.", MessageType.None);
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            bool useTimeout = EditorGUILayout.Toggle("Timer", (DialogueManager.Instance.displaySettings.inputSettings.responseTimeout > 0));

            EditorGUILayout.HelpBox("Tick to make the response menu timed. If unticked, players can take as long as they want to make their selection.", MessageType.None);
            EditorGUILayout.EndHorizontal();
            if (useTimeout)
            {
                if (Tools.ApproximatelyZero(DialogueManager.Instance.displaySettings.inputSettings.responseTimeout))
                {
                    DialogueManager.Instance.displaySettings.inputSettings.responseTimeout = DefaultResponseTimeoutDuration;
                }
                DialogueManager.Instance.displaySettings.inputSettings.responseTimeout       = EditorGUILayout.FloatField("Timeout Seconds", DialogueManager.Instance.displaySettings.inputSettings.responseTimeout);
                DialogueManager.Instance.displaySettings.inputSettings.responseTimeoutAction = (ResponseTimeoutAction)EditorGUILayout.EnumPopup("If Time Runs Out", DialogueManager.Instance.displaySettings.inputSettings.responseTimeoutAction);
            }
            else
            {
                DialogueManager.Instance.displaySettings.inputSettings.responseTimeout = 0;
            }

            EditorWindowTools.DrawHorizontalLine();
            EditorGUILayout.LabelField("Quick Time Event (QTE) Trigger Buttons", EditorStyles.boldLabel);
            EditorGUILayout.HelpBox("QTE trigger buttons may be defined on the Dialogue Manager object's inspector under Display Settings > Input Settings > Qte Buttons.", MessageType.None);
            if (GUILayout.Button("Inspect Dialogue Manager object", GUILayout.Width(240)))
            {
                Selection.activeObject = DialogueManager.Instance;
            }

            EditorWindowTools.DrawHorizontalLine();
            EditorGUILayout.LabelField("Cancel", EditorStyles.boldLabel);
            EditorGUILayout.BeginHorizontal();
            DialogueManager.Instance.displaySettings.inputSettings.cancel.key = (KeyCode)EditorGUILayout.EnumPopup("Key", DialogueManager.Instance.displaySettings.inputSettings.cancel.key);
            EditorGUILayout.HelpBox("Pressing this key cancels the response menu or conversation.", MessageType.None);
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            DialogueManager.Instance.displaySettings.inputSettings.cancel.buttonName = EditorGUILayout.TextField("Button Name", DialogueManager.Instance.displaySettings.inputSettings.cancel.buttonName);
            EditorGUILayout.HelpBox("Pressing this button cancels the response menu or conversation.", MessageType.None);
            EditorGUILayout.EndHorizontal();

            EditorWindowTools.EndIndentedSection();
            EditorWindowTools.EndIndentedSection();
            DrawNavigationButtons(true, true, false);
        }
示例#3
0
 private void DrawReviewStage()
 {
     EditorGUILayout.LabelField("Review", EditorStyles.boldLabel);
     EditorWindowTools.StartIndentedSection();
     EditorGUILayout.HelpBox("Your Dialogue Manager is ready! Below is a brief summary of the configuration.", MessageType.Info);
     EditorGUILayout.LabelField(string.Format("Dialogue database: {0}", DialogueManager.Instance.initialDatabase.name));
     EditorGUILayout.LabelField(string.Format("Dialogue UI: {0}", (DialogueManager.Instance.displaySettings.dialogueUI == null) ? "(use default)" : DialogueManager.Instance.displaySettings.dialogueUI.name));
     EditorGUILayout.LabelField(string.Format("Show subtitles: {0}", GetSubtitlesInfo()));
     EditorGUILayout.LabelField(string.Format("Always force response menu: {0}", DialogueManager.Instance.displaySettings.inputSettings.alwaysForceResponseMenu));
     EditorGUILayout.LabelField(string.Format("Response menu timeout: {0}", Tools.ApproximatelyZero(DialogueManager.Instance.displaySettings.inputSettings.responseTimeout) ? "Unlimited Time" : DialogueManager.Instance.displaySettings.inputSettings.responseTimeout.ToString()));
     EditorGUILayout.LabelField(string.Format("Allow alerts during conversations: {0}", DialogueManager.Instance.displaySettings.alertSettings.allowAlertsDuringConversations));
     EditorWindowTools.EndIndentedSection();
     DrawNavigationButtons(true, true, true);
 }
 private void DrawReviewStage()
 {
     EditorGUILayout.LabelField("Review", EditorStyles.boldLabel);
     EditorWindowTools.StartIndentedSection();
     EditorGUILayout.HelpBox("Your Dialogue Manager is ready! Below is a brief summary of the configuration.", MessageType.Info);
     EditorGUILayout.LabelField(string.Format("Dialogue database: {0}", DialogueManager.instance.initialDatabase.name));
     EditorGUILayout.LabelField(string.Format("Dialogue UI: {0}", (DialogueManager.instance.displaySettings.dialogueUI == null) ? "(use default)" : DialogueManager.instance.displaySettings.dialogueUI.name));
     EditorGUILayout.LabelField(string.Format("Show subtitles: {0}", GetSubtitlesInfo()));
     EditorGUILayout.LabelField(string.Format("Always force response menu: {0}", DialogueManager.instance.displaySettings.inputSettings.alwaysForceResponseMenu));
     EditorGUILayout.LabelField(string.Format("Response menu timeout: {0}", Tools.ApproximatelyZero(DialogueManager.instance.displaySettings.inputSettings.responseTimeout) ? "Unlimited Time" : DialogueManager.instance.displaySettings.inputSettings.responseTimeout.ToString()));
     EditorGUILayout.LabelField(string.Format("Allow alerts during conversations: {0}", DialogueManager.instance.displaySettings.alertSettings.allowAlertsDuringConversations));
     EditorGUILayout.LabelField(string.Format("Use save system: {0}", (DialogueManager.instance.GetComponent <PixelCrushers.SaveSystem>() != null) ? "Yes" : "No"));
     EditorGUILayout.HelpBox("The Dialogue Manager's inspector has other settings, too, such as Persistent Data Settings. If you want to view those settings, click the button below.", MessageType.None);
     if (GUILayout.Button("Inspect Dialogue Manager object", GUILayout.Width(240)))
     {
         Selection.activeObject = DialogueManager.instance;
     }
     EditorWindowTools.EndIndentedSection();
     DrawNavigationButtons(true, true, true);
 }