예제 #1
0
        protected void set_choices(int ox, string str1, string str2)
        {
            List <TextUINode> choices = new List <TextUINode>();

            var text1 = new TextSprite();

            text1.SetFont(Config.CONVO_FONT, Global.Content, "White");
            text1.text = str1;

            var node = new TextUINode("", text1, text1.text_width);

            node.loc = new Vector2(88 + ox, 32);
            choices.Add(node);

            var text2 = new TextSprite();

            text2.SetFont(Config.CONVO_FONT, Global.Content, "White");
            text2.text = str2;

            node     = new TextUINode("", text2, text2.text_width);
            node.loc = new Vector2(88 + ox + 40, 32);
            choices.Add(node);

            Choices            = new UINodeSet <TextUINode>(choices);
            Cursor             = new UICursor <TextUINode>(Choices);
            Cursor.draw_offset = new Vector2(-16, 0);
            Cursor.ratio       = new int[] { 1, 1 };
            Cursor.hide_when_using_mouse(false);
            Cursor.move_to_target_loc();
        }
예제 #2
0
        private void empty_slot_node(int unit_index, int index, List <CommandUINode> nodes)
        {
            var text = new TextSprite(
                Config.UI_FONT, Global.Content, "White",
                Vector2.Zero);

            var node = new TextUINode("", text, SPACING - 16); //Debug

            node.loc = new Vector2(8, 8) + new Vector2(SPACING * unit_index, index * 16);
            nodes.Add(node);
        }
예제 #3
0
        protected CommandUINode text_item(string str, int i)
        {
            var text = new TextSprite();

            text.SetFont(Config.UI_FONT, Global.Content, "White");
            text.text = str;
            var text_node = new TextUINode("", text, this.column_width);

            text_node.loc = item_loc(i);
            return(text_node);
        }
예제 #4
0
        internal PreviousChapterSelectionMenu(
            Vector2 centerLoc,
            string chapterId,
            WorldmapMenuData menuData,
            IHasCancelButton menu = null)
        {
            ChapterId              = chapterId;
            ProgressionIds         = menuData.ValidPreviousChapters.Keys.ToList();
            ValidPreviousChapters  = menuData.ValidPreviousChapters;
            PreviousChapterIndices = menuData.UsablePreviousChapterIndices;

            Window        = new SystemWindowHeadered();
            Window.width  = 104;
            Window.height = 32 + 16 * (ValidPreviousChapters.Count + 1) + 4;
            Window.offset = new Vector2(0, 16);

            Loc = centerLoc -
                  (new Vector2(Window.width, Window.height) - Window.offset) / 2;

            Header             = new TextSprite();
            Header.draw_offset = new Vector2(8, -8);
            Header.SetFont(Config.UI_FONT, Global.Content, "Yellow");
            Header.text = ValidPreviousChapters.Count > 1 ? "Previous Chapters" : "Previous Chapter";

            Divider             = new StatusWindowDivider();
            Divider.draw_offset = new Vector2(8, Window.height - 44);
            Divider.SetWidth(Window.width - 16);

            LeftArrows  = new Dictionary <Page_Arrow, int>();
            RightArrows = new Dictionary <Page_Arrow, int>();

            // Center, then adjust left to account for map sprite
            int x = ((Window.width / 2) / 8 * 8) - 16;
            List <CommandUINode> nodes = new List <CommandUINode>();

            for (int i = 0; i < ProgressionIds.Count; i++)
            {
                int y = i * 16 + 8;

                var text = new TextSprite();
                text.SetFont(Config.UI_FONT, Global.Content, "White");
                text.text = chapter(i).Id;
                var node = new MapSpriteUINode("", text, 56);
                refresh_map_sprite(node, i);
                node.loc = new Vector2(x, y);
                nodes.Add(node);

                // Add arrows for this set of chapters,
                // if there's more than one choice
                if (chapter_list(i).Count > 1)
                {
                    var left_arrow = new Page_Arrow();
                    left_arrow.loc           = new Vector2(8, y);
                    left_arrow.ArrowClicked += LeftArrow_ArrowClicked;
                    LeftArrows.Add(left_arrow, i);

                    var right_arrow = new Page_Arrow();
                    right_arrow.loc           = new Vector2(Window.width - 8, y);
                    right_arrow.mirrored      = true;
                    right_arrow.ArrowClicked += RightArrow_ArrowClicked;
                    RightArrows.Add(right_arrow, i);
                }
            }

            // Add confirm choice
            var confirmText = new TextSprite(
                Config.UI_FONT, Global.Content, "White",
                new Vector2(4, 0),
                "Confirm");
            var confirm = new TextUINode("", confirmText, 56);

            confirm.loc = new Vector2(x, nodes.Count * 16 + 8 + 4);
            nodes.Add(confirm);

            Items = new UINodeSet <CommandUINode>(nodes);
            Items.WrapVerticalSameColumn    = true;
            Items.CursorMoveSound           = System_Sounds.Menu_Move1;
            Items.HorizontalCursorMoveSound = System_Sounds.Menu_Move2;

            Items.AngleMultiplier   = 2f;
            Items.TangentDirections = new List <CardinalDirections> {
                CardinalDirections.Left, CardinalDirections.Right
            };
            Items.refresh_destinations();

            Items.set_active_node(confirm);

            UICursor             = new UICursor <CommandUINode>(Items);
            UICursor.draw_offset = new Vector2(-12, 0);
            //UICursor.ratio = new int[] { 1, 3 }; //Debug

            CreateCancelButton(menu);
        }