Пример #1
0
 public static void Voice_BGM_Name_Change_From_FSB(string Dir_Path)
 {
     if (!Directory.Exists(Dir_Path))
     {
         return;
     }
     if (Voice_BGM_Change_List.Count == 0)
     {
         Voice_BGM_Change_List_Init();
     }
     string[] To_File_Name = { "mikata", "danyaku",        "hikantuu",   "kantuu",     "tokusyu",      "tyoudan",     "syatyou",       "souzyuusyu",    "tekikasai", "gekiha",     "enjinhason", "enjintaiha", "enjinhukkyuu"
                               ,         "kasai",          "syouka",     "nenryou",    "housinhason",  "housintaiha", "housinhukkyuu", "housyu",        "soutensyu", "musen",      "musensyu",   "battle",     "kansokuhason", "kansokutaiha"
                               ,         "kansokuhukkyuu", "ritaihason", "ritaitaiha", "ritaihukkyuu", "houtouhason", "houtoutaiha",   "houtouhukkyuu", "taiha",     "battle_bgm", "reload",     "touzyouin" };
     string[] Files = Directory.GetFiles(Dir_Path, "*.wav", SearchOption.TopDirectoryOnly);
     foreach (string File_Now in Files)
     {
         string Name      = "";
         string Name_Only = Path.GetFileNameWithoutExtension(File_Now);
         if (Name_Only.Contains(" ("))
         {
             Name = Name_Only.Substring(0, Name_Only.LastIndexOf('(') - 1);
             Name = Name.Trim();
         }
         else if (Name_Only.Contains("_"))
         {
             Name = Name_Only.Substring(0, Name_Only.LastIndexOf('_'));
             Name = Name.Trim();
         }
         if (Name == "")
         {
             continue;
         }
         for (int Number = 0; Number < 37; Number++)
         {
             foreach (string Voice_Name in Voice_BGM_Change_List[Number])
             {
                 if (Name.Contains(Voice_Name))
                 {
                     if (Number == 36)
                     {
                         File.Copy(File_Now, Sub_Code.File_Rename_Get_Name(Path.GetDirectoryName(File_Now) + "\\syatyou") + ".wav", true);
                         File.Copy(File_Now, Sub_Code.File_Rename_Get_Name(Path.GetDirectoryName(File_Now) + "\\souzyuusyu") + ".wav", true);
                         File.Copy(File_Now, Sub_Code.File_Rename_Get_Name(Path.GetDirectoryName(File_Now) + "\\housyu") + ".wav", true);
                         File.Copy(File_Now, Sub_Code.File_Rename_Get_Name(Path.GetDirectoryName(File_Now) + "\\housyu") + ".wav", true);
                         File.Copy(File_Now, Sub_Code.File_Rename_Get_Name(Path.GetDirectoryName(File_Now) + "\\soutensyu") + ".wav", true);
                         Sub_Code.File_Move(File_Now, Sub_Code.File_Rename_Get_Name(Path.GetDirectoryName(File_Now) + "\\musensyu") + ".wav", true);
                         continue;
                     }
                     Sub_Code.File_Rename_Number(File_Now, To_File_Name[Number]);
                 }
             }
         }
     }
 }
Пример #2
0
        public static void DVPL_UnPack(string From_File, string To_File, bool IsFromFileDelete)
        {
            if (!File.Exists(From_File))
            {
                return;
            }
            File.Copy(From_File, Voice_Set.Special_Path + "/DVPL/Temp_Unpack.tmp.dvpl", true);
            StreamWriter DVPL_Unpack = File.CreateText(Voice_Set.Special_Path + "/DVPL/UnPack.bat");

            DVPL_Unpack.WriteLine("chcp 65001");
            DVPL_Unpack.Write("\"" + Voice_Set.Special_Path + "/DVPL/DVPL_Extract.exe\"");
            DVPL_Unpack.Close();
            ProcessStartInfo processStartInfo = new ProcessStartInfo
            {
                FileName               = Voice_Set.Special_Path + "/DVPL/UnPack.bat",
                CreateNoWindow         = true,
                RedirectStandardInput  = true,
                RedirectStandardOutput = true,
                WorkingDirectory       = Voice_Set.Special_Path + "/DVPL",
                UseShellExecute        = false
            };

            p = Process.Start(processStartInfo);
            p.StandardInput.WriteLine("\r\n");
            p.OutputDataReceived += new DataReceivedEventHandler(WriteMessage);
            p.BeginOutputReadLine();
            p.WaitForExit();
            p.Close();
            p.Dispose();
            try
            {
                Sub_Code.File_Move(Voice_Set.Special_Path + "/DVPL/Temp_Unpack.tmp", To_File, true);
                if (IsFromFileDelete)
                {
                    File.Delete(From_File);
                }
            }
            catch (Exception e)
            {
                //dvplが解除されなかった場合
                Sub_Code.Error_Log_Write(e.Message);
            }
            File.Delete(Voice_Set.Special_Path + "/DVPL/UnPack.bat");
        }
Пример #3
0
        public static int DVPL_UnPack(List <string> From_Files, bool IsFromFileDelete)
        {
            if (From_Files.Count == 0)
            {
                return(0);
            }
            List <int> File_Numbers = new List <int>();

            for (int Number = 0; Number < From_Files.Count; Number++)
            {
                if (File.Exists(From_Files[Number]) && Path.GetExtension(From_Files[Number]) == ".dvpl")
                {
                    File.Copy(From_Files[Number], Voice_Set.Special_Path + "/DVPL/" + Number + ".tmp.dvpl", true);
                    File_Numbers.Add(Number);
                }
            }
            if (File_Numbers.Count == 0)
            {
                return(0);
            }
            StreamWriter DVPL_Unpack = File.CreateText(Voice_Set.Special_Path + "/DVPL/UnPack.bat");

            DVPL_Unpack.WriteLine("chcp 65001");
            DVPL_Unpack.Write("\"" + Voice_Set.Special_Path + "/DVPL/DVPL_Extract.exe\"");
            DVPL_Unpack.Close();
            ProcessStartInfo processStartInfo = new ProcessStartInfo
            {
                FileName               = Voice_Set.Special_Path + "/DVPL/UnPack.bat",
                CreateNoWindow         = true,
                RedirectStandardInput  = true,
                RedirectStandardOutput = true,
                WorkingDirectory       = Voice_Set.Special_Path + "/DVPL",
                UseShellExecute        = false
            };

            p = Process.Start(processStartInfo);
            p.StandardInput.WriteLine("\r\n");
            p.OutputDataReceived += new DataReceivedEventHandler(WriteMessage);
            p.BeginOutputReadLine();
            p.WaitForExit();
            p.Close();
            p.Dispose();
            int Move_Count = 0;

            foreach (int Number in File_Numbers)
            {
                if (Sub_Code.File_Move(Voice_Set.Special_Path + "/DVPL/" + Number + ".tmp", Path.GetDirectoryName(From_Files[Number]) + "\\" + Path.GetFileNameWithoutExtension(From_Files[Number]), true))
                {
                    Move_Count++;
                    if (IsFromFileDelete)
                    {
                        try
                        {
                            File.Delete(From_Files[Number]);
                        }
                        catch
                        {
                        }
                    }
                }
                else if (File.Exists(Voice_Set.Special_Path + "/DVPL/" + Number + ".tmp"))
                {
                    try
                    {
                        File.Delete(Voice_Set.Special_Path + "/DVPL/" + Number + ".tmp");
                    }
                    catch
                    {
                    }
                }
            }
            File.Delete(Voice_Set.Special_Path + "/DVPL/UnPack.bat");
            return(Move_Count);
        }
Пример #4
0
 public static void Set_SE_Change_Name(string Project_SE_Dir)
 {
     if (SE_Enable_Disable[0])
     {
         Sub_Code.File_Move(Project_SE_Dir + "/Capture_Finish_SE.wav", Project_SE_Dir + "/Capture_Finish_SE_tmp.wav", true);
     }
     else
     {
         Sub_Code.File_Move(Project_SE_Dir + "/Capture_Finish_SE_tmp.wav", Project_SE_Dir + "/Capture_Finish_SE.wav", true);
     }
     if (SE_Enable_Disable[1])
     {
         Sub_Code.File_Move(Project_SE_Dir + "/quick_commands_attack.wav", Project_SE_Dir + "/quick_commands_attack_tmp.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/quick_commands_attack_target.wav", Project_SE_Dir + "/quick_commands_attack_target_tmp.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/quick_commands_capture_base.wav", Project_SE_Dir + "/quick_commands_capture_base_tmp.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/quick_commands_positive.wav", Project_SE_Dir + "/quick_commands_positive_tmp.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/quick_commands_defend_base.wav", Project_SE_Dir + "/quick_commands_defend_base_tmp.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/quick_commands_help_me.wav", Project_SE_Dir + "/quick_commands_help_me_tmp.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/quick_commands_negative.wav", Project_SE_Dir + "/quick_commands_negative_tmp.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/quick_commands_reloading.wav", Project_SE_Dir + "/quick_commands_reloading_tmp.wav", true);
     }
     else
     {
         Sub_Code.File_Move(Project_SE_Dir + "/quick_commands_attack_tmp.wav", Project_SE_Dir + "/quick_commands_attack.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/quick_commands_attack_target_tmp.wav", Project_SE_Dir + "/quick_commands_attack_target.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/quick_commands_capture_base_tmp.wav", Project_SE_Dir + "/quick_commands_capture_base.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/quick_commands_positive_tmp.wav", Project_SE_Dir + "/quick_commands_positive.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/quick_commands_defend_base_tmp.wav", Project_SE_Dir + "/quick_commands_defend_base.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/quick_commands_help_me_tmp.wav", Project_SE_Dir + "/quick_commands_help_me.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/quick_commands_negative_tmp.wav", Project_SE_Dir + "/quick_commands_negative.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/quick_commands_reloading_tmp.wav", Project_SE_Dir + "/quick_commands_reloading.wav", true);
     }
     if (SE_Enable_Disable[6])
     {
         Sub_Code.File_Move(Project_SE_Dir + "/Musenki_01.wav", Project_SE_Dir + "/Musenki_01_temp.wav", true);
     }
     else
     {
         Sub_Code.File_Move(Project_SE_Dir + "/Musenki_01_temp.wav", Project_SE_Dir + "/Musenki_01.wav", true);
     }
     if (SE_Enable_Disable[9])
     {
         Sub_Code.File_Move(Project_SE_Dir + "/howitzer_load_01.wav", Project_SE_Dir + "/howitzer_load_01_tmp.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/howitzer_load_03.wav", Project_SE_Dir + "/howitzer_load_03_tmp.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/howitzer_load_04.wav", Project_SE_Dir + "/howitzer_load_04_tmp.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/howitzer_load_05.wav", Project_SE_Dir + "/howitzer_load_05_tmp.wav", true);
     }
     else
     {
         Sub_Code.File_Move(Project_SE_Dir + "/howitzer_load_01_tmp.wav", Project_SE_Dir + "/howitzer_load_01.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/howitzer_load_03_tmp.wav", Project_SE_Dir + "/howitzer_load_03.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/howitzer_load_04_tmp.wav", Project_SE_Dir + "/howitzer_load_04.wav", true);
         Sub_Code.File_Move(Project_SE_Dir + "/howitzer_load_05_tmp.wav", Project_SE_Dir + "/howitzer_load_05.wav", true);
     }
     if (SE_Enable_Disable[10])
     {
         Sub_Code.File_Move(Project_SE_Dir + "/lamp_SE_01.wav", Project_SE_Dir + "/lamp_SE_01_tmp.wav", true);
     }
     else
     {
         Sub_Code.File_Move(Project_SE_Dir + "/lamp_SE_01_tmp.wav", Project_SE_Dir + "/lamp_SE_01.wav", true);
     }
     if (SE_Enable_Disable[11])
     {
         Sub_Code.File_Move(Project_SE_Dir + "/enemy_sight.wav", Project_SE_Dir + "/enemy_sight_tmp.wav", true);
     }
     else
     {
         Sub_Code.File_Move(Project_SE_Dir + "/enemy_sight_tmp.wav", Project_SE_Dir + "/enemy_sight.wav", true);
     }
     if (SE_Enable_Disable[12])
     {
         Sub_Code.File_Move(Project_SE_Dir + "/Timer_SE.wav", Project_SE_Dir + "/Timer_SE_tmp.wav", true);
     }
     else
     {
         Sub_Code.File_Move(Project_SE_Dir + "/Timer_SE_tmp.wav", Project_SE_Dir + "/Timer_SE.wav", true);
     }
     if (SE_Enable_Disable[13])
     {
         Sub_Code.File_Move(Project_SE_Dir + "/target_on_SE_01.wav", Project_SE_Dir + "/target_on_SE_01_tmp.wav", true);
     }
     else
     {
         Sub_Code.File_Move(Project_SE_Dir + "/target_on_SE_01_tmp.wav", Project_SE_Dir + "/target_on_SE_01.wav", true);
     }
     if (SE_Enable_Disable[14])
     {
         Sub_Code.File_Move(Project_SE_Dir + "/target_off_SE_01.wav", Project_SE_Dir + "/target_off_SE_01_tmp.wav", true);
     }
     else
     {
         Sub_Code.File_Move(Project_SE_Dir + "/target_off_SE_01_tmp.wav", Project_SE_Dir + "/target_off_SE_01.wav", true);
     }
 }