public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog   = new PlayerDialog("MainPage");
            DialogPage   mainPage = new DialogPage(
                "Please select a reward."
                );

            dialog.AddPage("MainPage", mainPage);
            return(dialog);
        }
예제 #2
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog = new PlayerDialog("MainPage");

            DialogPage mainPage = new DialogPage("You can slice this terminal. What would you like to do?",
                                                 "Slice the terminal");

            dialog.AddPage("MainPage", mainPage);
            return(dialog);
        }
예제 #3
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog   = new PlayerDialog("MainPage");
            DialogPage   mainPage = new DialogPage("Are you ready to enter the game world? This is the LAST chance for you to use the '/customize' chat command to change your appearance.\n\nAre you sure you want to proceed?",
                                                   "Customize my character",
                                                   "Enter the game");

            dialog.AddPage("MainPage", mainPage);
            return(dialog);
        }
예제 #4
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog = new PlayerDialog("MainPage");

            DialogPage mainPage = new DialogPage(
                "One or more party member is in this instance. Which will you enter?");

            dialog.AddPage("MainPage", mainPage);
            return(dialog);
        }
예제 #5
0
        public static void OnActionsTaken(int nodeID)
        {
            NWPlayer     player = (_.GetPCSpeaker());
            PlayerDialog dialog = LoadPlayerDialog(player.GlobalID);

            using (new Profiler(nameof(DialogService) + "." + nameof(OnActionsTaken) + "." + dialog.ActiveDialogName))
            {
                IConversation convo           = GetConversation(dialog.ActiveDialogName);
                int           selectionNumber = nodeID + 1;
                int           responseID      = nodeID + (NumberOfResponsesPerPage * dialog.PageOffset);

                if (selectionNumber == NumberOfResponsesPerPage + 1) // Next page
                {
                    dialog.PageOffset = dialog.PageOffset + 1;
                }
                else if (selectionNumber == NumberOfResponsesPerPage + 2) // Previous page
                {
                    dialog.PageOffset = dialog.PageOffset - 1;
                }
                else if (selectionNumber == NumberOfResponsesPerPage + 3) // Back
                {
                    string currentPageName = dialog.CurrentPageName;
                    var    previous        = dialog.NavigationStack.Pop();

                    // This might be a little confusing but we're passing the active page as the "old page" to the Back() method.
                    // This is because we need to run any dialog-specific clean up prior to moving the conversation backwards.
                    convo.Back(player, currentPageName, previous.PageName);

                    // Previous page was in a different conversation. Switch to it.
                    if (previous.DialogName != dialog.ActiveDialogName)
                    {
                        LoadConversation(player, dialog.DialogTarget, previous.DialogName, dialog.DialogNumber);
                        dialog = LoadPlayerDialog(player.GlobalID);
                        dialog.ResetPage();

                        dialog.CurrentPageName = previous.PageName;
                        dialog.PageOffset      = 0;
                        // ActiveDialogName will have changed by this point. Get the new conversation.
                        convo = GetConversation(dialog.ActiveDialogName);
                        convo.Initialize();
                        player.SetLocalInt("DIALOG_SYSTEM_INITIALIZE_RAN", 1);
                    }
                    // Otherwise it's in the same conversation. Switch to that.
                    else
                    {
                        dialog.CurrentPageName = previous.PageName;
                        dialog.PageOffset      = 0;
                    }
                }
                else if (selectionNumber != NumberOfResponsesPerPage + 4) // End
                {
                    convo.DoAction(player, dialog.CurrentPageName, responseID + 1);
                }
            }
        }
예제 #6
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog   = new PlayerDialog("MainPage");
            DialogPage   mainPage = new DialogPage(
                "Please select an option.",
                "Enter the building",
                "Knock on the door");

            dialog.AddPage("MainPage", mainPage);
            return(dialog);
        }
예제 #7
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog      = new PlayerDialog("MainPage");
            DialogPage   mainPage    = new DialogPage("Charter flights leave hourly. Please select one our available destinations below.");
            DialogPage   confirmPage = new DialogPage("<SET LATER>",
                                                      "Confirm Flight");

            dialog.AddPage("MainPage", mainPage);
            dialog.AddPage("ConfirmPage", confirmPage);
            return(dialog);
        }
예제 #8
0
        public void PlayerDialog_CurrentPage_ShouldReturnAddedPage()
        {
            PlayerDialog dialog = new PlayerDialog("TestPage");
            DialogPage   page   = new DialogPage();

            dialog.AddPage("TestPage", page);

            DialogPage result = dialog.CurrentPage;

            Assert.AreSame(result, page);
        }
예제 #9
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog   = new PlayerDialog("MainPage");
            DialogPage   mainPage = new DialogPage(
                "Are you sure you want to destroy your survival knife? This action is irreversible!",
                "Destroy Survival Knife"
                );

            dialog.AddPage("MainPage", mainPage);
            return(dialog);
        }
예제 #10
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog   = new PlayerDialog("MainPage");
            DialogPage   mainPage = new DialogPage("<SET LATER>",
                                                   ColorTokenService.Green("Refresh"),
                                                   "Change Name",
                                                   "Reset Name");

            dialog.AddPage("MainPage", mainPage);
            return(dialog);
        }
예제 #11
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog   = new PlayerDialog("MainPage");
            DialogPage   mainPage = new DialogPage(
                "What would you like to modify?",
                "Save/Load Outfits",
                "Main Weapon",
                "Off-Hand Weapon",
                "Armor",
                "Helmet");

            DialogPage weaponPartPage = new DialogPage(
                "Which weapon part would you like to modify?",
                "Top",
                "Middle",
                "Bottom");

            DialogPage armorPartPage = new DialogPage(
                "Which armor part would you like to modify?",
                "Neck",
                "Torso",
                "Belt",
                "Pelvis",
                "Robe",
                "Right Thigh",
                "Right Shin",
                "Right Foot",
                "Left Thigh",
                "Left Shin",
                "Left Foot",
                "Right Shoulder",
                "Right Bicep",
                "Right Forearm",
                "Right Glove",
                "Left Shoulder",
                "Left Bicep",
                "Left Forearm",
                "Left Glove",
                "Helmet");

            DialogPage helmetPartPage = new DialogPage(
                "Would you like to modify your helmet?",
                "Helmet");

            DialogPage partPage = new DialogPage(
                "Please select a new model.");

            dialog.AddPage("MainPage", mainPage);
            dialog.AddPage("WeaponPartPage", weaponPartPage);
            dialog.AddPage("ArmorPartPage", armorPartPage);
            dialog.AddPage("HelmetPartPage", helmetPartPage);
            dialog.AddPage("PartPage", partPage);
            return(dialog);
        }
예제 #12
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog   = new PlayerDialog("MainPage");
            DialogPage   mainPage = new DialogPage(
                "If you die, you will return to the last cloning facility you registered at. Would you like to register to this cloning facility?",
                _color.Green("Register")
                );

            dialog.AddPage("MainPage", mainPage);
            return(dialog);
        }
예제 #13
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog = new PlayerDialog("MainPage");

            DialogPage mainPage = new DialogPage("Holocom Main Menu:\n\n" +
                                                 "How may we help you?"
                                                 ); // Responses dynamically generated

            dialog.AddPage("MainPage", mainPage);
            return(dialog);
        }
예제 #14
0
        protected void ChangePage(string pageName, bool updateNavigationStack = true)
        {
            PlayerDialog dialog = _dialog.LoadPlayerDialog(GetPC().GlobalID);

            if (updateNavigationStack && dialog.EnableBackButton)
            {
                dialog.NavigationStack.Push(new DialogNavigation(dialog.CurrentPageName, dialog.ActiveDialogName));
            }
            dialog.CurrentPageName = pageName;
            dialog.PageOffset      = 0;
        }
예제 #15
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog   = new PlayerDialog("MainPage");
            DialogPage   mainPage = new DialogPage(
                "If you die, you will respawn at the last place you bound your soul. Would you like to bind your soul to this location?",
                "Bind my soul"
                );

            dialog.AddPage("MainPage", mainPage);
            return(dialog);
        }
예제 #16
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog      = new PlayerDialog("MainPage");
            DialogPage   mainPage    = new DialogPage(); // Dynamically built
            DialogPage   salvagePage = new DialogPage("<SET LATER>",
                                                      "Reassemble Component(s)");

            dialog.AddPage("MainPage", mainPage);
            dialog.AddPage("SalvagePage", salvagePage);
            return(dialog);
        }
예제 #17
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog = new PlayerDialog("MainPage");

            DialogPage mainPage = new DialogPage(
                "This door is locked. It looks like it needs a key to be opened.",
                "Use Key");

            dialog.AddPage("MainPage", mainPage);
            return(dialog);
        }
예제 #18
0
        public void EndConversation(NWPlayer player)
        {
            if (player == null)
            {
                throw new ArgumentNullException(nameof(player));
            }

            PlayerDialog playerDialog = LoadPlayerDialog(player.GlobalID);

            playerDialog.IsEnding = true;
            StorePlayerDialog(player.GlobalID, playerDialog);
        }
예제 #19
0
파일: Outfit.cs 프로젝트: zunath/SWLOR_NWN
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog = new PlayerDialog("MainPage");

            DialogPage mainPage = new DialogPage(
                "Please select an option.",
                "Save Options",
                "Load Options"
                );

            DialogPage savePage = new DialogPage(
                "Which type of item would you like to save?"
                );

            DialogPage loadPage = new DialogPage(
                "Which type of item would you like to load?"
                );

            DialogPage saveOutfitPage = new DialogPage(
                "Please select a slot to save the outfit in.\n\nRed slots are unused. Green slots contain stored appearances. Selecting a green slot will overwrite whatever is in that slot."
                );

            DialogPage saveHelmetPage = new DialogPage(
                "Please select a slot to save the helmet in.\n\nRed slots are unused. Green slots contain stored appearances. Selecting a green slot will overwrite whatever is in that slot."
                );

            DialogPage saveWeaponPage = new DialogPage(
                "Please select a slot to save the weapon in. (Right hand only)\n\nRed slots are unused. Green slots contain stored appearances. Selecting a green slot will overwrite whatever is in that slot."
                );

            DialogPage loadOutfitPage = new DialogPage(
                "Please select an outfit to load."
                );

            DialogPage loadHelmetPage = new DialogPage(
                "Please select a helmet to load."
                );

            DialogPage loadWeaponPage = new DialogPage(
                "Please select a weapon to load. (Right hand only)"
                );

            dialog.AddPage("MainPage", mainPage);
            dialog.AddPage("SavePage", savePage);
            dialog.AddPage("SaveOutfitPage", saveOutfitPage);
            dialog.AddPage("SaveHelmetPage", saveHelmetPage);
            dialog.AddPage("SaveWeaponPage", saveWeaponPage);
            dialog.AddPage("LoadPage", loadPage);
            dialog.AddPage("LoadOutfitPage", loadOutfitPage);
            dialog.AddPage("LoadHelmetPage", loadHelmetPage);
            dialog.AddPage("LoadWeaponPage", loadWeaponPage);
            return(dialog);
        }
예제 #20
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog   = new PlayerDialog("MainPage");
            DialogPage   mainPage = new DialogPage(
                "Please select an option.",
                "Exit the building",
                "Peek outside"
                );

            dialog.AddPage("MainPage", mainPage);
            return(dialog);
        }
예제 #21
0
        public void RemovePlayerDialog(Guid globalID)
        {
            if (globalID == null)
            {
                throw new ArgumentException(nameof(globalID), nameof(globalID) + " cannot be null, empty, or whitespace.");
            }

            PlayerDialog dialog = _cache.PlayerDialogs[globalID];

            _cache.DialogFilesInUse[dialog.DialogNumber] = false;

            _cache.PlayerDialogs.Remove(globalID);
        }
예제 #22
0
        public bool Run(params object[] args)
        {
            NWPlayer     player = NWPlayer.Wrap(_.GetPCSpeaker());
            PlayerDialog dialog = _dialog.LoadPlayerDialog(player.GlobalID);

            IConversation convo = App.ResolveByInterface <IConversation>("Conversation." + dialog.ActiveDialogName);

            convo.EndDialog();
            _dialog.RemovePlayerDialog(player.GlobalID);
            player.DeleteLocalInt("DIALOG_SYSTEM_INITIALIZE_RAN");

            return(true);
        }
예제 #23
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog = new PlayerDialog("MainPage");
            DialogPage   characterManagementPage = new DialogPage(
                "Character Management & Information Page",
                "Disable PVP Protection",
                "Toggle Helmet Display"
                );

            dialog.AddPage("MainPage", characterManagementPage);

            return(dialog);
        }
예제 #24
0
        public void RemovePlayerDialog(string globalID)
        {
            if (string.IsNullOrWhiteSpace(globalID))
            {
                throw new ArgumentException(nameof(globalID), nameof(globalID) + " cannot be null, empty, or whitespace.");
            }

            PlayerDialog dialog = _state.PlayerDialogs[globalID];

            _state.DialogFilesInUse[dialog.DialogNumber] = false;

            _state.PlayerDialogs.Remove(globalID);
        }
예제 #25
0
        public void PlayerDialog_AddPage_SecondPageShouldNotBeSetToCurrentPage()
        {
            PlayerDialog dialog = new PlayerDialog("TestPage");
            DialogPage   page   = new DialogPage();

            dialog.AddPage("TestPage", page);

            DialogPage page2 = new DialogPage();

            dialog.AddPage("Page2", page2);

            Assert.AreNotEqual("Page2", dialog.CurrentPageName);
        }
예제 #26
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog = new PlayerDialog("MainPage");

            DialogPage mainPage = new DialogPage(
                "",
                "Access Fuel Bay",
                "Access Stronidium Bay",
                "Access Resource Bay");

            dialog.AddPage("MainPage", mainPage);
            return(dialog);
        }
예제 #27
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog = new PlayerDialog("MainPage");

            DialogPage mainPage = new DialogPage(
                "What would you like to do with this control tower?",
                "Access Fuel Bay",
                "Access Stronidium Bay",
                "Access Resource Bay");

            dialog.AddPage("MainPage", mainPage);
            return(dialog);
        }
예제 #28
0
        public void PlayerDialog_Ctor_ShouldHaveDefaultValues()
        {
            PlayerDialog dialog = new PlayerDialog("MyPage");

            Assert.AreEqual(string.Empty, dialog.CurrentPageName);
            Assert.AreEqual(0, dialog.PageOffset);
            Assert.AreEqual(string.Empty, dialog.ActiveDialogName);
            Assert.AreEqual(null, dialog.DialogTarget);
            Assert.AreEqual(new CustomData(), dialog.CustomData);
            Assert.AreEqual(false, dialog.IsEnding);
            Assert.AreEqual("MyPage", dialog.DefaultPageName);
            Assert.AreEqual(0, dialog.DialogNumber);
        }
예제 #29
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog   = new PlayerDialog("MainPage");
            DialogPage   mainPage = new DialogPage(
                "Please select a blueprint. Only blueprints you've learned will be displayed here. Learn more blueprints by purchasing crafting perks!"
                );
            DialogPage blueprintListPage = new DialogPage(
                "Please select a blueprint. Only blueprints you've learned will be displayed here. Learn more blueprints by purchasing crafting perks!"
                );

            dialog.AddPage("MainPage", mainPage);
            dialog.AddPage("BlueprintListPage", blueprintListPage);
            return(dialog);
        }
예제 #30
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog = new PlayerDialog("MainPage");

            DialogPage mainPage = new DialogPage();

            DialogPage confirmPage = new DialogPage(
                "",
                "Confirm Refund");

            dialog.AddPage("MainPage", mainPage);
            dialog.AddPage("ConfirmPage", confirmPage);
            return(dialog);
        }