protected override void initialize(Vector2 loc, int width, List <string> strs) { // Headers for (int i = 0; i < 5; i++) { Headers.Add(new TextSprite()); Headers[i].SetFont(Config.UI_FONT, Global.Content, "White"); } Headers[0].loc = new Vector2(24, 8); Headers[1].loc = new Vector2(104, 8); Headers[2].loc = new Vector2(144, 8); Headers[3].loc = new Vector2(184, 8); Headers[4].loc = new Vector2(216, 8); Headers[0].text = "Item"; Headers[1].text = "Uses"; Headers[2].text = "Price"; Headers[3].text = "Stock"; Headers[4].text = "Owned"; Window_Divider = new StatusWindowDivider(); Window_Divider.SetWidth(width - 32); Window_Divider.loc = new Vector2(16, 20); base.initialize(loc, width, strs); }
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); }