Ejemplo n.º 1
0
        private void newToolStripButton1_Click(object sender, EventArgs e)
        {
            CreateGumpDialog cgd = new CreateGumpDialog();

            string myGumpsPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "My Gumps");

            if (!Directory.Exists(myGumpsPath))
            {
                Directory.CreateDirectory(myGumpsPath);
            }

            cgd.Path = Program.Settings.GetValue <string>("last_path", myGumpsPath);

            if (cgd.ShowDialog(this) == DialogResult.OK)
            {
                Program.Settings.SetValue <string>("last_path", cgd.Path);
                if (this.Gump != null && this.Gump.Modified)
                {
                    DialogResult res = MessageBox.Show(this, "Do you wish to save changes to your current gump?", "RunUO: GDK", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);

                    if (res == DialogResult.Cancel)
                    {
                        return;
                    }
                    else if (res == DialogResult.Yes)
                    {
                        this.Gump.Save(Gump.FileName);
                    }
                }

                Gump g = new Gump();
                g.Resolution = cgd.Resolution;
                g.Name       = cgd.GumpName;
                //g.FileName = Path.Combine(cgd.Path, g.Name);

                Gump = g;

                Invalidate(true);
            }
        }
Ejemplo n.º 2
0
        private void newToolStripButton1_Click(object sender, EventArgs e)
        {
            CreateGumpDialog cgd = new CreateGumpDialog();

            string myGumpsPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "My Gumps");

            if (!Directory.Exists(myGumpsPath))
            {
                Directory.CreateDirectory(myGumpsPath);
            }

            cgd.Path = Program.Settings.GetValue<string>("last_path", myGumpsPath);

            if (cgd.ShowDialog(this) == DialogResult.OK)
            {

                Program.Settings.SetValue<string>("last_path", cgd.Path);
                if (this.Gump != null && this.Gump.Modified)
                {
                    DialogResult res = MessageBox.Show(this, "Do you wish to save changes to your current gump?", "RunUO: GDK", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);

                    if (res == DialogResult.Cancel)
                    {
                        return;
                    }
                    else if (res == DialogResult.Yes)
                    {
                        this.Gump.Save(Gump.FileName);
                    }
                }

                Gump g = new Gump();
                g.Resolution = cgd.Resolution;
                g.Name = cgd.GumpName;
                //g.FileName = Path.Combine(cgd.Path, g.Name);

                Gump = g;

                Invalidate(true);
            }
        }