From 4aba920f1de6d5caec8ae0eb886a6edd6fbfe3a2 Mon Sep 17 00:00:00 2001 From: lilium-saber Date: Fri, 10 Nov 2023 16:00:44 +0800 Subject: [PATCH] 0 Signed-off-by: lilium-saber --- ...pulatedInThisFileAndCallThroughFunction.cs | 7 +++++++ src/ScnToJson/TranslationScnToJson.cs | 21 ++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/AllClassAndInterfaceWellBeManipulatedInThisFileAndCallThroughFunction.cs b/src/AllClassAndInterfaceWellBeManipulatedInThisFileAndCallThroughFunction.cs index f85f544..93e7333 100644 --- a/src/AllClassAndInterfaceWellBeManipulatedInThisFileAndCallThroughFunction.cs +++ b/src/AllClassAndInterfaceWellBeManipulatedInThisFileAndCallThroughFunction.cs @@ -56,10 +56,17 @@ namespace WpfApp2.tools { scnjson.StopTrans(spa, dps); } + + public void StartTranslateJsonToScn(string spaJson,string spaGame, string dpsScn)//写文件夹路径 + { + scnjson.JsonToScn(spaJson, spaGame, dpsScn); + } + public string NetBaiDu(string input) { return jsonnet.RequestJsonBaiDu(input); } + public string NetBaiDu(string input, List list) { return jsonnet.RequestJsonBaiDu(input, list); diff --git a/src/ScnToJson/TranslationScnToJson.cs b/src/ScnToJson/TranslationScnToJson.cs index d16e562..913a286 100644 --- a/src/ScnToJson/TranslationScnToJson.cs +++ b/src/ScnToJson/TranslationScnToJson.cs @@ -34,7 +34,7 @@ namespace WpfApp2.ScnToJson public void DirExsis(string id) { - if(!Directory.Exists(Directory.GetCurrentDirectory() + "\\" + id)) + if (Directory.Exists(Directory.GetCurrentDirectory() + "\\" + id)) { Directory.CreateDirectory(Directory.GetCurrentDirectory() + "\\" + id); } @@ -59,6 +59,25 @@ namespace WpfApp2.ScnToJson p.Close(); } + public void JsonToScn(string srcgame, string srcjson, string dstgame) + { + string temp = ".\\VNTextPatch insertlocal " + srcgame + " " + srcjson + " " + dstgame; + + var p = new Process + { + StartInfo = + { + FileName = "PowerShell.exe", + Arguments = "/c " + cmdHandle + "\n" + temp, + UseShellExecute = false, + CreateNoWindow = false, + } + }; + + p.Start(); + p.WaitForExit(); + p.Close(); + }