예제 #1
0
        public ProcessFactory()
        {
            var binaryPath = GameFinder.FindGameDir();

            this.GameExecutablePath   = Path.Combine(binaryPath, "HatinTimeGame.exe");
            this.EditorExecutablePath = Path.Combine(binaryPath, "HatinTimeEditor.exe");
        }
예제 #2
0
        public static string FindPackage(string name)
        {
            var lookupA = Directory.GetFiles(GameFinder.GetEditorCookedPcDir(), name + ".upk", SearchOption.AllDirectories);

            if (lookupA.Length > 0)
            {
                return(lookupA.First());
            }

            var lookupB = Directory.GetFiles(GameFinder.GetModsDir(), name + ".upk", SearchOption.AllDirectories);

            if (lookupB.Length > 0)
            {
                return(lookupB.First());
            }

            var lookupC = Directory.GetFiles(GameFinder.GetWorkshopDir(), name + ".upk", SearchOption.AllDirectories);

            return(lookupC.First());
        }
예제 #3
0
        public bool Export(string package, string assetName, ExportType exportType, string destination)
        {
            var tmpDir = GetTMPDir();

            if (Directory.Exists(tmpDir))
            {
                Directory.Delete(tmpDir, true);
            }
            Directory.CreateDirectory(tmpDir);

            // .\umodel.exe -game=ue3 -path="C:\Program Files (x86)\Steam\steamapps\common\HatinTime\HatinTimeGame\EditorCookedPC" -export HatinTime_Music_Metro4 Act_4_Pink_Paw_Station -sounds -out=".\test"
            var res = Run($"-game=ue3 -path=\"{GameFinder.GetEditorCookedPcDir()}\" -3rdparty -export {package} {assetName}{(exportType == ExportType.SoundNodeWave ? " -sounds" : "")} -out=\"{tmpDir}\"");

            if (!res)
            {
                return(false);
            }

            var extension = GetExtensionForType(exportType);

            var path = Path.Combine(tmpDir, package, exportType.ToString(), assetName + extension);

            Debug.WriteLine("ExceptedPath: " + path);

            if (File.Exists(path))
            {
                if (File.Exists(destination))
                {
                    File.Delete(destination);
                }
                File.Move(path, destination);
                return(true);
            }

            return(false);
        }
예제 #4
0
 public static string FindPackage(string name)
 {
     return(Directory.GetFiles(GameFinder.GetEditorCookedPcDir(), name + ".upk", SearchOption.AllDirectories).First());
 }