public static void RemoveMap(Player p, string map, LevelConfig lvlCfg, RoundsGame game) { RoundsGameConfig cfg = game.GetConfig(); string coloredName = lvlCfg.Color + map; if (!cfg.Maps.CaselessRemove(map)) { p.Message("{0} &Swas not in the list of {1} maps", coloredName, game.GameName); } else { p.Message("Removed {0} &Sfrom the list of {1} maps", coloredName, game.GameName); lvlCfg.AutoUnload = true; if (!cfg.AllowAutoload) { lvlCfg.LoadOnGoto = true; } cfg.Save(); lvlCfg.SaveFor(map); OnMapsChangedEvent.Call(game); } }
public static void AddMap(Player p, string map, LevelConfig lvlCfg, RoundsGame game) { RoundsGameConfig cfg = game.GetConfig(); string coloredName = lvlCfg.Color + map; if (cfg.Maps.CaselessContains(map)) { p.Message("{0} &Sis already in the list of {1} maps", coloredName, game.GameName); } else { p.Message("Added {0} &Sto the list of {1} maps", coloredName, game.GameName); cfg.Maps.Add(map); if (!cfg.AllowAutoload) { lvlCfg.LoadOnGoto = false; } cfg.Save(); lvlCfg.SaveFor(map); OnMapsChangedEvent.Call(game); } }