private void UpdateColorBoxText() { foreach (KeyValuePair <string, Color> entry in AMLPalette.PresetMap) { if (entry.Value.Equals(AMLPalette.AccentColor)) { accentComboBox.Text = entry.Key; return; } } accentComboBox.Text = AMLUtils.ColorToHTML(AMLPalette.AccentColor); }
public void SyncIndependentConfigToDisk() { var newIndConfig = new IndependentConfig(); if (Program.CommandLineOptions.ServerMode) { newIndConfig.Platform = FirstRecordedIndependentConfigPlatform; } else { newIndConfig.Platform = Platform; } newIndConfig.Theme = AMLPalette.CurrentTheme; newIndConfig.AccentColor = AMLUtils.ColorToHTML(AMLPalette.AccentColor); newIndConfig.CustomBasePath = CustomBasePath; newIndConfig.PlayFabCustomID = PlayFabAPI.CustomID; newIndConfig.PlayFabToken = PlayFabAPI.Token; Directory.CreateDirectory(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "AstroModLoader")); File.WriteAllBytes(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "AstroModLoader", "config.json"), Encoding.UTF8.GetBytes(AMLUtils.SerializeObject(newIndConfig))); }