예제 #1
0
    void Start()
    {
        _confirmDialogButton.OnClickAsObservable().Subscribe(_ =>
        {
            var dialog       = new ConfirmDialog("Are you ok?", ConfirmDialogSize.Minimum);
            dialog.Stackable = false;
            _dialogRoot.Enqueue(dialog);
        }).AddTo(this);

        _menuDialogButton.OnClickAsObservable().Subscribe(_ =>
        {
            var content = new MenuDialogContentModel();
            content.MenuItems.Add(new MenuDialogItemModel("apple", "Apple"));
            content.MenuItems.Add(new MenuDialogItemModel("banana", "Banana"));
            content.MenuItems.Add(new MenuDialogItemModel("tomato", "Tomato"));

            var dialog = new MenuDialog("Menu", content);
            dialog.OnClickAsObservable().Subscribe(b =>
            {
                _dialogRoot.Enqueue(new ConfirmDialog(b.Name, ConfirmDialogSize.Minimum));
                dialog.Close();
            }).AddTo(this);

            _dialogRoot.Enqueue(dialog);
        }).AddTo(this);

        _stackDialogButton.OnClickAsObservable().Subscribe(_ =>
        {
            n = 0;
            AddDialog(n++, true);
        }).AddTo(this);
    }
예제 #2
0
            /// <summary>
            /// logs display string of <paramref name="menuDialog"/> to console,
            /// blocks until user selects a menu option,
            /// and returns selected menu option index.
            /// </summary>
            /// <seealso cref="LogNotice(string, eOutputReportType, bool)"/>
            /// <seealso cref="int.TryParse(string, out int)"/>
            /// <param name="menuDialog"></param>
            /// <param name="outputReportType"></param>
            /// <returns>
            /// menu option index user selected
            /// </returns>
            /// <exception cref="ObjectDisposedException">
            /// <seealso cref="LogNotice(string, eOutputReportType, bool)"/>
            /// </exception>
            public int ShowMenuDialog(MenuDialog menuDialog, eOutputReportType outputReportType)
            {
                // display menu dialog
                LogNotice(menuDialog.DisplayString, outputReportType);

                // read user input
                string userInput = base.ReadLine();

                // parse int from user input
                bool parseSuccessful = int.TryParse(userInput, out int userSelectedOptionIndex);

                // keep requesting input so long as it's not valid
                while (!(parseSuccessful && menuDialog.IsValidOptionIndex(userSelectedOptionIndex)))
                {
                    LogNoticeFormat(
                        false,
                        outputReportType,
                        "Invalid input, please select an option in range [{0} - {1}]:",
                        menuDialog.MinValidOptionIndex,
                        menuDialog.MaxValidOptionIndex);

                    userInput       = base.ReadLine();
                    parseSuccessful = int.TryParse(userInput, out userSelectedOptionIndex);
                }

                return(userSelectedOptionIndex);
            }
예제 #3
0
 public static void DoMenuStart(MenuDialog menu)
 {
     if (OnMenuStart != null)
     {
         OnMenuStart(menu);
     }
 }
예제 #4
0
        public override void OnClick(string contextName, string contextId, bool state, GameObject thisButton)
        {
            base.OnClick(contextName, contextId, state, thisButton);
            bool exitDialog = false;

            switch (contextName)
            {
            case "confirm":
                Main.config.FundamentTID = par.thingID;
                Main.config.Save();
                Managers.soundManager.Play("success", transform, 0.2f);
                exitDialog = true;
                break;

            case "confirmCollision":
                Main.config.Dynamic = true;
                Main.config.Save();
                Managers.soundManager.Play("success", transform, 0.2f);
                exitDialog = true;
                break;

            case "back":
                exitDialog = true;
                break;
            }
            if (exitDialog)
            {
                MenuDialog.SwitchTo(UIMenu.Menu, hand, tabName);
            }
        }
예제 #5
0
        private void OnEraseFile(MenuPageEventArgs e)
        {
            _dialogOpen = true;
            var dialog = new MenuDialog();

            dialog.AddTextLine("Are you sure?");

            var yesButton = new MenuButton(new Vector2(0, 0), "Erase", ButtonStyles.Dialog, new EraseFileEventArgs(_fileHighlightIndex));

            yesButton.OnSelected += RaiseEraseFileEvent;
            yesButton.OnSelected += ResetFileButtons;
            yesButton.OnSelected += RaiseCloseDialogEvent;

            var noButton = new MenuButton(new Vector2(0, 0), "Cancel", ButtonStyles.Dialog, new CloseDialogEventArgs());

            noButton.OnSelected += RaiseCloseDialogEvent;
            noButton.OnSelected += ResetFileButtons;

            yesButton.LeftButton  = noButton;
            yesButton.RightButton = noButton;
            noButton.LeftButton   = yesButton;
            noButton.RightButton  = yesButton;

            dialog.AddButton(yesButton);
            dialog.AddButton(noButton);

            _currentDialog = dialog;
            _currentButton.DeHighlight();
            _currentButton = yesButton;
            _currentButton.Highlight();
        }
        private async void imgMenu_Tapped(object sender, TappedRoutedEventArgs e)
        {
            MenuDialog menuDialog = new MenuDialog();

            menuDialog.data = data;
            await menuDialog.ShowAsync();
        }
예제 #7
0
 public static void DoMenuEnd(MenuDialog menu)
 {
     if (OnMenuEnd != null)
     {
         OnMenuEnd(menu);
     }
 }
예제 #8
0
        public override void OnEnter()
        {
            if (setMenuDialog != null)
            {
                // Override the active menu dialog
                MenuDialog.activeMenuDialog = setMenuDialog;
            }

            bool hideOption = (hideIfVisited && targetBlock != null && targetBlock.GetExecutionCount() > 0);

            if (!hideOption)
            {
                IMenuDialog menuDialog = MenuDialog.GetMenuDialog();
                if (menuDialog != null)
                {
                    menuDialog.SetActive(true);

                    var    flowchart   = GetFlowchart();
                    string displayText = flowchart.SubstituteVariables(text);

                    menuDialog.AddOption(displayText, interactable, targetBlock);
                }
            }

            Continue();
        }
예제 #9
0
        private void OnSaveFile(MenuPageEventArgs e)
        {
            _dialogOpen = true;
            var dialog = new MenuDialog();

            dialog.AddTextLine("Saving...");
            _currentDialog = dialog;
        }
예제 #10
0
 public static void Postfix(MainDialog __instance, string contextName, string contextId, bool state, GameObject thisButton)
 {
     if (contextName.Equals("modMenu"))
     {
         ModMenu.Menu.SetBackButton(DialogType.Main);
         MenuDialog.SwitchTo(ModMenu.Menu, __instance.hand());
     }
 }
예제 #11
0
 private static void btnResetBackground_Action(string id, Dialog dialog)
 {
     Main.config.HideFundament = false;
     Main.config.FundamentTID  = "";
     Main.config.Dynamic       = false;
     Main.config.Save();
     Managers.soundManager.Play("success", dialog.transform, 0.2f);
     MenuDialog.SwitchTo(ModMenu.Menu, dialog.hand(), dialog.tabName);
 }
예제 #12
0
 public void ActionTest()
 {
     this.menuItem2.Selected = true;
     MenuDialog target = new MenuDialog(menuItems);
     target.Action();
     Assert.AreEqual(0, action1);
     Assert.AreEqual(1, action2);
     Assert.AreEqual(0, action3);
 }
예제 #13
0
    private void UnfreezePlayerWhenFlowchartEnds(Block block)
    {
        var flowchart = block.GetFlowchart();

        if (!flowchart.HasExecutingBlocks() && !MenuDialog.GetMenuDialog().IsActive())
        {
            _playerMovement.IsFrozen = false;
            BlockSignals.OnBlockEnd -= UnfreezePlayerWhenFlowchartEnds;
            flowchart.SendFungusMessage("End");
        }
    }
예제 #14
0
        public void ActiveTest()
        {
            MenuDialog target = new MenuDialog(menuItems);
            Assert.IsFalse(target.Active);

            target.Active = true;
            Assert.IsTrue(target.Active);

            target.Active = false;
            Assert.IsFalse(target.Active);
        }
예제 #15
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
    protected virtual void SetupDialogs(Transform dialogRetireTrans)
    {
        this.menuDialog = this.battleAlwaysUi.SetupMenu();
        this.helpDialog = this.battleAlwaysUi.helpDialogGO;
        dialogRetireTrans.SetParent(this.battleAlwaysUi.battleMenu.transform);
        UIWidget component = dialogRetireTrans.GetComponent <UIWidget>();

        if (component != null)
        {
            component.SetAnchor(this.battleAlwaysUi.battleMenu.transform);
        }
    }
        public override void OnEnter()
        {
            mPreviousMenuDialog = MenuDialog.ActiveMenuDialog;
            base.OnEnter();
            var menuDialog            = MenuDialog.GetMenuDialog();
            MenuDialogWithSay menuDlg = menuDialog as MenuDialogWithSay;

            Debug.Assert(menuDlg != null);
            menuDlg.SetSayText(_sayText);
            menuDlg.SetCharacter(_character);
            menuDlg.SetCharacterImage(_portrait);
        }
예제 #18
0
        public override void OnEnter()
        {
            IMenuDialog menuDialog = MenuDialog.GetMenuDialog();

            if (menuDialog != null &&
                targetBlock != null)
            {
                menuDialog.ShowTimer(_duration.Value, targetBlock);
            }

            Continue();
        }
예제 #19
0
        public void initSubPanel()
        {
            md = new MenuDialog(this);
            md.SetBounds(340, 40, 413, 520);

            button = new MyButton("菜单");
            button.SetBounds(900, 0, 113, 41);
            button.MouseClick += new MouseEventHandler(GamePanel_MouseClick);
            button.MouseMove  += new MouseEventHandler(GamePanel_MouseMove);

            this.Controls.Add(md);
            this.Controls.Add(button);
        }
예제 #20
0
        public void OnStartLocalGameButton()
        {
            if (CaravanServer == null)
            {
                CaravanServer = new CaravanServerConnectorClientSide();

                Log = new List <string>();

                StartCoroutine(GetWorld());

                MenuDialog.CloseDialog();
            }
        }
예제 #21
0
        public void OnStartOnlineGameButton()
        {
            if (CaravanServer == null)
            {
                CaravanServer = new CaravanServerHttpConnector();

                Log = new List <string>();

                StartCoroutine(GetWorld());

                MenuDialog.CloseDialog();
            }
        }
예제 #22
0
        private void Start()
        {
            SettingsDialogController.LoadAndApplySettings();
            MenuCanvas.gameObject.SetActive(true);
            SettingsDialogController.gameObject.SetActive(false);
            InformationDialog.gameObject.SetActive(false);
            EnterCityMenuDialog.gameObject.SetActive(false);
            MenuDialog.gameObject.SetActive(false);
            CityControllerBase.transform.position   = new Vector3(99999, 0, 0);
            PlayerControllerBase.transform.position = new Vector3(99999, 0, 0);

            MenuDialog.ShowDialog();
        }
예제 #23
0
        public PlayerRegistration()
        {
            menu = new MenuDialog("Inscription", "Valider", continueName: "Continuer ...");

            passwordItem           = new MenuDialogItem(Color.Red + "Mot de passe");
            passwordItem.Selected += PasswordSelect;

            emailItem           = new MenuDialogItem(Color.Red + "Email");
            emailItem.Selected += EmailSelect;

            menu.AddItem(passwordItem);
            menu.AddItem(emailItem);
        }
예제 #24
0
        /// <summary>
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnButtonClicked(object sender, EventArgs e)
        {
            if (OnlineManager.Status.Value != ConnectionStatus.Connected &&
                OnlineManager.Status.Value != ConnectionStatus.Disconnected)
            {
                return;
            }

            var options = new List <IMenuDialogOption>();

            if (OnlineManager.Status.Value == ConnectionStatus.Connected)
            {
                options.Add(new MenuDialogOption("View Profile", () =>
                                                 BrowserHelper.OpenURL($"https://quavergame.com/profile/{OnlineManager.Self.OnlineUser.Id}?mode={(int) ConfigManager.SelectedGameMode.Value}")));

                options.Add(new MenuDialogOption("Steam Profile", () => BrowserHelper.OpenURL($"https://steamcommunity.com/profiles/{OnlineManager.Self.OnlineUser.SteamId}")));
            }

            if (OnlineManager.Status.Value == ConnectionStatus.Disconnected)
            {
                options.Add(new MenuDialogOption("Log into the server", OnlineManager.Login));
            }

            if (OnlineManager.Status.Value == ConnectionStatus.Connected)
            {
                switch (ConfigManager.SelectedGameMode.Value)
                {
                case API.Enums.GameMode.Keys4:
                    options.Add(new MenuDialogOption("Change game mode to 7 Keys", () => ConfigManager.SelectedGameMode.Value = API.Enums.GameMode.Keys7));
                    break;

                case API.Enums.GameMode.Keys7:
                    options.Add(new MenuDialogOption("Change game mode to 4 Keys", () => ConfigManager.SelectedGameMode.Value = API.Enums.GameMode.Keys4));
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                options.Add(new MenuDialogOption("Logout", () => OnlineManager.Client?.Disconnect()));
            }

            options.Add(new MenuDialogOption("Close", () => {}));

            var dialog = new MenuDialog("Options", options);

            DialogManager.Show(dialog);
        }
        public PlayerCharacterCreation()
        {
            menu = new MenuDialog("Création de personnage", "Valider", continueName: "Continuer ...");

            nameItem           = new MenuDialogItem(Color.Red + "Nom");
            nameItem.Selected += NameSelect;

            ageItem           = new MenuDialogItem(Color.Red + "Age");
            ageItem.Selected += AgeSelect;

            sexItem           = new MenuDialogItem(Color.Red + "Sexe");
            sexItem.Selected += SexSelect;

            menu.AddItem(nameItem);
            menu.AddItem(ageItem);
            menu.AddItem(sexItem);
        }
예제 #26
0
        private void OpenKeybindDialog(MenuPageEventArgs e)
        {
            var args = e as KeybindChangeEventArgs;

            if (args == null)
            {
                return;
            }

            _lastKeybindChanged = args.Button;

            var keyDialog = new MenuDialog();

            keyDialog.AddTextLine("Press any key or button.");

            _currentDialog = keyDialog;
            _dialogOpen    = true;
        }
 private void Awake()
 {
     story = new Story(ink.text);
     if (sayDialog == null)
     {
         sayDialog = FindObjectOfType <SayDialog>();
     }
     if (menuDialog == null)
     {
         menuDialog = FindObjectOfType <MenuDialog>();
     }
     if (gatewayFlowchart == null)
     {
         gatewayFlowchart = GetComponentInChildren <Flowchart>();
     }
     choiceTime = defaultChoiceTime;
     flags.Add("hide", new Flag(hideQuestions));
     flags.Add("echo", new Flag(echoAnswers));
     flags.Add("auto", new Flag(autoProceed));
     flags.Add("verbatim", new Flag(ignoreDialogRegex));
     flags.Add("timer", new Flag(choiceTimer));
 }
예제 #28
0
        private void OnLoadFile(MenuPageEventArgs e)
        {
            _dialogOpen        = true;
            _loadConfirmDialog = new MenuDialog();
            _loadConfirmDialog.AddTextLine("Any unsaved progress will be lost.");

            var okButton = new MenuButton(new Vector2(0, 0), "Ok", ButtonStyles.Dialog, new StartOrLoadEventArgs(_fileHighlightIndex));

            okButton.OnSelected += RaiseLoadGameEvent;
            okButton.OnSelected += RaiseCloseDialogEvent;

            var cancelButton = new MenuButton(new Vector2(0, 0), "Cancel", ButtonStyles.Dialog, new CloseDialogEventArgs());

            cancelButton.OnSelected += RaiseCloseDialogEvent;
            cancelButton.OnSelected += ResetFileButtons;

            _loadConfirmDialog.AddButton(okButton);
            _loadConfirmDialog.AddButton(cancelButton);

            _currentDialog = _loadConfirmDialog;
            _currentButton.DeHighlight();
            _currentButton = okButton;
            _currentButton.Highlight();
        }
예제 #29
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                Scene = null;
                User = null;

                MoveTime = 0;
                AttackTime = 0;
                NextRunTime = 0;
                CanMove = false;
                CanRun = false;

                MapControl = null;
                MainDialog = null;
                ChatDialog = null;
                ChatControl = null;
                InventoryDialog = null;
                CharacterDialog = null;
                StorageDialog = null;
                BeltDialog = null;
                MiniMapDialog = null;
                InspectDialog = null;
                OptionDialog = null;
                MenuDialog = null;
                NPCDialog = null;
                QuestDetailDialog = null;
                QuestListDialog = null;
                QuestLogDialog = null;
                QuestTrackingDialog = null;
                GameShopDialog = null;
                MentorDialog = null;

                RelationshipDialog = null;
                CharacterDuraPanel = null;
                DuraStatusPanel = null;

                HoverItem = null;
                SelectedCell = null;
                PickedUpGold = false;

                UseItemTime = 0;
                PickUpTime = 0;
                InspectTime = 0;

                DisposeItemLabel();

                AMode = 0;
                PMode = 0;
                Lights = 0;

                NPCTime = 0;
                NPCID = 0;
                DefaultNPCID = 0;

                for (int i = 0; i < OutputLines.Length; i++)
                    if (OutputLines[i] != null && OutputLines[i].IsDisposed)
                        OutputLines[i].Dispose();

                OutputMessages.Clear();
                OutputMessages = null;
            }

            base.Dispose(disposing);
        }
예제 #30
0
        public GameScene()
        {
            MapControl.AutoRun = false;
            MapControl.AutoHit = false;
            Slaying = false;
            Thrusting = false;
            HalfMoon = false;
            CrossHalfMoon = false;
            DoubleSlash = false;
            TwinDrakeBlade = false;
            FlamingSword = false;

            GroupDialog.GroupList.Clear();

            Scene = this;
            BackColour = Color.Transparent;
            MoveTime = CMain.Time;

            KeyDown += GameScene_KeyDown;

            MainDialog = new MainDialog { Parent = this };
            ChatDialog = new ChatDialog { Parent = this };
            ChatControl = new ChatControlBar { Parent = this };
            InventoryDialog = new InventoryDialog { Parent = this };
            CharacterDialog = new CharacterDialog { Parent = this, Visible = false };
            BeltDialog = new BeltDialog { Parent = this };
            StorageDialog = new StorageDialog { Parent = this, Visible = false };
            MiniMapDialog = new MiniMapDialog { Parent = this };
            InspectDialog = new InspectDialog { Parent = this, Visible = false };
            OptionDialog = new OptionDialog { Parent = this, Visible = false };
            MenuDialog = new MenuDialog { Parent = this, Visible = false };
            NPCDialog = new NPCDialog { Parent = this, Visible = false };
            NPCGoodsDialog = new NPCGoodsDialog { Parent = this, Visible = false };
            NPCDropDialog = new NPCDropDialog { Parent = this, Visible = false };
            NPCAwakeDialog = new NPCAwakeDialog { Parent = this, Visible = false };

            HelpDialog = new HelpDialog { Parent = this, Visible = false };
            
            MountDialog = new MountDialog { Parent = this, Visible = false };
            FishingDialog = new FishingDialog { Parent = this, Visible = false };
            FishingStatusDialog = new FishingStatusDialog { Parent = this, Visible = false };
            
            GroupDialog = new GroupDialog { Parent = this, Visible = false };
            GuildDialog = new GuildDialog { Parent = this, Visible = false };
            GuildBuffDialog = new GuildBuffDialog { Parent = this, Visible = false };
            BigMapDialog = new BigMapDialog { Parent = this, Visible = false };
            TrustMerchantDialog = new TrustMerchantDialog { Parent = this, Visible = false };
            CharacterDuraPanel = new CharacterDuraPanel { Parent = this, Visible = false };
            DuraStatusPanel = new DuraStatusDialog { Parent = this, Visible = true };
            TradeDialog = new TradeDialog { Parent = this, Visible = false };
            GuestTradeDialog = new GuestTradeDialog { Parent = this, Visible = false };

            SkillBarDialog = new SkillBarDialog { Parent = this, Visible = false };
            ChatOptionDialog = new ChatOptionDialog { Parent = this, Visible = false };
            ChatNoticeDialog = new ChatNoticeDialog { Parent = this, Visible = false };

            QuestListDialog = new QuestListDialog { Parent = this, Visible = false };
            QuestDetailDialog = new QuestDetailDialog {Parent = this, Visible = false};
            QuestTrackingDialog = new QuestTrackingDialog { Parent = this, Visible = false };
            QuestLogDialog = new QuestDiaryDialog {Parent = this, Visible = false};

            RankingDialog = new RankingDialog { Parent = this, Visible = false };

            MailListDialog = new MailListDialog { Parent = this, Visible = false };
            MailComposeLetterDialog = new MailComposeLetterDialog { Parent = this, Visible = false };
            MailComposeParcelDialog = new MailComposeParcelDialog { Parent = this, Visible = false };
            MailReadLetterDialog = new MailReadLetterDialog { Parent = this, Visible = false };
            MailReadParcelDialog = new MailReadParcelDialog { Parent = this, Visible = false };

            IntelligentCreatureDialog = new IntelligentCreatureDialog { Parent = this, Visible = false };//IntelligentCreature
            IntelligentCreatureOptionsDialog = new IntelligentCreatureOptionsDialog { Parent = this, Visible = false };//IntelligentCreature
            IntelligentCreatureOptionsGradeDialog = new IntelligentCreatureOptionsGradeDialog { Parent = this, Visible = false };//IntelligentCreature

            RefineDialog = new RefineDialog { Parent = this, Visible = false };
            RelationshipDialog = new RelationshipDialog { Parent = this, Visible = false };
            FriendDialog = new FriendDialog { Parent = this, Visible = false };
            MemoDialog = new MemoDialog { Parent = this, Visible = false };
            MentorDialog = new MentorDialog { Parent = this, Visible = false };
            GameShopDialog = new GameShopDialog { Parent = this, Visible = false };

            //not added yet
            KeyboardLayoutDialog = new KeyboardLayoutDialog { Parent = this, Visible = false };
            

            

            for (int i = 0; i < OutputLines.Length; i++)
                OutputLines[i] = new MirLabel
                {
                    AutoSize = true,
                    BackColour = Color.Transparent,
                    Font = new Font(Settings.FontName, 10F),
                    ForeColour = Color.LimeGreen,
                    Location = new Point(20, 25 + i * 13),
                    OutLine = true,
                };
        }
 public void ReplaceMenuDialog(MenuDialog menuDialog)
 {
     this.menuDialog = menuDialog;
 }
예제 #32
0
 public void MenuItemsTest()
 {
     MenuDialog target = new MenuDialog(menuItems);
     Assert.AreEqual(this.menuItems, target.MenuItems);
 }
예제 #33
0
        public void DownTest()
        {
            this.menuItem3.Selected = true;
            MenuDialog target = new MenuDialog(menuItems);

            target.Down();
            Assert.IsTrue(this.menuItem1.Selected);
            Assert.IsFalse(this.menuItem2.Selected);
            Assert.IsFalse(this.menuItem3.Selected);
            Assert.IsFalse(this.menuItem4.Selected);

            target.Down();
            Assert.IsFalse(this.menuItem1.Selected);
            Assert.IsTrue(this.menuItem2.Selected);
            Assert.IsFalse(this.menuItem3.Selected);
            Assert.IsFalse(this.menuItem4.Selected);
        }
예제 #34
0
 /// <summary>
 /// Creates a new MenuDialogView object.
 /// </summary>
 /// <param name="menuItemViews">An array of MenuItemViews.</param>
 /// <param name="menuDialog">The dedicated MenuDialog.</param>
 public MenuDialogView(MenuItemView[] menuItemViews, MenuDialog menuDialog)
 {
     this.menuItemViews = menuItemViews;
     this.menuDialog = menuDialog;
 }
예제 #35
0
        public void Initialize()
        {
            this.action11 = 0;
            this.menuItem11 = new MenuItem(delegate(MenuItem m) { this.action11 += 1; }, null);
            this.action12 = 0;
            this.menuItem12 = new MenuItem(delegate(MenuItem m) { this.action12 += 1; }, null);
            MenuItem[] menuItems1 = { menuItem11, menuItem12 };
            this.dialog1 = new MenuDialog(menuItems1);

            this.action21 = 0;
            this.menuItem21 = new MenuItem(delegate(MenuItem m) { this.action21 += 1; }, null);
            this.action22 = 0;
            this.menuItem22 = new MenuItem(delegate(MenuItem m) { this.action22 += 1; }, null);
            MenuItem[] menuItems2 = { menuItem21, menuItem22 };
            this.dialog2 = new MenuDialog(menuItems2);

            MenuDialog[] dialogs = { dialog1, dialog2 };
            this.dialogs = dialogs;
        }
예제 #36
0
        public void SetGameEndedMenuTest()
        {
            List<MenuDialog> dialogList = new List<MenuDialog>();
            for (int i = 0; i <= 10; i += 1)
            {
                MenuItem menuItem = new MenuItem(delegate(MenuItem m) { }, null);
                MenuItem[] menuItems = { menuItem };
                MenuDialog d = new MenuDialog(menuItems);
                d.Active = (i == 3) ? true : false;
                dialogList.Add(d);
            }

            MenuModel target = new MenuModel();
            target.MenuDialogs = dialogList.ToArray();
            target.SetGameEndedMenu(2);

            Assert.IsFalse(dialogList[3].Active);
            Assert.IsTrue(dialogList[10].Active);
            Assert.AreEqual(2, target.WinningPlayerID);
        }
예제 #37
0
 private static void BtnCustomize_Action(string id, Dialog dialog)
 {
     config.Load();
     MenuDialog.SwitchTo(UIMenu.Menu, dialog.hand(), dialog.tabName);
 }
예제 #38
0
 public static void OpenSavedBodyParts()
 {
     Main.config.Load();
     MenuDialog.SwitchTo(Main.pointMenu);
 }
예제 #39
0
 private static void PointMenu_DialogClose(MenuDialog obj)
 {
     Our.SetPreviousMode();
 }