public frmDiceRoller(frmMain frmMainForm, List <Quality> lstQualities = null, int intDice = 1) { InitializeComponent(); LanguageManager.Instance.Load(GlobalOptions.Instance.Language, this); _frmMain = frmMainForm; _RNG = new MTRNG(); nudDice.Value = intDice; if (lstQualities != null) { foreach (Quality objQuality in lstQualities) { if (objQuality.Name.StartsWith("Gremlins")) { int intRating = Convert.ToInt32(objQuality.Name.Substring(objQuality.Name.Length - 2, 1)); nudGremlins.Value = intRating; } } } MoveControls(); List <ListItem> lstMethod = new List <ListItem>(); ListItem itmStandard = new ListItem(); itmStandard.Value = "Standard"; itmStandard.Name = LanguageManager.Instance.GetString("String_DiceRoller_Standard"); ListItem itmLarge = new ListItem(); itmLarge.Value = "Large"; itmLarge.Name = LanguageManager.Instance.GetString("String_DiceRoller_Large"); ListItem itmReallyLarge = new ListItem(); itmReallyLarge.Value = "ReallyLarge"; itmReallyLarge.Name = LanguageManager.Instance.GetString("String_DiceRoller_ReallyLarge"); lstMethod.Add(itmStandard); lstMethod.Add(itmLarge); lstMethod.Add(itmReallyLarge); cboMethod.ValueMember = "Value"; cboMethod.DisplayMember = "Name"; cboMethod.DataSource = lstMethod; cboMethod.SelectedIndex = 0; }
public frmDiceRoller(frmMain frmMainForm, List<Quality> lstQualities = null, int intDice = 1) { InitializeComponent(); LanguageManager.Instance.Load(GlobalOptions.Instance.Language, this); _frmMain = frmMainForm; _RNG = new MTRNG(); nudDice.Value = intDice; if (lstQualities != null) { foreach (Quality objQuality in lstQualities) { if (objQuality.Name.StartsWith("Gremlins")) { int intRating = Convert.ToInt32(objQuality.Name.Substring(objQuality.Name.Length - 2, 1)); nudGremlins.Value = intRating; } } } MoveControls(); List<ListItem> lstMethod = new List<ListItem>(); ListItem itmStandard = new ListItem(); itmStandard.Value = "Standard"; itmStandard.Name = LanguageManager.Instance.GetString("String_DiceRoller_Standard"); ListItem itmLarge = new ListItem(); itmLarge.Value = "Large"; itmLarge.Name = LanguageManager.Instance.GetString("String_DiceRoller_Large"); ListItem itmReallyLarge = new ListItem(); itmReallyLarge.Value = "ReallyLarge"; itmReallyLarge.Name = LanguageManager.Instance.GetString("String_DiceRoller_ReallyLarge"); lstMethod.Add(itmStandard); lstMethod.Add(itmLarge); lstMethod.Add(itmReallyLarge); cboMethod.ValueMember = "Value"; cboMethod.DisplayMember = "Name"; cboMethod.DataSource = lstMethod; cboMethod.SelectedIndex = 0; }