Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        public void SetItem(int index, DlcItem dlc)
        {
            if (index < 0 || index >= NumEntries)
            {
                return;
            }

            items[index] = dlc;
        }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
        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)
                    };
                }
            }
        }
Esempio n. 5
0
        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);
            };
        }
Esempio n. 6
0
        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();
            };
        }
Esempio n. 7
0
        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;
            };
        }