Esempio n. 1
0
        public BMGEditor(BmgFile bmg)
        {
            bmgFile = bmg;

            InitializeComponent();
        }
Esempio n. 2
0
        private void LoadInfo()
        {
            listBox1.Items.Clear();
            if (arc != "")
            {
                try
                {
                    Encoding         shiftjis = Encoding.GetEncoding("shift-jis");
                    ObjectParameters op       = new ObjectParameters("ScenarioArchiveName");
                    stageArc = new SMSScene(arc);
                    levels   = new string[stageArc.Objects[0].Grouped[0].Grouped.Count][];
                    Strings  = new GameObject[stageArc.Objects[0].Grouped[0].Grouped.Count][];
                    Tables   = new GameObject[stageArc.Objects[0].Grouped[0].Grouped.Count];
                    for (int i = 0; i < stageArc.Objects[0].Grouped[0].Grouped.Count; i++)
                    {
                        Tables[i]  = stageArc.Objects[0].Grouped[0].Grouped[i];
                        levels[i]  = new string[Tables[i].Grouped.Count];
                        Strings[i] = new GameObject[Tables[i].Grouped.Count];
                        for (int j = 0; j < Tables[i].Grouped.Count; j++)
                        {
                            op.Adjust(Tables[i].Grouped[j]);
                            levels[i][j]  = op.GetParamValue(0, Tables[i].Grouped[j]);
                            Strings[i][j] = Tables[i].Grouped[j];
                        }
                    }
                }
                catch
                {
                    MessageBox.Show("Failed to open StageArc.bin", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    this.Close();
                }
            }
            else
            {
                this.Close();
            }

            if (common != "")
            {
                BmgFile bmg;
                try
                {
                    bmg   = new BmgFile(common + "\\2d\\stagename.bmg");
                    names = new string[bmg.Count];
                    for (int i = 0; i < bmg.Count; i++)
                    {
                        names[i] = bmg.GetString(i);
                    }
                    bmg.Close();
                }
                catch
                {
                    MessageBox.Show("Failed to open StageArc.bin", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    this.Close();
                }
            }

            for (int i = 0; i < levels.Length; i++)
            {
                string name = "";
                if (names != null)
                {
                    if (i < names.Length)
                    {
                        name = names[i];
                    }
                }
                if (name == "")
                {
                    listBox1.Items.Add(i + ": " + levels[i][0]);
                }
                else
                {
                    listBox1.Items.Add(i + " (" + name + ") : " + levels[i][0]);
                }
            }
        }