Ejemplo n.º 1
0
        static TWMapConfig RetrieveConfig(Player p)
        {
            TWMapConfig cfg = new TWMapConfig();

            cfg.SetDefaults(p.level);
            cfg.Load(p.level.name);
            return(cfg);
        }
Ejemplo n.º 2
0
        void twMapUse_SelectedIndexChanged(object sender, EventArgs e)
        {
            SaveTWMapSettings();
            if (tw_lstUsed.SelectedIndex == -1)
            {
                tw_grpMapSettings.Text    = "Map settings";
                tw_grpMapSettings.Enabled = false;
                twCurCfg = null;
                return;
            }

            twCurMap = tw_lstUsed.SelectedItem.ToString();
            tw_grpMapSettings.Text    = "Map settings (" + twCurMap + ")";
            tw_grpMapSettings.Enabled = true;

            try {
                twCurCfg = new TWMapConfig();
                twCurCfg.Load(twCurMap);
            } catch (Exception ex) {
                Logger.LogError(ex);
                twCurCfg = null;
            }

            if (twCurCfg == null)
            {
                return;
            }
            tw_numScoreLimit.Value   = twCurCfg.ScoreRequired;
            tw_numScorePerKill.Value = twCurCfg.ScorePerKill;
            tw_numScoreAssists.Value = twCurCfg.AssistScore;
            tw_numMultiKills.Value   = twCurCfg.MultiKillBonus;
            tw_cbStreaks.Checked     = twCurCfg.Streaks;

            tw_cbGrace.Checked   = twCurCfg.GracePeriod;
            tw_numGrace.Value    = twCurCfg.GracePeriodTime;
            tw_cbBalance.Checked = twCurCfg.BalanceTeams;
            tw_cbKills.Checked   = twCurCfg.TeamKills;
        }