protected void ChangePage(string pageName, bool updateNavigationStack = true)
        {
            PlayerDialog dialog = Conversation.GetActivePlayerDialog(GetPlayerID());

            if (updateNavigationStack && dialog.EnableBackButton)
            {
                dialog.NavigationStack.Push(new DialogNavigation(dialog.CurrentPageName, dialog.ActiveDialogName));
            }
            dialog.CurrentPageName = pageName;
            dialog.PageOffset      = 0;
        }
예제 #2
0
        /// <summary>
        /// Loads and stores a player's active dialog into the cache.
        /// </summary>
        /// <param name="player">The player whose dialog file we're making and storing</param>
        /// <param name="talkTo">Who the player is talking to</param>
        /// <param name="class">The class name of the conversation</param>
        public static void Load(NWGameObject player, NWGameObject talkTo, string @class)
        {
            var playerID     = GetGlobalID(player);
            var conversation = FindConversation(@class);
            var playerDialog = new PlayerDialog("MainPage");

            conversation.SetUp(player, playerDialog);

            playerDialog.ActiveDialogName = @class;
            playerDialog.DialogTarget     = talkTo;

            _playerDialogs[playerID] = playerDialog;
        }
        protected string GetCurrentPageName()
        {
            PlayerDialog dialog = Conversation.GetActivePlayerDialog(GetPlayerID());

            return(dialog.CurrentPageName);
        }
        protected DialogPage GetPageByName(string pageName)
        {
            PlayerDialog dialog = Conversation.GetActivePlayerDialog(GetPlayerID());

            return(dialog.GetPageByName(pageName));
        }
        protected void SetDialogModel <T>(T value)
        {
            PlayerDialog dialog = Conversation.GetActivePlayerDialog(GetPlayerID());

            dialog.Data = value;
        }
        protected T GetDialogModel <T>()
        {
            PlayerDialog dialog = Conversation.GetActivePlayerDialog(GetPlayerID());

            return((T)dialog.Data);
        }
        protected NWGameObject GetDialogTarget()
        {
            PlayerDialog dialog = Conversation.GetActivePlayerDialog(GetPlayerID());

            return(dialog.DialogTarget);
        }
 public abstract void SetUp(NWGameObject player, PlayerDialog dialog);
        protected void ClearNavigationStack()
        {
            PlayerDialog dialog = Conversation.GetActivePlayerDialog(GetPlayerID());

            dialog.NavigationStack.Clear();
        }