public WorldmapMenuManager( IWorldmapMenuHandler handler, WorldmapMenuData menuData) : base(handler) { MenuData = menuData; AddWorldmapMenu(); }
public WorldmapMenu(WorldmapMenuData menuData, IWorldmapHandler menuHandler) { MenuData = menuData; MenuHandler = menuHandler; // Command Window CreateCommandWindow(); // Data_Window DataWindow = new Window_WorldMap_Data(); DataWindow.loc = new Vector2(4, 4); Refresh(); }
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); }