public void ReloadVolumeLevels() { string cleanPath = SharedContentManager.GetCleanPath(this.CMProvider.Global.RootDirectory + "\\Sounds" + "\\SoundLevels.sdl"); FileStream fileStream; try { fileStream = new FileStream(cleanPath, FileMode.Open, FileAccess.Read); } catch (Exception ex) { if (ex is FileNotFoundException || ex is DirectoryNotFoundException) { Logger.Log("Sound Levels", LogSeverity.Warning, "Could not find levels file, ignoring..."); fileStream = (FileStream)null; } else { Logger.Log("Sound Levels", LogSeverity.Warning, ex.Message); return; } } if (fileStream == null) { this.VolumeLevels = new VolumeLevels(); } else { this.VolumeLevels = SdlSerializer.Deserialize <VolumeLevels>(new StreamReader((Stream)fileStream)); } }
public ContentManager Get(CM name) { SharedContentManager sharedContentManager; if (!this.temporary.TryGetValue(name, out sharedContentManager)) { this.temporary.Add(name, sharedContentManager = new SharedContentManager(((object) name).ToString())); sharedContentManager.RootDirectory = this.global.RootDirectory; } return (ContentManager) sharedContentManager; }
public ContentManager GetForLevel(string levelName) { SharedContentManager sharedContentManager; if (!this.levelScope.TryGetValue(levelName, out sharedContentManager)) { this.levelScope.Add(levelName, sharedContentManager = new SharedContentManager(levelName)); sharedContentManager.RootDirectory = this.global.RootDirectory; } return (ContentManager) sharedContentManager; }
public ContentManager Get(CM name) { SharedContentManager sharedContentManager; if (!this.temporary.TryGetValue(name, out sharedContentManager)) { this.temporary.Add(name, sharedContentManager = new SharedContentManager(((object)name).ToString())); sharedContentManager.RootDirectory = this.global.RootDirectory; } return((ContentManager)sharedContentManager); }
public ContentManager GetForLevel(string levelName) { SharedContentManager sharedContentManager; if (!this.levelScope.TryGetValue(levelName, out sharedContentManager)) { this.levelScope.Add(levelName, sharedContentManager = new SharedContentManager(levelName)); sharedContentManager.RootDirectory = this.global.RootDirectory; } return((ContentManager)sharedContentManager); }
public override void Initialize() { base.Initialize(); SharedContentManager.Preload(); Logger.Log("StaticPreloader", "SharedContentManager preloaded."); this.SoundManager.InitializeLibrary(); Logger.Log("StaticPreloader", "Music library initialized."); this.SoundManager.ReloadVolumeLevels(); Logger.Log("StaticPreloader", "Volume levels loaded."); this.PlayerManager.FillAnimations(); Logger.Log("StaticPreloader", "Animations filled."); TextScroll.PreInitialize(); Logger.Log("StaticPreloader", "Text scroll pre-initialized."); WorldMap.PreInitialize(); Logger.Log("StaticPreloader", "World map pre-initialized."); PauseMenu.PreInitialize(); Logger.Log("StaticPreloader", "Pause menu pre-initialized."); }