Ejemplo n.º 1
0
        private void SaveITCButton_Click(object sender, EventArgs e)
        {
            SaveFileDialog dialog = new SaveFileDialog();

            dialog.Filter = "Item Treasure Box files (*.itb)|*.itb|All files (*.*)|*.*";
            DialogResult result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                Stream itbOut = File.OpenWrite(dialog.FileName);
                UpdateWriteInfo();
                Itb.Write(itbOut, itb);
                itbOut.Close();
                MessageBox.Show("File saved successfully!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 2
0
        private void LoadITCButton_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Filter = "Item Treasure Box files (*.itb)|*.itb|All files (*.*)|*.*";
            DialogResult result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                if (itbFile != null)
                {
                    itbFile.Close();
                }
                itbFile = File.OpenRead(dialog.FileName);
                itb     = Itb.Read(itbFile);
                UpdateParameters(itb);
                SaveITBButton.Enabled  = true;
                NewChestButton.Enabled = true;
            }
        }
Ejemplo n.º 3
0
        private void UpdateParameters(Itb itb)
        {
            foreach (TabPage tCon in ItbTabControl.TabPages)
            {
                tCon.Controls[0].Controls.Clear();
            }

            for (int i = 0; i < itb.header.ItemsTotal; i++)
            {
                FlowLayoutPanel currentFPanel = new FlowLayoutPanel();
                switch (itb.AllITB[i].WorldID)
                {
                case 1:
                    currentFPanel = FlowDP;
                    break;

                case 2:
                    currentFPanel = FlowSW;
                    break;

                case 3:
                    currentFPanel = FlowCD;
                    break;

                case 4:
                    currentFPanel = FlowSB;
                    break;

                case 5:
                    currentFPanel = FlowYT;
                    break;

                case 6:
                    currentFPanel = FlowRG;
                    break;

                case 7:
                    currentFPanel = FlowJB;
                    break;

                case 8:
                    currentFPanel = FlowHE;
                    break;

                case 9:
                    currentFPanel = FlowLS;
                    break;

                case 10:
                    currentFPanel = FlowDI;
                    break;

                case 11:
                    currentFPanel = FlowPP;
                    break;

                case 12:
                    currentFPanel = FlowDC;
                    break;

                case 13:
                    currentFPanel = FlowKG;
                    break;

                case 15:
                    currentFPanel = FlowVS;
                    break;

                case 16:
                    currentFPanel = FlowBD;
                    break;

                case 17:
                    currentFPanel = FlowWM;
                    break;
                }

                ItbEntry itbEntry = new ItbEntry();
                itbEntry.ITB_GBox.Text = "ITB Entry " + (i + 1);
                itbEntry.NumericTreasureBoxID.Value     = itb.AllITB[i].TreasureBoxID;
                itbEntry.ItemKindComboBox.SelectedIndex = itb.AllITB[i].ItemKind;

                switch (itbEntry.ItemKindComboBox.SelectedIndex)
                {
                case 0:
                    itbEntry.ItemIDComboBox.DataSource   = Enum.GetValues(typeof(Item.Type));
                    itbEntry.ItemIDComboBox.SelectedItem = (Item.Type)itb.AllITB[i].ItemID;
                    break;

                case 1:
                    itbEntry.ItemIDComboBox.SelectedItem = (Command.Kind)itb.AllITB[i].ItemID;
                    break;
                }


                itbEntry.NumericReportID.Value = itb.AllITB[i].ReportID;
                currentFPanel.Controls.Add(itbEntry);
            }
        }