Esempio n. 1
0
        private void SpellEditor_Load(object sender, EventArgs e)
        {
            for (int i = 0; i <= 0x36; i++)
            {
                var br  = new BinaryReader(new MemoryStream(_romBytes));
                var pos = Form1.Address(0x04, 0x3452) + i;
                br.BaseStream.Position = pos;
                var    spellByte = br.ReadByte();
                string name      = DW3String.TranslateString(ReadNativeStringTableEntry(DW3String.eStringTable.Spell, i));

                Spell spell = new Spell(spellByte, pos, name);

                SpellEditControl spellEditor = new SpellEditControl(spell)
                {
                    Location = new Point(15, 15 + (30 * i))
                };

                SpellEditorPanel.Controls.Add(spellEditor);
            }
        }
Esempio n. 2
0
        private void button4_Click(object sender, EventArgs e)
        {
            int ItemStatTable = Address(0x09, 0x3990);

            StringBuilder sb = new StringBuilder();

            var br = new BinaryReader(new MemoryStream(_romBytes));

            br.BaseStream.Position = ItemStatTable;
            for (int i = 0; i < 0x80; i++)
            {
                string name = i < 0x40 ? (ReadNativeStringTableEntry(DW3String.eStringTable.ItemLowFirst, i) + ReadNativeStringTableEntry(DW3String.eStringTable.ItemLowSecond, i))
                                : (ReadNativeStringTableEntry(DW3String.eStringTable.ItemHighFirst, i - 0x40) + ReadNativeStringTableEntry(DW3String.eStringTable.ItemHighSecond, i - 0x40));
                sb.AppendFormat("{0} - {1}, ", br.ReadByte(), DW3String.TranslateString(name));
                if (i % 4 == 3)
                {
                    sb.AppendLine();
                }
            }
            MessageBox.Show(sb.ToString());
        }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            StringBuilder ret = new StringBuilder();

            for (int i = 0; i < 16; i++)
            {
                string str = DW3String.TranslateString(ReadNativeStringTableEntry(DW3String.eStringTable.EnemyLowFirst, i)).Replace("\t", "         ");
                str += "\n" + DW3String.TranslateString(ReadNativeStringTableEntry(DW3String.eStringTable.EnemyLowSecond, i)).Replace("\t", "         ");;
                ret.AppendLine(str);
            }
            ret.AppendLine("------");
            ret.AppendLine(DW3String.TranslateString(ReadNativeStringTableEntry(DW3String.eStringTable.Erdrick, 0)));
            ret.AppendLine("------");
            for (int i = 0; i < 30; i++)
            {
                ret.AppendFormat("{0} ", DW3String.TranslateString(ReadNativeStringTableEntry(DW3String.eStringTable.Location, 0)));
            }
            ret.AppendLine();
            ret.AppendLine("------");
            ret.AppendLine(DW3String.TranslateString(ReadNativeDialogString(0x10, 0x08D)));
            System.Windows.Forms.MessageBox.Show(ret.ToString());
        }
Esempio n. 4
0
 public override string ToString()
 {
     return(DW3String.TranslateString(Encoding.Default.GetString(_bytes)));
 }