Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            ApplicationSettings.MapleVersionIndex = versionBox.SelectedIndex;
            ApplicationSettings.MapleFolderIndex  = pathBox.SelectedIndex;
            string wzPath = pathBox.Text;

            if (wzPath == "Select MapleStory Folder")
            {
                MessageBox.Show("Please select the MapleStory folder.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (!ApplicationSettings.MapleFolder.Contains(wzPath) && !IsPathCommon(wzPath))
            {
                ApplicationSettings.MapleFolder = ApplicationSettings.MapleFolder == "" ? wzPath : (ApplicationSettings.MapleFolder + "," + wzPath);
            }
            WzMapleVersion fileVersion;

            /* short version = -1;
             * if (versionBox.SelectedIndex != 3)
             * {
             *   string testFile = File.Exists(Path.Combine(wzPath, "Data.wz")) ? "Data.wz" : "Item.wz";
             *   try
             *   {
             *       fileVersion = WzTool.DetectMapleVersion(Path.Combine(wzPath, testFile), out version);
             *   }
             *   catch (Exception ex)
             *   {
             *       HaRepackerLib.Warning.Error("Error initializing " + testFile + " (" + ex.Message + ").\r\nCheck that the directory is valid and the file is not in use.");
             *       return;
             *   }
             * }
             * else
             * {*/
            if (versionBox.SelectedIndex == 3)
            {
                fileVersion = (WzMapleVersion.GETFROMZLZ);
            }
            else
            {
                fileVersion = (WzMapleVersion)versionBox.SelectedIndex;
            }

            //  }

            InitializeWzFiles(wzPath, fileVersion);

            Hide();
            Application.DoEvents();
            editor = new HaEditor();

            editor.ShowDialog();
            Application.Exit();
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            ApplicationSettings.MapleVersionIndex = versionBox.SelectedIndex;
            ApplicationSettings.MapleFolderIndex = pathBox.SelectedIndex;
            string wzPath = pathBox.Text;
            if (wzPath == "Select Maple Folder")
            {
                MessageBox.Show("Please select the maple folder.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (!ApplicationSettings.MapleFolder.Contains(wzPath) && !IsPathCommon(wzPath))
            {
                ApplicationSettings.MapleFolder = ApplicationSettings.MapleFolder == "" ? wzPath : (ApplicationSettings.MapleFolder + "," + wzPath);
            }
            WzMapleVersion fileVersion;
            short version = -1;
            if (versionBox.SelectedIndex == 3)
            {
                string testFile = File.Exists(Path.Combine(wzPath, "Data.wz")) ? "Data.wz" : "Item.wz";
                try
                {
                    fileVersion = WzTool.DetectMapleVersion(Path.Combine(wzPath, testFile), out version);
                }
                catch (Exception ex)
                {
                    HaRepackerLib.Warning.Error("Error initializing " + testFile + " (" + ex.Message + ").\r\nCheck that the directory is valid and the file is not in use.");
                    return;
                }
            }
            else
            {
                fileVersion = (WzMapleVersion)versionBox.SelectedIndex;
            }

            InitializeWzFiles(wzPath, fileVersion);

            Hide();
            Application.DoEvents();
            editor = new HaEditor();
            editor.ShowDialog();
            Application.Exit();
        }