internal override void MoveCustomResources(string newFolder) { base.MoveCustomResources(newFolder); newFolder = CAssetRegistry.SanitizeAssetPath(newFolder); string currentImagePath = ProjectDefinitions.GetAbsolutePath(DDSImagePath); string newAbsoluteImagePath = ProjectDefinitions.GetAbsolutePath(newFolder + Name + ".dds"); if (currentImagePath != newAbsoluteImagePath) { if (File.Exists(currentImagePath)) { File.Move(currentImagePath, newAbsoluteImagePath); } DDSImagePath = ProjectDefinitions.GetRelativePath(newAbsoluteImagePath); } }
public static void LoadInstance() { string registryFilename = ProjectDefinitions.GetAbsolutePath(REGISTRY_FILEPATH); if (File.Exists(registryFilename)) { Dictionary <Guid, string> loadedFileMap = CAssetSerializer.Instance.DeserializeObject <Dictionary <Guid, string> >(File.ReadAllText(registryFilename)); // Validate asset entries for their files to exist loadedFileMap = loadedFileMap.Where(pair => File.Exists(ProjectDefinitions.GetAbsolutePath(pair.Value))).ToDictionary(p => p.Key, p => p.Value); Instance.m_assetFileMap = new BiDictionary <Guid, string>(loadedFileMap); } else { Instance = new CAssetRegistry(); } EngineBaseContentLoader.LoadBaseContent(); }