public static void LoadCurrentTheme() { StreamReader TextFile = new StreamReader(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\Mod-Loader-Config\ThemeConfig.txt"); string CurrentLine; int IndexOfColour; while ((CurrentLine = TextFile.ReadLine()) != null) { IndexOfColour = CurrentLine.IndexOf("#"); if (CurrentLine.Contains("TitleBarColor: ")) { ThemeMethods.SetTopBarThemeManual(ColorTranslator.FromHtml(CurrentLine.Substring(IndexOfColour))); } else if (CurrentLine.Contains("SideBarColor: ")) { ThemeMethods.SetSideBarThemeManual(ColorTranslator.FromHtml(CurrentLine.Substring(IndexOfColour))); } else if (CurrentLine.Contains("AccentColor: ")) { ThemeMethods.SetThemeAccentManual(ColorTranslator.FromHtml(CurrentLine.Substring(IndexOfColour))); } } TextFile.Dispose(); }
/// <summary> /// Creates an instance of each form, theme the form, add it to the list of opened form and set the Multiple Document Interface parent. /// </summary> public void SetupSwappableScreens() { this.IsMdiContainer = true; ThemeMenu = new ThemeMenuTinyUI(); ThemeMethods.DoThemeAssets(ThemeMenu); Program.OpenedForms.Add(ThemeMenu); ThemeMenu.MdiParent = this; MainMenu = new MainScreen(); ThemeMethods.DoThemeAssets(MainMenu); Program.OpenedForms.Add(MainMenu); MainMenu.MdiParent = this; ControllerScreenOne = new ControllerScreen(); ThemeMethods.DoThemeAssets(ControllerScreenOne); Program.OpenedForms.Add(ControllerScreenOne); ControllerScreenOne.MdiParent = this; TweaksScreen = new TweaksScreen(); ThemeMethods.DoThemeAssets(TweaksScreen); Program.OpenedForms.Add(TweaksScreen); TweaksScreen.MdiParent = this; TweaksIIScreen = new Tweaks_Screen_II(); ThemeMethods.DoThemeAssets(TweaksIIScreen); Program.OpenedForms.Add(TweaksIIScreen); TweaksIIScreen.MdiParent = this; ControllerScreenTwo = new ControllerScreenTwo(); ThemeMethods.DoThemeAssets(ControllerScreenTwo); Program.OpenedForms.Add(ControllerScreenTwo); ControllerScreenTwo.MdiParent = this; AboutMenu = new AboutScreen(); ThemeMethods.DoThemeAssets(AboutMenu); Program.OpenedForms.Add(AboutMenu); AboutMenu.MdiParent = this; ModLoaderControllerScreen = new Controller_Screen_Loader(); ThemeMethods.DoThemeAssets(ModLoaderControllerScreen); Program.OpenedForms.Add(ModLoaderControllerScreen); ModLoaderControllerScreen.MdiParent = this; ThemeMDIClients(); }
/// <summary> /// Sets up all of the aspects of the application which are governed by this form. /// </summary> public void Setup_Application() { // Set reference in Program to this being the main window. Program.xSmallMainWindow = this; // Do not draw an outline on toolstrips! Toolstrip_Bottom.Renderer = new MyToolStrip(); // Set the region of this form to be a rectangle such that the application gains rounded edges. this.Region = System.Drawing.Region.FromHrgn(WinAPIComponents.CreateRoundRectRgn(0, 0, this.Width, this.Height, 30, 30)); // Set the theme controls from which other controls will inherit their colour and theme properties. RedirectThemeValues(); // Automatic theming of all assets in this form. ThemeMethods.DoThemeAssets(this); // Create an instance of each form, theme the form, add it to the list of opened form and set the Multiple Document Interface parent. SetupSwappableScreens(); // Automatically load the application theme. ThemeMethods.AutoLoadCurrentTheme(); // Shows the default menu. Show_Default_Menu(); // If the game is not Sonic Heroes, hide all irrelevant menus. if (!Program.Game_Is_Sonic_Heroes) { Hide_NonSonicHeroes(); } }
private void Btn_Save_Click(object sender, EventArgs e) { ThemeMethods.SaveCurrentTheme(); }
private void Btn_Load_Click(object sender, EventArgs e) { ThemeMethods.LoadCurrentTheme(); }