Example #1
0
 private static void BeginRefresh()
 {
     if (!ReplaceClass.refreshWorker.IsBusy)
     {
         ReplaceClass.SetControlState(ReplaceStates.Refresh);
         BackgroundWorker backgroundWorker = ReplaceClass.refreshWorker;
         object[]         text             = new object[] { ReplaceClass.mainForm.txtOutputFolder.Text, null };
         bool[]           @checked         = new bool[] { ReplaceClass.mainForm.chkReplaceJinM.Checked, ReplaceClass.mainForm.chkReplaceJinF.Checked, ReplaceClass.mainForm.chkReplaceGonM.Checked, ReplaceClass.mainForm.chkReplaceGonF.Checked, ReplaceClass.mainForm.chkReplaceLynM.Checked, ReplaceClass.mainForm.chkReplaceLynF.Checked, ReplaceClass.mainForm.chkReplaceKunN.Checked, ReplaceClass.mainForm.chkReplaceOther.Checked };
         text[1] = @checked;
         backgroundWorker.RunWorkerAsync(text);
     }
 }
Example #2
0
        private static void mainForm_DoOperation(object sender, OperationEventArgs e)
        {
            if ((e.Operation != Operations.LeaveSettings ? true : Directory.Exists(ReplaceClass.mainForm.txtModelFolder.Text)))
            {
                switch (e.Operation)
                {
                case Operations.LeaveSettings:
                case Operations.RefreshReplaceList:
                {
                    ReplaceClass.TryCancelRefresh();
                    ReplaceClass.BeginRefresh();
                    break;
                }

                case Operations.RefreshAnalysisList:
                case Operations.CancelRefreshanalysisList:
                case Operations.BeginAnalysis:
                case Operations.CancelAnalysis:
                case Operations.DragAnalysis:
                case Operations.CurrentAnalysis:
                case Operations.ManualAction:
                {
                    ReplaceClass.SetControlState(ReplaceStates.OtherWork);
                    break;
                }

                case Operations.BeginReplace:
                {
                    ReplaceClass.BeginReplace();
                    break;
                }

                case Operations.CancelReplace:
                {
                    ReplaceClass.TryCancelReplace();
                    break;
                }

                case Operations.None:
                {
                    ReplaceClass.SetControlState(ReplaceStates.None);
                    break;
                }
                }
            }
        }
Example #3
0
 private static void BeginReplace()
 {
     if (ReplaceClass.mainForm.picSourceImage.Tag == null)
     {
         MessageBox.Show("Please set the source model.");
     }
     else if (ReplaceClass.mainForm.picTargetImage.Tag != null)
     {
         string str  = ReplaceClass.mainForm.picSourceImage.Tag.ToString();
         string str1 = ReplaceClass.mainForm.picTargetImage.Tag.ToString();
         if (str != str1)
         {
             string str2 = Path.Combine(Application.StartupPath, "umodel.exe");
             if (!File.Exists(str2))
             {
                 MessageBox.Show(string.Concat("\"", str2, "\"does not exist\"http://www.gildor.org/en/projects/umodel\"Download site UEViewer program and copy all the files to the Program folder."));
             }
             else if (MessageBox.Show(
                          //"是否Start自动模型转换?错误的转换可能导致下列问题:\n\n1、源模型与目标模型种类不同,进到游戏有读取人物模型时会报错退出。\n2、按照已研究出来的规律仍无法解析对照规则,需要用户自己点击“去手动转换”按钮进行手动转换。"
                          "Start automatic model transformation? Conversion error may cause the following problems:\n\n1、Source model and the target model of different types,There would be an error into the will game stop reading character models。\n2、Has come up in accordance with the law still does not parse the control rules,Require the user to click“Go to manual conversion”Button manual conversion."
                          , "Ask before convert", MessageBoxButtons.OKCancel) == DialogResult.OK)
             {
                 ReplaceClass.mainForm.btnReplaceModel.Text = "Cancel";
                 ReplaceClass.SetControlState(ReplaceStates.Build);
                 ReplaceClass.mainForm.pbReplace.Style = ProgressBarStyle.Marquee;
                 BackgroundWorker backgroundWorker = ReplaceClass.replaceWorker;
                 object[]         text             = new object[] { str, str1, str2, ReplaceClass.mainForm.txtOutputFolder.Text, ReplaceClass.mainForm.txtModelFolder.Text, ReplaceClass.mainForm.rbSetup.Checked };
                 backgroundWorker.RunWorkerAsync(text);
             }
         }
         else
         {
             MessageBox.Show("Source and target are the same,Can not be replaced");
         }
     }
     else
     {
         MessageBox.Show("Please set the target model.");
     }
 }