/// <summary> /// 配置列表选中改变响应 /// </summary> protected void configListBox_SelectedIndexChanged(object sender, EventArgs e) { if (this.configListBox.SelectedIndex < 0) { return; } mw.RandConfig config = RandTable.GetConfig(this.configListBox.SelectedIndex, (mw.Enums.RandType) int.Parse(this.randTypeDropDownList.SelectedValue)); if (config == null) { return; } for (int i = 0; i < this.rewardTypeDropDownList.Items.Count; ++i) { if (this.rewardTypeDropDownList.Items[i].Value == ((int)config.reward_idx).ToString()) { this.rewardTypeDropDownList.SelectedIndex = i; break; } } this.UpdateRewordId(); for (int i = 0; i < this.idDropDownList.Items.Count; ++i) { if (this.idDropDownList.Items[i].Value == config.reward_type.ToString()) { this.idDropDownList.SelectedIndex = i; break; } } if (config.reward_count > 0) { this.minCountTextBox.Text = config.reward_count.ToString(); this.countTextBox.Text = config.reward_count.ToString(); } else { this.minCountTextBox.Text = config.reward_min_count.ToString(); this.countTextBox.Text = config.reward_max_count.ToString(); } if (config.rand_type != mw.Enums.RandType.RAND_TYPE_LUCK) { this.counterIndexTextBox.Text = config.check_idx.ToString(); this.counterValueTextBox.Text = config.limit_count.ToString(); } this.limitTextBox.Text = config.limit_count.ToString(); this.minTextBox.Text = config.min_rand.ToString(); this.maxTextBox.Text = config.max_rand.ToString(); }
/// <summary> /// 修改按钮响应 /// </summary> protected void modifyButton_Click(object sender, EventArgs e) { if (this.configListBox.SelectedIndex < 0) { return; } mw.RandConfig config = RandTable.GetConfig(this.configListBox.SelectedIndex, (mw.Enums.RandType) int.Parse(this.randTypeDropDownList.SelectedValue)); if (!this.UpdateConfig(config)) { return; } TableManager.Save(RandTable.RandList); this.configListBox.SelectedItem.Text = this.GetConfigText(config); this.configListBox.SelectedItem.Value = this.configListBox.SelectedItem.Text + this.configListBox.SelectedIndex; }