private void UpdateRanks() { RankItem rankItem = Economy.Ranks; rankItem.UpdatePrices(); List<string> ranklist = new List<string>(); foreach (RankItem.Rank rank in rankItem.RanksList) { ranklist.Add(rank.group.name); if (rank.group.name == rankItem.MaxRank) break; } listBoxRank.DataSource = ranklist; listBoxRank.SelectedItem = comboBoxRank.SelectedItem; numericUpDownRank.Value = rankItem.FindRank(comboBoxRank.SelectedItem.ToString()).price; }
void UpdateRanks() { RankItem rankItem = Economy.Ranks; rankItem.UpdatePrices(); List <string> ranklist = new List <string>(); foreach (RankItem.Rank rank in rankItem.RanksList) { ranklist.Add(rank.group.Name); if (rank.group.Permission >= rankItem.MaxRank) { break; } } listBoxRank.DataSource = ranklist; listBoxRank.SelectedItem = comboBoxRank.SelectedItem; listBoxRank_SelectedIndexChanged(null, null); }