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);
        }
Exemple #2
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);
        }
Exemple #3
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);
        }
Exemple #4
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);
        }
        private void MainPageInit(DialogPage page)
        {
            var player          = GetPC();
            var playerId        = GetObjectUUID(player);
            var area            = GetArea(player);
            var ownerPlayerUUID = GetLocalString(area, "HOUSING_OWNER_PLAYER_UUID");
            var dbHouse         = DB.Get <PlayerHouse>(ownerPlayerUUID);
            var permission      = dbHouse.PlayerPermissions.ContainsKey(playerId)
                ? dbHouse.PlayerPermissions[playerId]
                : new PlayerHousePermission();
            var layoutDetail = Housing.GetHouseTypeDetail(dbHouse.HouseType);
            var model        = GetDataModel <Model>();

            page.Header = ColorToken.Green("Property Management Menu") + "\n" +
                          ColorToken.Green("Furniture Limit: ") + dbHouse.Furnitures.Count + " / " + layoutDetail.FurnitureLimit + "\n\n" +
                          "Please select from the options below.";

            if (permission.CanAdjustPermissions)
            {
                // todo: Currently disabled. Plan to introduce permission management at a later date.
                //page.AddResponse(ColorToken.Green("Manage Permissions"), () => ChangePage(ManagePermissionsPageId));
            }

            // Load nearby furniture.

            if (GetIsObjectValid(model.TargetObject))
            {
                LoadFurniture(dbHouse, model.TargetObject, page);
            }

            const int MaxNumberOfFurniture = 10;
            var       nth    = 1;
            var       nearby = GetNearestObjectToLocation(model.TargetLocation, ObjectType.Placeable, nth);

            while (GetIsObjectValid(nearby))
            {
                // Reached the max.
                if (nth > MaxNumberOfFurniture)
                {
                    break;
                }

                // This placeable is the same as the targeted placeable. We don't want it to show up twice.
                if (nearby == model.TargetObject)
                {
                    continue;
                }

                LoadFurniture(dbHouse, nearby, page);

                nth++;
                nearby = GetNearestObjectToLocation(model.TargetLocation, ObjectType.Placeable, nth);
            }
        }
 public void ShowDialog(DialogPage page)
 {
     pageBlurPanel.To = 10;
     pageBlurPanel.Anim();
     page.Closed += (s, e) =>
     {
         pageBlurPanel.To = 0;
         pageBlurPanel.Anim();
     };
     new DialogWindow(page, this).Show();
 }
Exemple #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);
        }
Exemple #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);
        }
Exemple #9
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);
        }
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog   = new PlayerDialog("MainPage");
            DialogPage   mainPage = new DialogPage(
                "Are you sure you want to destroy your player guide? This action is irreversible!",
                "Destroy Player Guide"
                );

            dialog.AddPage("MainPage", mainPage);
            return(dialog);
        }
Exemple #11
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?",
                ColorTokenService.Green("Register")
                );

            dialog.AddPage("MainPage", mainPage);
            return(dialog);
        }
Exemple #12
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);
        }
Exemple #13
0
        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);
        }
        private void Lg_Result(DialogPage sender, object result)
        {
            User u = (User)result;

            SettingProxy.Name         = u.Name;
            SettingProxy.User         = u;
            SettingProxy.IsLogedIn    = true;
            nameBox.Text              = u.Name;
            nameBox.IsReadOnly        = true;
            UserAreaLogIn.Visibility  = Visibility.Visible;
            UserAreaLogOut.Visibility = Visibility.Collapsed;
        }
Exemple #15
0
        public void DialogPage_CtorValues_ShouldHaveValidDefaultValues()
        {
            DialogPage page = new DialogPage(
                "MyHeader",
                "Response 1",
                "Response 2");

            Assert.AreEqual("MyHeader", page.Header);
            Assert.AreEqual(2, page.Responses.Count);
            Assert.AreEqual(new CustomData(), page.CustomData);
            Assert.AreEqual(2, page.NumberOfResponses);
        }
Exemple #16
0
        private void FormClose(ButtonControl button, CloseReason reason)
        {
            DialogPage dialog = button.Report.Pages[CurrentForm] as DialogPage;

            dialog.Form.DialogResult = button.DialogResult;
            FormClosingEventArgs closingArgs = new FormClosingEventArgs(reason, false);

            dialog.OnFormClosing(closingArgs);
            FormClosedEventArgs closedArgs = new FormClosedEventArgs(reason);

            dialog.OnFormClosed(closedArgs);
            dialog.ActiveInWeb = false;
        }
        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);
        }
Exemple #18
0
        private void MainPageInit(DialogPage page)
        {
            var player = GetPC();

            page.Header = $"What would you like to do?";
            page.AddResponse("Exit", () =>
            {
                var area = GetArea(OBJECT_SELF);
                Housing.JumpToOriginalLocation(player);

                DelayCommand(6.0f, () => Housing.AttemptCleanUpInstance(area));
            });
        }
Exemple #19
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);
        }
Exemple #20
0
        internal override void Initialize(DialogPage optionPage)
        {
            base.Initialize(optionPage);

            // init the assembly list box
            if (this.PTOptionPage.TypeDescriptorAssemblyList != null)
            {
                foreach (string ass in this.PTOptionPage.TypeDescriptorAssemblyList)
                {
                    this.lstAssemblyList.Items.Add(Utility.PathHelper.GetAbsolutePath(ass));
                }
            }
        }
Exemple #21
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);
        }
        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);
        }
Exemple #23
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);
        }
Exemple #24
0
        private void MainInit(DialogPage page)
        {
            page.Header = "Please select an option.";

            page.AddResponse("View Shops", () =>
            {
                ChangePage(ViewShopsPageId);
            });

            page.AddResponse("Edit My Shop", () =>
            {
                ChangePage(EditMyShopPageId);
            });
        }
        private void ButtonOneActionClicked(object sender, ClickedEventArgs args)
        {
            var button = new Button()
            {
                Text = "OK",
            };

            button.Clicked += (object s, ClickedEventArgs a) =>
            {
                Navigator?.Pop();
            };

            DialogPage.ShowAlertDialog("Title", "Message", button);
        }
Exemple #26
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);
        }
Exemple #27
0
        public override PlayerDialog SetUp(NWPlayer player)
        {
            PlayerDialog dialog = new PlayerDialog("MainPage");

            DialogPage mainPage           = new DialogPage();
            DialogPage selectCardPage     = new DialogPage("Pick a card, any card...");
            DialogPage selectDeckSlotPage = new DialogPage("Please select a slot in your deck to replace.");

            dialog.AddPage("MainPage", mainPage);
            dialog.AddPage("SelectCardPage", selectCardPage);
            dialog.AddPage("SelectDeckSlotPage", selectDeckSlotPage);

            return(dialog);
        }
        private void MainPageInit(DialogPage page)
        {
            var player    = GetPC();
            var playerId  = GetObjectUUID(player);
            var dbPlayer  = DB.Get <Player>(playerId);
            var perkCount = dbPlayer.Perks.Count;

            page.Header = ColorToken.Green("Total SP: ") + dbPlayer.TotalSPAcquired + " / " + Skill.SkillCap + "\n" +
                          ColorToken.Green("Available SP: ") + dbPlayer.UnallocatedSP + "\n" +
                          ColorToken.Green("Total Perks: ") + perkCount + "\n";

            page.AddResponse("View My Perks", () => ChangePage(ViewMyPerksPageId));
            page.AddResponse("Buy Perks", () => ChangePage(CategoryPageId));
        }
        private void GetDialogHtml(StringBuilder sb, DialogPage dialog)
        {
            string s = String.Format("<div style=\"min-width:{0}px! important;min-height:{1}px !important\">",
                                     Zoom(dialog.Width),
                                     Zoom(dialog.Height)
                                     );

            sb.Append(s);

            sb.Append($"<div id=\"{GetDialogID()}\" style=\"position:relative;\" title=\"{dialog.Text}\">");

            GetComponentHtml(sb, dialog.Controls);
            sb.Append("</div></div>");
        }
Exemple #30
0
    bool DisplayDialog(Verb verb)
    {
        // Open dialog for choosing time
        DialogPage dialogPage = new DialogPage();

        dialogPage.SetTitle("Wait Time");

        dialogPage.AddInputPanel((input) => {
            double amount = -1;
            if (!double.TryParse(input, out amount))
            {
                return;
            }

            verb.Register(new Dictionary <string, object>()
            {
                { "duration", amount }
            }, true);
        });

        Dictionary <string, object> data = new Dictionary <string, object>();

        data["gameObject"] = verb.self;
        data["verb"]       = verb;
        data["label"]      = verb.displayLabel;

        data["duration"] = 10.0;
        dialogPage.AddEntry("10", () => { verb.Register(data, true); });
        data["duration"] = 20.0;
        dialogPage.AddEntry("20", () => { verb.Register(data, true); });
        data["duration"] = 100.0;
        dialogPage.AddEntry("100", () => { verb.Register(data, true); });
        data["duration"] = 250.0;
        dialogPage.AddEntry("250", () => { verb.Register(data, true); });
        data["duration"] = 500.0;
        dialogPage.AddEntry("500", () => { verb.Register(data, true); });
        data["duration"] = 1000.0;
        dialogPage.AddEntry("1000", () => { verb.Register(data, true); });
        data["duration"] = 2000.0;
        dialogPage.AddEntry("2000", () => { verb.Register(data, true); });
        data["duration"] = 4000.0;
        dialogPage.AddEntry("4000", () => { verb.Register(data, true); });
        data["duration"] = 10000.0;
        dialogPage.AddEntry("10000", () => { verb.Register(data, true); });

        WaywardManager.instance.AddPage(dialogPage, WaywardManager.instance.GetRelativeWindowPoint(0.5, 0.5));

        return(true);
    }