/// <summary> /// Saves or overrides a build color set with current build colors. /// </summary> /// <param name="name">The name of the build color set.</param> private void SaveColorSet(string name) { var set = new ColorSet { Name = name }; if (ColorSets.Contains(set)) { ColorSets.Remove(set); } set.Colors = MyAPIGateway.Session.LocalHumanPlayer.BuildColorSlots.Select(x => (Color)x).ToArray(); ColorSets.Add(set); SaveColorSets(); MyAPIGateway.Utilities.ShowMessage(NAME, string.Format(ModText.ColorSetSaved.GetString(), name)); }
/// <summary> /// Removes a Color Set with given name. /// </summary> /// <param name="name">The name of the color set.</param> private void RemoveColorSet(string name) { var set = new ColorSet { Name = name }; if (!ColorSets.Contains(set)) { MyAPIGateway.Utilities.ShowMessage(NAME, string.Format(ModText.NoColorSetFound.GetString(), name)); return; } ColorSets.Remove(set); SaveColorSets(); MyAPIGateway.Utilities.ShowMessage(NAME, string.Format(ModText.ColorSetRemoved.GetString(), name)); }