コード例 #1
0
ファイル: GamesHelper.cs プロジェクト: noahjoyce31/MCGalaxy
        public void Save()
        {
            RoundsGameConfig cfg = game.GetConfig();

            cfg.StartImmediately = cbStart.Checked;
            cfg.MapInHeartbeat   = cbMap.Checked;
            cfg.SetMainLevel     = cbMain.Checked;
            cfg.Save();
        }
コード例 #2
0
        public void Load(string[] allMaps)
        {
            RoundsGameConfig cfg = game.GetConfig();

            cbStart.Checked = cfg.StartImmediately;
            cbMap.Checked   = cfg.MapInHeartbeat;
            cbMain.Checked  = cfg.SetMainLevel;

            UpdateButtons();
            UpdateUsedMaps();
            UpdateNotUsedMaps(allMaps);
        }
コード例 #3
0
        public void Save()
        {
            RoundsGameConfig cfg = game.GetConfig();

            cfg.StartImmediately = cbStart.Checked;
            cfg.MapInHeartbeat   = cbMap.Checked;
            cfg.SetMainLevel     = cbMain.Checked;

            try {
                cfg.Save();
            } catch (Exception ex) {
                Logger.LogError("Error saving " + game.GameName + " settings", ex);
            }
        }
コード例 #4
0
ファイル: GamesHelper.cs プロジェクト: rdebath/MCGalaxy
        void DelMap_Click(object sender, EventArgs e)
        {
            try {
                object selected = lbUsed.SelectedItem;
                if (selected == null)
                {
                    Popup.Warning("No map selected"); return;
                }
                string map = (string)selected;

                LevelConfig lvlCfg = LevelInfo.GetConfig(map);
                RoundsGameConfig.RemoveMap(Player.Console, map, lvlCfg, game);
            } catch (Exception ex) {
                Logger.LogError("Error removing map from game", ex);
            }
        }
コード例 #5
0
        void AddMap_Click(object sender, EventArgs e)
        {
            try {
                object selected = lbNotUsed.SelectedItem;
                if (selected == null)
                {
                    Popup.Warning("No map selected"); return;
                }
                string map = (string)selected;

                Level       lvl;
                LevelConfig lvlCfg = LevelInfo.GetConfig(map, out lvl);
                RoundsGameConfig.AddMap(Player.Console, map, lvlCfg, game);
            } catch (Exception ex) {
                Logger.LogError("Error adding map to game", ex);
            }
        }
コード例 #6
0
        public override void Use(Player p, string message, CommandData data)
        {
            RoundsGame game = Game;

            if (message.CaselessEq("go"))
            {
                HandleGo(p, game); return;
            }
            else if (IsInfoCommand(message))
            {
                HandleStatus(p, game); return;
            }
            if (!CheckExtraPerm(p, data, 1))
            {
                return;
            }

            if (message.CaselessEq("start") || message.CaselessStarts("start "))
            {
                HandleStart(p, game, message.SplitSpaces());
            }
            else if (message.CaselessEq("end"))
            {
                HandleEnd(p, game);
            }
            else if (message.CaselessEq("stop"))
            {
                HandleStop(p, game);
            }
            else if (message.CaselessEq("add"))
            {
                RoundsGameConfig.AddMap(p, p.level.name, p.level.Config, game);
            }
            else if (IsDeleteCommand(message))
            {
                RoundsGameConfig.RemoveMap(p, p.level.name, p.level.Config, game);
            }
            else if (message.CaselessStarts("set ") || message.CaselessStarts("setup "))
            {
                HandleSet(p, game, message.SplitSpaces());
            }
            else
            {
                Help(p);
            }
        }