Пример #1
0
        private void SetupRoot()
        {
            Page p = Root;

            p.Condition = PageUtil.GetVisitProcessCondition(flags, party);
            p.Icon      = Util.GetSprite("walking-boot");
            p.Body      = "Where would you like to go?";
            p.AddCharacters(Side.LEFT, party);
            var buttons = new List <IButtonable>();

            buttons.Add(PageUtil.GenerateBack(previous));

            foreach (PageGroup pg in GetCurrentArea(flags.CurrentArea).Places)
            {
                buttons.Add(GetPlaceProcess(pg));
            }

            p.Actions = buttons;
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WorldPages"/> class.
        /// </summary>
        /// <param name="previous">The previous.</param>
        /// <param name="flags">The flags.</param>
        /// <param name="party">The party.</param>
        public WorldPages(Page previous, Flags flags, Party party) : base(new Page("Areas"))
        {
            Root.Body      = "Which area would you like to go to?";
            Root.Icon      = Util.GetSprite("journey");
            Root.Condition = PageUtil.GetVisitProcessCondition(flags, party);
            IList <IButtonable> buttons = new List <IButtonable>();

            buttons.Add(PageUtil.GenerateBack(previous));

            Root.AddCharacters(Side.LEFT, party.Collection);

            foreach (AreaType type in AreaList.ALL_AREAS.Keys)
            {
                if (flags.IsAreaUnlocked(type) && flags.CurrentArea != type)
                {
                    buttons.Add(GetAreaChangeProcess(type, flags, party, previous));
                }
            }

            Root.Actions = buttons;
        }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StagePages"/> class.
        /// </summary>
        /// <param name="previous">The previous page to back to.</param>
        /// <param name="party">The current party.</param>
        /// <param name="flags">The game's flags.</param>
        public StagePages(Page previous, Party party, Flags flags) : base(new Page("Quest"))
        {
            var buttons = new List <IButtonable>();

            this.party    = party;
            this.flags    = flags;
            this.previous = previous;

            Root.Icon = Util.GetSprite("dungeon-gate");
            Root.AddCharacters(Side.LEFT, party);
            Root.Condition = PageUtil.GetVisitProcessCondition(flags, party);

            buttons.Add(PageUtil.GenerateBack(previous));

            Area currentArea = GetCurrentArea(flags.CurrentArea);

            for (int i = 0; i < currentArea.Stages.Count; i++)
            {
                if (IsStagePlayable(i, currentArea))
                {
                    buttons.Add(GetPageEntryProcess(i, currentArea));
                }
                else
                {
                    buttons.Add(new Process("<color=grey>???</color>", "Complete the previous stage to unlock."));
                }
            }

            Get(ROOT_INDEX).Actions = buttons;
            Get(ROOT_INDEX).OnEnter = () => {
                Get(ROOT_INDEX)
                .AddText(
                    "Select a stage."
                    );
            };
        }