internal static void LoadCurrentTheme() { if (first) { first = false; } else if (loadedtheme == Manager.GameSettings.CurrentTheme) { return; } if (UIContent != null) { UIContent.Unload(); UIContent.Dispose(); GC.Collect(); } UIContent = new SmartContentManager(Manager.RandomAccessContentManager.ServiceProvider); UIContent.RootDirectory = Manager.RandomAccessContentManager.RootDirectory; string d = GetCurrentThemeDirectory(); TextureFiles = new Dictionary <PrimaryTexture, string>(); foreach (PrimaryTexture t in PrimaryTexture.GetValues(typeof(PrimaryTexture))) { TextureFiles.Add(t, "Textures\\" + d + "\\" + t.ToString()); } LoadTextures(); SoundFiles.Clear(); foreach (SoundType s in SoundType.GetValues(typeof(SoundType))) { SoundFiles.Add(s, "Sounds\\" + d + "\\" + s.ToString()); } LoadSounds(); FontFiles.Clear(); foreach (FontType f in FontType.GetValues(typeof(FontType))) { FontFiles.Add(f, "Fonts\\" + d + "\\" + f.ToString()); } LoadFonts(); loadedtheme = Manager.GameSettings.CurrentTheme; SoundManager.StopAllLoops(); //SoundManager.PlaySound(DataHandler.Sounds[SoundType.Background], SoundCategory.Music, true); Manager.SaveUserDataLocal(); GC.Collect(); }