mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-22 12:03:04 +00:00
extract function
This commit is contained in:
parent
4c03c5f33f
commit
5e82124a2f
1 changed files with 9 additions and 4 deletions
|
@ -262,9 +262,8 @@ namespace SanAndreasUnity.Behaviours
|
|||
|
||||
}
|
||||
|
||||
private static void StepLoadArchives ()
|
||||
{
|
||||
|
||||
public static void CheckIfGamePathIsCorrect(string gamePath)
|
||||
{
|
||||
string[] directoriesToCheck = { "models", "data" };
|
||||
|
||||
foreach (string directoryToCheck in directoriesToCheck)
|
||||
|
@ -276,10 +275,16 @@ namespace SanAndreasUnity.Behaviours
|
|||
directoryToCheck.ToUpperInvariant(),
|
||||
};
|
||||
|
||||
if (caseVariations.All(d => !Directory.Exists(Path.Combine(Config.GamePath, d))))
|
||||
if (caseVariations.All(d => !Directory.Exists(Path.Combine(gamePath, d))))
|
||||
throw new System.Exception($"Game folder seems to be invalid - failed to find '{directoryToCheck}' folder inside game folder");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void StepLoadArchives ()
|
||||
{
|
||||
CheckIfGamePathIsCorrect(Config.GamePath);
|
||||
|
||||
ArchiveManager.LoadLooseArchive(Config.GamePath);
|
||||
|
||||
foreach (string imgFilePath in ArchiveManager.GetFilePathsFromLooseArchivesWithExtension(".img"))
|
||||
|
|
Loading…
Reference in a new issue