static LSMapConfig RetrieveConfig(Player p) { LSMapConfig cfg = new LSMapConfig(); cfg.SetDefaults(p.level); cfg.Load(p.level.name); return(cfg); }
void lsMapUse_SelectedIndexChanged(object sender, EventArgs e) { SaveLSMapSettings(); if (ls_lstUsed.SelectedIndex == -1) { ls_grpMapSettings.Text = "Map settings"; ls_grpMapSettings.Enabled = false; lsCurCfg = null; return; } lsCurMap = ls_lstUsed.SelectedItem.ToString(); ls_grpMapSettings.Text = "Map settings (" + lsCurMap + ")"; ls_grpMapSettings.Enabled = true; try { lsCurCfg = new LSMapConfig(); lsCurCfg.Load(lsCurMap); } catch (Exception ex) { Logger.LogError(ex); lsCurCfg = null; } if (lsCurCfg == null) { return; } ls_numKiller.Value = lsCurCfg.KillerChance; ls_numFast.Value = lsCurCfg.FastChance; ls_numWater.Value = lsCurCfg.WaterChance; ls_numDestroy.Value = lsCurCfg.DestroyChance; ls_numLayer.Value = lsCurCfg.LayerChance; ls_numCount.Value = lsCurCfg.LayerCount; ls_numHeight.Value = lsCurCfg.LayerHeight; ls_numRound.Value = lsCurCfg.RoundTime; ls_numFlood.Value = lsCurCfg.FloodTime; ls_numLayerTime.Value = lsCurCfg.LayerInterval; }