Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        public MessageBox(string Title, string Message, ButtonType type = ButtonType.OK, IconType IconType = IconType.None, List <string> _buttons = null)
        {
            this.ButtonType = type;
            this.Buttons    = _buttons;
            this.IconType   = IconType;

            SetTitle(Title);
            this.Message = Message;

            if (IconType != IconType.None)
            {
                Icon = new PictureBox(this);
                Icon.Sprite.Bitmap        = new Bitmap("mbox_icons");
                Icon.Sprite.SrcRect.Width = 32;
                Icon.Sprite.SrcRect.X     = 32 * ((int)IconType - 1);
            }

            label = new MultilineLabel(this);
            label.SetText(Message);

            switch (ButtonType)
            {
            case ButtonType.OK:
                Buttons = new List <string>()
                {
                    "OK"
                };
                break;

            case ButtonType.OKCancel:
                Buttons = new List <string>()
                {
                    "OK", "Cancel"
                };
                break;

            case ButtonType.YesNo:
                Buttons = new List <string>()
                {
                    "Yes", "No"
                };
                break;

            case ButtonType.YesNoCancel:
                Buttons = new List <string>()
                {
                    "Yes", "No", "Cancel"
                };
                break;

            case ButtonType.Custom: break;

            default:
                throw new Exception("Invalid ButtonType");
            }

            if (Buttons.Count == 1)
            {
                Button3 = new Button(this);
                Button3.SetText(Buttons[0]);
                Button3.OnClicked += delegate(BaseEventArgs e)
                {
                    Result = 0;
                    this.OnButtonPressed?.Invoke(new BaseEventArgs());
                    Close();
                };
            }
            else if (Buttons.Count == 2)
            {
                Button2 = new Button(this);
                Button2.SetText(Buttons[0]);
                Button2.OnClicked += delegate(BaseEventArgs e)
                {
                    Result = 0;
                    this.OnButtonPressed?.Invoke(new BaseEventArgs());
                    Close();
                };
                Button3 = new Button(this);
                Button3.SetText(Buttons[1]);
                Button3.OnClicked += delegate(BaseEventArgs e)
                {
                    Result = 1;
                    this.OnButtonPressed?.Invoke(new BaseEventArgs());
                    Close();
                };
            }
            else if (Buttons.Count == 3)
            {
                Button1 = new Button(this);
                Button1.SetText(Buttons[0]);
                Button1.OnClicked += delegate(BaseEventArgs e)
                {
                    Result = 0;
                    this.OnButtonPressed?.Invoke(new BaseEventArgs());
                    Close();
                };
                Button2 = new Button(this);
                Button2.SetText(Buttons[1]);
                Button2.OnClicked += delegate(BaseEventArgs e)
                {
                    Result = 1;
                    this.OnButtonPressed?.Invoke(new BaseEventArgs());
                    Close();
                };
                Button3 = new Button(this);
                Button3.SetText(Buttons[2]);
                Button3.OnClicked += delegate(BaseEventArgs e)
                {
                    Result = 2;
                    this.OnButtonPressed?.Invoke(new BaseEventArgs());
                    Close();
                };
            }

            MinimumSize = MaximumSize = new Size(300, 150);
            SetSize(MaximumSize);
        }