示例#1
0
        private static void Compile(string s, ushort version, uint?key, PsbSpec?spec, bool canRename,
                                    bool canPackShell)
        {
            if (!File.Exists(s))
            {
                //此処にいて何処にもいない キミの面影はいつも朧 : https://soundcloud.com/yuhyuhyuhxibbd2/parallel-utau
                return;
            }

            var name = Path.GetFileNameWithoutExtension(s);
            var ext  = Path.GetExtension(s);

            Console.WriteLine($"Compiling {name} ...");
            try
            {
                //var filename = name + (_key == null ? _noRename ? ".psb" : "-pure.psb" : "-impure.psb");
                var filename = name + ".psb";
                PsbCompiler.CompileToFile(s, filename, null, version, key, spec, canRename,
                                          canPackShell);
            }
            catch (Exception e)
            {
                Console.WriteLine($"Compile {name} failed.\r\n{e}");
            }

            Console.WriteLine($"Compile {name} succeed.");
        }
示例#2
0
        public void TestCompileWin()
        {
            var resPath = Path.Combine(Environment.CurrentDirectory, @"..\..\Res");
            //var path = Path.Combine(resPath, "D愛子a_春服-pure.psb.json");
            var path = Path.Combine(resPath, "dx_れいなh1a1.psb.json");

            PsbCompiler.CompileToFile(path, path + ".psbuild.psb", null, 4, null, PsbSpec.win);
        }
示例#3
0
        public void TestCompileKrkr()
        {
            var resPath = Path.Combine(Environment.CurrentDirectory, @"..\..\Res");
            //var path = Path.Combine(resPath, "澄怜a_裸.psb-pure.psb.json");
            var path = Path.Combine(resPath, "e-mote38_KRKR-pure.psb.json");

            PsbCompiler.CompileToFile(path, path + ".psbuild.psb", null, 4, null, PsbSpec.win);
        }
示例#4
0
        public void TestCompileMenuPsb()
        {
            var resPath = Path.Combine(Environment.CurrentDirectory, @"..\..\Res");

            var path = Path.Combine(resPath, "title.psb.json");

            PsbCompiler.CompileToFile(path, path + ".psbuild.psb", null, 2);
        }
示例#5
0
        public void TestCompileCommon()
        {
            var resPath = Path.Combine(Environment.CurrentDirectory, @"..\..\Res");
            var path    = Path.Combine(resPath, "emote396-a8l8.pure.json");
            var path2   = Path.Combine(resPath, "emote396-a8l8.pure.psb");
            var psb     = PsbCompiler.LoadPsbFromJsonFile(path);
            var psb2    = new PSB(path2);

            //File.WriteAllBytes("396.psb", psb.Build());
            PsbCompiler.CompileToFile(path, path + ".psbuild.psb", null, 4, null, PsbSpec.win);
        }
示例#6
0
        private static void Compile(string s)
        {
            var name = Path.GetFileNameWithoutExtension(s);
            var ext  = Path.GetExtension(s);

            Console.WriteLine($"Compiling {name} ...");
            try
            {
                PsbCompiler.CompileToFile(s, s + (_key == null ? "-pure.psb" : ".psb"), null, _version, _key, _platform);
            }
            catch (Exception e)
            {
                Console.WriteLine($"Compile {name} failed.\r\n{e}");
            }
            Console.WriteLine($"Compile {name} succeed.");
        }
示例#7
0
        // 적용 버튼
        private void button2_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog openFile = new OpenFileDialog())
            {
                openFile.Title       = "적용할 SCN 파일을 선택해주세요. (다중 선택 가능)";
                openFile.DefaultExt  = "scn";
                openFile.Filter      = "SCN 파일 (*.scn)|*.scn;";
                openFile.Multiselect = true;

                if (openFile.ShowDialog() == DialogResult.OK)
                {
                    progressBar1.Value   = 0;
                    progressBar1.Maximum = openFile.FileNames.Length;
                    label2.Text          = $"0/{progressBar1.Maximum}";

                    foreach (var file in openFile.FileNames)
                    {
                        string json = file.Substring(0, file.Length - 3) + "json";
                        Apply(json);

                        progressBar1.PerformStep();
                        label2.Text = $"{progressBar1.Value}/{progressBar1.Maximum}";
                    }

                    progressBar1.Value = 0;

                    foreach (var file in openFile.FileNames)
                    {
                        string json = file.Substring(0, file.Length - 3) + "json";

                        PsbCompiler.CompileToFile(json, json, null, null, null, null);
                        var purescn = file.Substring(0, file.Length - 3) + "pure.scn";

                        File.Delete(file);
                        File.Move(purescn, file);

                        progressBar1.PerformStep();
                        label2.Text = $"{progressBar1.Value}/{progressBar1.Maximum}";
                    }
                }
            }
        }