private void UpdateSpecificInfo(DlcItem dlc) { if (specificControl != null) { this.Controls.Remove(specificControl); specificControl.Dispose(); specificControl = null; } switch (dlc.Tab) { case DlcType.Alchemy: specificControl = new AlchemyInfoControl(dlc); break; case DlcType.Item: specificControl = new ItemInfoControl(dlc); break; case DlcType.Subquest: specificControl = new SubquestInfoControl(dlc); break; } if (specificControl != null) { specificControl.Location = new Point(224, 104); this.Controls.Add(specificControl); } }
public void SetItem(int index, DlcItem dlc) { if (index < 0 || index >= NumEntries) { return; } items[index] = dlc; }
private void UpdateGeneralInfo(DlcItem dlc) { generalBox.Enabled = true; radioAlchemy.Checked = (dlc.Tab == DlcType.Alchemy); radioObject.Checked = (dlc.Tab == DlcType.Item); radioSubquest.Checked = (dlc.Tab == DlcType.Subquest); radioEmpty.Checked = (dlc.Tab == DlcType.Empty); txtDlcName.Text = dlc.Name; }
private void Read() { using (var stream = new DataStream(DlcName, FileMode.Open, FileAccess.Read)) { var reader = new DataReader(stream, EndiannessMode.LittleEndian, System.Text.Encoding.GetEncoding("shift_jis")); NumEntries = reader.ReadUInt16(); items = new DlcItem[NumEntries]; for (int i = 0; i < NumEntries; i++) { items[i] = new DlcItem { Tab = (DlcType)reader.ReadUInt16(), Index = reader.ReadUInt16(), Name = reader.ReadString(0x30, "replace", false) }; } } }
public SubquestInfoControl(DlcItem dlc) { InitializeComponent(); var manager = SubquestManager.Instance; for (int i = 0; i < manager.NumEntries; i++) { comboSubquest.Items.Add(manager.GetEntry(i)); } comboSubquest.SelectedIndex = manager.GetIndex(dlc.Index); comboSubquest.AutoCompleteMode = AutoCompleteMode.Suggest; comboSubquest.AutoCompleteSource = AutoCompleteSource.ListItems; comboSubquest.SelectedIndexChanged += delegate { dlc.Index = (ushort)manager.GetNumber(comboSubquest.SelectedIndex); }; }
public AlchemyInfoControl(DlcItem dlc) { InitializeComponent(); comboRecipe.Format += delegate(object sender, ListControlConvertEventArgs e) { var recipe = (AlchemyRecipe)e.ListItem; if (recipe.Name != null) { e.Value = recipe.Name; } else { e.Value = "Invalid"; } }; var manager = AlchemyManager.Instance; for (int i = 0; i < manager.NumEntries; i++) { comboRecipe.Items.Add(manager[i]); } comboRecipe.AutoCompleteMode = AutoCompleteMode.Suggest; comboRecipe.AutoCompleteSource = AutoCompleteSource.ListItems; comboRecipe.SelectedIndex = dlc.Index; UpdateIngredients(); comboRecipe.SelectedIndexChanged += delegate { if ((string)comboRecipe.SelectedItem == "Invalid") { return; } dlc.Index = (ushort)comboRecipe.SelectedIndex; UpdateIngredients(); }; }
public ItemInfoControl(DlcItem dlc) { InitializeComponent(); var manager = ItemManager.Instance; for (int i = 0; i < ItemManager.NumEntries; i++) { var item = manager.GetItem(i); comboItems.Items.Add((item == null) ? "Invalid" : item + " (" + i.ToString("D3") + ")"); } comboItems.SelectedIndex = dlc.Index; comboItems.AutoCompleteMode = AutoCompleteMode.Suggest; comboItems.AutoCompleteSource = AutoCompleteSource.ListItems; comboItems.SelectedIndexChanged += delegate { if ((string)comboItems.SelectedItem == "Invalid") { return; } dlc.Index = (ushort)comboItems.SelectedIndex; }; }