public static void LoadCurrentTheme() { StreamReader TextFile = new StreamReader(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\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(); }
public void InitializeSystem() { SplashLoader.xSetPercentage(10); SplashLoader.xSetMessage("Loading 1/6..."); Program.xSmallMainWindow = this; SplashLoader.xSetPercentage(15); Toolstrip_Bottom.Renderer = new MyToolStrip(); // Do not draw an outline on toolstrips! SplashLoader.xSetPercentage(20); this.Region = System.Drawing.Region.FromHrgn(WinAPIComponents.CreateRoundRectRgn(0, 0, this.Width, this.Height, 30, 30)); // Rounded edges! SplashLoader.xSetPercentage(30); SplashLoader.xSetMessage("Loading 2/6..."); Program.xFonts.SetupMainWindow(this); // Call SetupFonts in xFonts object. ButtonColour = Color.FromArgb(232, 234, 246); // Set the button default colour to the background colour of the light control buttons. SplashLoader.xSetPercentage(40); SplashLoader.xSetMessage("Loading 3/6..."); /// Set local theme overrides! RedirectThemeValues(); // Must preceede following. ThemeMethods.DoThemeAssets(this); // Automatically theme assets! SplashLoader.xSetPercentage(50); SplashLoader.xSetMessage("Loading 4/6..."); SetupSwappableScreens(); // If using Swappable forms! ThemeMethods.AutoLoadCurrentTheme(); // Automatically theme the world! //ShowWelcomeScreen(); // Show the welcome screen! ShowOptionsMenu(); // Show the default options menu. DirectInputDevicesHook.PlayerControllers = DirectInputDevicesHook.GetJoySticks(); // Setup Gamepads! DirectInputDevicesHook.SetupGamePadTick(); // Setup Gamepad Ticks! SplashLoader.xSetPercentage(70); SplashLoader.xSetMessage("Loading 5/6..."); LoadHeroesSettings(); SplashLoader.xSetMessage("Loading 6/6..."); SplashLoader.xSetPercentage(100); SplashLoader.UpdateStatusCircleComplete = true; }
/// /// Sets up swappable screens! /// 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 TweaksScreen2(); 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; ThemeMDIClients(); }
private void Btn_Save_Click(object sender, EventArgs e) { ThemeMethods.SaveCurrentTheme(); }
private void Btn_Load_Click(object sender, EventArgs e) { ThemeMethods.LoadCurrentTheme(); }