Example #1
0
        public virtual List <string> GetCandidateMaps(RoundsGame game)
        {
            List <string> maps = new List <string>(game.GetConfig().Maps);

            if (maps.Count < minMaps)
            {
                Logger.Log(LogType.Warning, "You must have 3 or more maps configured to change levels in " + game.GameName);
                return(null);
            }
            return(maps);
        }
Example #2
0
        public override void Load(bool startup)
        {
            cmd = new CmdNameOfGamemode();
            Command.Register(cmd);

            RoundsGame game = NOGGame.Instance;

            game.GetConfig().Load();
            if (!game.Running)
            {
                game.AutoStart();
            }
        }
Example #3
0
        public virtual List <string> GetCandidateMaps(RoundsGame game)
        {
            List <string> maps = new List <string>(game.GetConfig().Maps);

            // TODO: Should this instead be
            // if (maps.Count < 3) {
            //     Logger.Log(LogType.Warning, "You must have more than 3 maps to change levels in " + game.GameName);

            if (maps.Count == 0)
            {
                Logger.Log(LogType.Warning, "You must have at least 1 level configured to play " + game.GameName);
                return(null);
            }
            return(maps);
        }
Example #4
0
        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);
            }
        }
Example #5
0
        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);
            }
        }