/// <summary>
        /// Shows a response menu.
        /// </summary>
        /// <param name="lastSubtitle">The last subtitle shown. Used to determine which menu panel to use.</param>
        /// <param name="responses">Responses to show in menu panel.</param>
        /// <param name="target">Send OnClick events to this GameObject (the dialogue UI).</param>
        public override void ShowResponses(Subtitle lastSubtitle, Response[] responses, Transform target)
        {
            var panel = GetPanel(lastSubtitle, responses);

            if (panel == null)
            {
                if (DialogueDebug.logWarnings)
                {
                    Debug.LogWarning("Dialogue System: Can't find menu panel.");
                }
            }
            else
            {
                m_currentPanel = panel;
                if (useFirstResponseForPortrait && responses.Length > 0)
                {
                    var menuCharacterInfo = DialogueManager.conversationModel.GetCharacterInfo(responses[0].destinationEntry.ActorID);
                    if (menuCharacterInfo != null)
                    {
                        m_pcPortraitName   = menuCharacterInfo.Name;
                        m_pcPortraitSprite = menuCharacterInfo.portrait;
                    }
                }
                panel.SetPCPortrait(m_pcPortraitSprite, m_pcPortraitName);
                panel.ShowResponses(lastSubtitle, responses, target);
            }
        }
Example #2
0
 public void Initialize(StandardUIMenuPanel[] menuPanels, StandardUIMenuPanel defaultMenuPanel)
 {
     m_builtinPanels.Clear();
     m_builtinPanels.AddRange(menuPanels);
     m_defaultPanel = (defaultMenuPanel != null) ? defaultMenuPanel : (m_builtinPanels.Count > 0) ? m_builtinPanels[0] : null;
     ClearCache();
     if (timeoutHandler == null)
     {
         timeoutHandler = DefaultTimeoutHandler;
     }
 }
 public void Initialize(StandardUIMenuPanel[] menuPanels, StandardUIMenuPanel defaultMenuPanel, bool useFirstResponseForMenuPortrait)
 {
     m_builtinPanels.Clear();
     m_builtinPanels.AddRange(menuPanels);
     m_defaultPanel = (defaultMenuPanel != null) ? defaultMenuPanel : (m_builtinPanels.Count > 0) ? m_builtinPanels[0] : null;
     ClearCache();
     if (timeoutHandler == null)
     {
         timeoutHandler = DefaultTimeoutHandler;
     }
     useFirstResponseForPortrait = useFirstResponseForMenuPortrait;
 }
Example #4
0
        /// <summary>
        /// Shows a response menu.
        /// </summary>
        /// <param name="lastSubtitle">The last subtitle shown. Used to determine which menu panel to use.</param>
        /// <param name="responses">Responses to show in menu panel.</param>
        /// <param name="target">Send OnClick events to this GameObject (the dialogue UI).</param>
        public override void ShowResponses(Subtitle lastSubtitle, Response[] responses, Transform target)
        {
            var panel = GetPanel(lastSubtitle);

            if (panel == null)
            {
                if (DialogueDebug.logWarnings)
                {
                    Debug.LogWarning("Dialogue System: Can't find menu panel.");
                }
            }
            else
            {
                m_currentPanel = panel;
                panel.SetPCPortrait(m_pcPortraitTexture, m_pcPortraitName);
                panel.ShowResponses(lastSubtitle, responses, target);
            }
        }
 /// <summary>
 /// For speakers who do not have a GameObject, this method overrides the actor's default panel.
 /// </summary>
 public void OverrideActorMenuPanel(Actor actor, MenuPanelNumber menuPanelNumber, StandardUIMenuPanel customPanel)
 {
     if (actor == null)
     {
         return;
     }
     m_actorIdPanelCache[actor.id] = GetPanelFromNumber(menuPanelNumber, customPanel);
 }
 /// <summary>
 /// For speakers who do not have DialogueActor components, this method overrides the
 /// actor's default panel.
 /// </summary>
 public void OverrideActorMenuPanel(Transform actorTransform, MenuPanelNumber menuPanelNumber, StandardUIMenuPanel customPanel)
 {
     if (actorTransform == null)
     {
         return;
     }
     m_actorPanelCache[actorTransform] = GetPanelFromNumber(menuPanelNumber, customPanel);
 }
        protected StandardUIMenuPanel GetPanelFromNumber(MenuPanelNumber menuPanelNumber, StandardUIMenuPanel customMenuPanel)
        {
            switch (menuPanelNumber)
            {
            case MenuPanelNumber.Default:
                return(m_defaultPanel);

            case MenuPanelNumber.Custom:
                return(customMenuPanel);

            default:
                var index = PanelNumberUtility.GetMenuPanelIndex(menuPanelNumber);
                return((0 <= index && index < m_builtinPanels.Count) ? m_builtinPanels[index] : null);
            }
        }
 /// <summary>
 /// Forces menus to use a specific panel regardless of any other default or override settings.
 /// </summary>
 public void ForceOverrideMenuPanel(StandardUIMenuPanel panel)
 {
     m_forcedOverridePanel = panel;
 }
Example #9
0
 public virtual void OverrideActorMenuPanel(Actor actor, MenuPanelNumber menuPanelNumber, StandardUIMenuPanel customPanel)
 {
     conversationUIElements.standardMenuControls.OverrideActorMenuPanel(actor, menuPanelNumber, customPanel ?? conversationUIElements.defaultMenuPanel);
 }
 public virtual void ForceOverrideMenuPanel(StandardUIMenuPanel customPanel)
 {
     conversationUIElements.standardMenuControls.ForceOverrideMenuPanel(customPanel);
 }