public ItemDialog(MainForm parent, EditQuestForm parentForm, LocaleQuestForm parentForm2, int questID, int type) { InitializeComponent(); itemGridView.CellFormatting += new DataGridViewCellFormattingEventHandler(CellFormatting); //itemGridView.CellBeginEdit += CellFormatting; this.Enabled = false; this.parent = parent; this.parentForm2 = parentForm2; this.parentForm = parentForm; this.formType = type; this.questID = questID; locale = new Dictionary <int, QuestItemInfo>(); foreach (CItem item in parent.itemConst.getAllItems().Values) { ((DataGridViewComboBoxColumn)itemGridView.Columns[0]).Items.Add(item.getDescription()); } ((DataGridViewComboBoxColumn)itemGridView.Columns[0]).Sorted = true; if (formType == this.ITEM_LOCALIZATION_REWARD || formType == this.ITEM_LOCALIZATION_RULES) { bTranslate.Enabled = true; if (formType == this.ITEM_LOCALIZATION_REWARD) { this.locale = parentForm2.cur_locale_quest.QuestInformation.Items; } else { this.locale = parentForm2.cur_locale_quest.QuestInformation.Items; } } fillItemGrid(); }
public RewardFractions(EditQuestForm form) { this.form = form; InitializeComponent(); dataFractions.LostFocus += new EventHandler(dataFractions_LostFocus); dataFractions.GotFocus += new EventHandler(dataFractions_GotFocus); foreach (KeyValuePair <int, string> pair in form.parent.fractions.getListOfFractions()) { string id = pair.Key.ToString(); string name = pair.Value; bool rew = false; if (form.editQuestReward.Fractions.Contains(pair.Key)) { rew = true; } //if (form.editQuestReward.Reputation.Keys.Contains(pair.Key)) // rew = form.editQuestReward.Reputation[pair.Key].ToString(); object[] row = { id, name, rew }; dataFractions.Rows.Add(row); } if (form.editQuestReward.Unlimited == 1) { unlimitedCheckBox.Checked = true; } //label1.Text = //"торговцы(+100%)/военные(+20%)/наемники(+20%)/бандиты(-10%)/старые-сталкеры(-20%)/барыги(-30%)/охотники(-10%)\n"+ //"барыги(+100%)/бандиты(+20%)/старые-сталкеры(+20%)/военные(-10%)/наемники(-20%)/торговцы(-30%)/охотники(+10%)\n" + //"бандиты(+100%)/старые-сталкеры(+10%)/барыги(+10%)/военные(-60%)/наемники(-40%)/охотники(-10%)\n" + //"военные(+100%)/наемники(+10%)/торговцы(+10%)/бандиты(-60%)/старые-сталкеры(-40%)/охотники(+10%)\n" + //"наемники(+100%)/военные(+20%)/торговцы(+10%)/бандиты(-40%)/старые-сталкеры(-60%)/барыги(-10%)\n" + //"старые-сталкеры(+100%)/бандиты(+20%)/барыги(+10%)/военные(-40%)/наемники(-60%)/торговцы(-10%)\n" + //"охотники(+100%)/военные(+10%)/бандиты(+10%)/торговцы(-20%)/барыги(-20%)/ученые(+10%)\n" + //"ученые(+100%)/военные(-10%)/бандиты(-10%)/наемники(-10%)/старые-сталкеры(-10%)/мутанты зоны(+20%)/фракция группировок зоны(+10%)/охотники(+20%)\n" + //"мутанты зоны(+100%)/военные(-10%)/бандиты(-10%)/торговцы(-20%)/барыги(-20%)/охотники(-30%)/старые-сталкеры(+10%)\n" + //"фракция группировок зоны(+100%)/военные(+5%)/бандиты(+5%)/наемники(-10%)/старые-сталкеры(-10%)/ученые(+5%)/охотники(-5%)"; }
public EditDialogEffect(MainForm parent, EditQuestForm parentForm, int questID) { InitializeComponent(); this.parent = parent; this.parentForm = parentForm; foreach (string effect_name in parent.effects.getAllDescriptions()) { ((DataGridViewComboBoxColumn)dataGridEffects.Columns[0]).Items.Add(effect_name); } ((DataGridViewComboBoxColumn)dataGridEffects.Columns[0]).Sorted = true; foreach (CEffect effect in parentForm.editQuestReward.Effects) { string name = parent.effects.getDescriptionOnID(effect.getID()); string stack = effect.getStack().ToString(); object[] row = { name, stack }; dataGridEffects.Rows.Add(row); } }
public SelectQuestItem(EditQuestForm itemParent, int QuestID) { this.itemParent = itemParent; InitializeComponent(); CQuest quest = new CQuest(); //try //{ quest = itemParent.getQuest(); //} //catch //{ // itemParent.Visible = true; // this.Close(); //} List <CQuest> wayIDs = new List <CQuest>(); if (quest.Reward.AttrOfItems.Contains(1) || quest.QuestRules.AttrOfItems.Contains(1)) { foreach (CQuest q in wayIDs) { if (q.QuestID == QuestID) { wayIDs.Remove(q); break; } } wayIDs.Add(quest); } List <CQuest> getted = new List <CQuest>(); if (quest.Additional.IsSubQuest.Equals(0)) { getted = itemParent.parent.getTreesItemIDs(quest.QuestID); } else { getted = itemParent.parent.getTreesItemIDs(quest.Additional.IsSubQuest); } CQuest rem = null; foreach (CQuest q in getted) { if (q.QuestID == QuestID) { rem = q; } } if (rem != null) { getted.Remove(rem); } wayIDs.AddRange(getted); if (!wayIDs.Any()) { System.Console.WriteLine("Ways empty"); this.Close(); } else { this.Enabled = true; this.Visible = true; } foreach (CQuest q in wayIDs) { CheckBox box = new CheckBox(); box.Text = q.QuestID.ToString(); box.Dock = DockStyle.Top; if (quest.Target.AObjectAttrs.Contains(q.QuestID)) { box.Checked = true; } box.CheckedChanged += new EventHandler(box_CheckedChanged); splitContainer1.Panel1.Controls.Add(box); } updateLabel(); }