public void SetMap(Map Map) { this.MapData = Map; while (StackPanel.Widgets.Count > 0) { StackPanel.Widgets[0].Dispose(); } List <int> Keys = new List <int>(Map.Events.Keys); Keys.Sort(); foreach (int key in Keys) { EventListEntryWidget e = new EventListEntryWidget(StackPanel); e.SetEvent(Map.Events[key]); } if (Map.Events.Count == 0) { MultilineLabel label = new MultilineLabel(StackPanel); label.SetFont(Font.Get("Fonts/ProductSans-M", 14)); label.SetText("This map does not have any events."); label.SetMargin(8, 8); } StackPanel.UpdateLayout(); }
public HomeScreen(IContainer Parent) : base(Parent) { SetBackgroundColor(28, 50, 73); Sprites["map"] = new Sprite(this.Viewport); if (System.IO.File.Exists("home_map.png")) { Sprites["map"].Bitmap = new Bitmap("home_map.png"); } Sprites["sidebar"] = new Sprite(this.Viewport, "home_side.png"); Sprites["logo"] = new Sprite(this.Viewport, "home_logo.png"); Sprites["logo"].X = 33; Sprites["logo"].Y = 4; Sprites["text"] = new Sprite(this.Viewport, new Bitmap(360, 160)); Sprites["text"].Bitmap.Font = Font.Get("Fonts/Ubuntu-B", 18); Sprites["text"].Bitmap.Unlock(); Sprites["text"].Bitmap.DrawText(Editor.GetVersionString(), 348, 88, Color.WHITE, DrawOptions.RightAlign); Sprites["text"].Bitmap.Font = Font.Get("Fonts/Ubuntu-B", 22); Sprites["text"].Bitmap.DrawText("Recent Projects:", 38, 126, Color.WHITE, DrawOptions.Underlined); Sprites["text"].Bitmap.Lock(); Sprites["filesel"] = new Sprite(this.Viewport, new SolidBitmap(2, 38, new Color(0, 205, 255))); Sprites["filesel"].X = 30; Sprites["filesel"].Visible = false; Sprites["files"] = new Sprite(this.Viewport); Sprites["files"].X = 42; Sprites["files"].Y = 168; NewProjectButton = new HomeScreenButton(this); NewProjectButton.SetPosition(445, 108); NewProjectButton.SetText("New Project"); NewProjectButton.SetIcon("home_icon_new"); NewProjectButton.SetHelpText("Create a new project."); NewProjectButton.OnLeftClick += delegate(MouseEventArgs e) { NewProject(); }; OpenProjectButton = new HomeScreenButton(this); OpenProjectButton.SetPosition(690, 108); OpenProjectButton.SetText("Open Project"); OpenProjectButton.SetIcon("home_icon_openfile"); OpenProjectButton.SetHelpText("Open an existing project by selecting its project file."); OpenProjectButton.OnLeftClick += delegate(MouseEventArgs e) { OpenProject(); }; TutorialsButton = new HomeScreenButton(this); TutorialsButton.SetPosition(935, 108); TutorialsButton.SetText("Tutorials"); TutorialsButton.SetHelpText("Click this button to be directed to various tutorials and documentation for RPG Studio MK."); TutorialsButton.SetIcon("home_icon_tutorials"); TutorialsButton.OnLeftClick += delegate(MouseEventArgs e) { ShowTutorials(); }; YoutubeButton = new PictureBox(this); YoutubeButton.Sprite.Bitmap = new Bitmap("home_icon_youtube.png"); YoutubeButton.SetHelpText("Visit MK's YouTube account."); YoutubeButton.OnLeftClick += delegate(MouseEventArgs e) { new MessageBox("Oops!", "MK does not have a YouTube channel yet!", IconType.Error); }; TwitterButton = new PictureBox(this); TwitterButton.Sprite.Bitmap = new Bitmap("home_icon_twitter.png"); TwitterButton.SetHelpText("Visit MK's Twitter account."); TwitterButton.OnLeftClick += delegate(MouseEventArgs e) { Utilities.OpenLink("http://twitter.com/MKStarterKit"); }; NoProjects = new MultilineLabel(this); NoProjects.SetSize(320, 100); NoProjects.SetPosition(40, 170); NoProjects.SetText("You haven't opened any projects recently.\nGet started by creating or opening a project!"); NoProjects.SetFont(Font.Get("Fonts/Ubuntu-R", 15)); VignetteFade = new VignetteFade(this); }