void InitializeFromGameFiles() { // Load Resources Encoding enc = Encoding.GetEncoding("shift-jis"); System.Resources.ResourceManager res = new System.Resources.ResourceManager("AtelierElieScripter.Res.GameFiles", System.Reflection.Assembly.GetExecutingAssembly()); BinaryReader fileEV1 = new BinaryReader(new MemoryStream((Byte[])res.GetObject("EV_001")), enc); BinaryReader fileEV4 = new BinaryReader(new MemoryStream((Byte[])res.GetObject("EV_004")), enc); BinaryReader fileEV7 = new BinaryReader(new MemoryStream((Byte[])res.GetObject("EV_007")), enc); BinaryReader fileEVCB = new BinaryReader(new MemoryStream((Byte[])res.GetObject("EV_CB")), enc); BinaryReader fileREQUEST = new BinaryReader(new MemoryStream((Byte[])res.GetObject("REQUEST")), enc); // Initialize Variables uint BlockPointerChoices; uint BlockPointer; int textBlockNo; BinaryReader fileUsed; // Create all TextBlock instances for (int i = 0; i < 0x1F9; i++) { mainBlocks[i] = new DialogueTextBlocks(); if (i < 0x27) { BlockPointer = BLOCKOFFSETLIST[0]; BlockPointerChoices = BLOCKOFFSETLIST[1]; textBlockNo = i; fileUsed = fileEV1; } else if (i < 0x49) { BlockPointer = BLOCKOFFSETLIST[2]; BlockPointerChoices = BLOCKOFFSETLIST[3]; textBlockNo = i - 0x27; fileUsed = fileEV1; } else if (i < 0x7e) { BlockPointer = BLOCKOFFSETLIST[4]; BlockPointerChoices = BLOCKOFFSETLIST[5]; textBlockNo = i - 0x49; fileUsed = fileEV1; } else if (i < 0xaa) { BlockPointer = BLOCKOFFSETLIST[6]; BlockPointerChoices = BLOCKOFFSETLIST[7]; textBlockNo = i - 0x7e; fileUsed = fileEV4; } else if (i < 0xd4) { BlockPointer = BLOCKOFFSETLIST[8]; BlockPointerChoices = BLOCKOFFSETLIST[9]; textBlockNo = i - 0xaa; fileUsed = fileEV4; } else if (i < 0x111) { BlockPointer = BLOCKOFFSETLIST[10]; BlockPointerChoices = BLOCKOFFSETLIST[11]; textBlockNo = i - 0xd4; fileUsed = fileEV4; } else if (i < 0x149) { BlockPointer = BLOCKOFFSETLIST[12]; BlockPointerChoices = BLOCKOFFSETLIST[13]; textBlockNo = i - 0x111; fileUsed = fileEV7; } else if (i < 0x175) { BlockPointer = BLOCKOFFSETLIST[14]; BlockPointerChoices = BLOCKOFFSETLIST[15]; textBlockNo = i - 0x149; fileUsed = fileEV7; } else if (i < 0x197) { BlockPointer = BLOCKOFFSETLIST[16]; BlockPointerChoices = BLOCKOFFSETLIST[17]; textBlockNo = i - 0x175; fileUsed = fileEV7; } else if (i < 0x1c0) { BlockPointer = BLOCKOFFSETLIST[18]; BlockPointerChoices = BLOCKOFFSETLIST[19]; textBlockNo = i - 0x197; fileUsed = fileEVCB; } else if (i < 0x1f6) { BlockPointer = BLOCKOFFSETLIST[20]; BlockPointerChoices = BLOCKOFFSETLIST[21]; textBlockNo = i - 0x1c0; fileUsed = fileEVCB; } else { BlockPointer = BLOCKOFFSETLIST[22]; BlockPointerChoices = BLOCKOFFSETLIST[23]; textBlockNo = i - 0x1f6; fileUsed = fileREQUEST; } InitializeTextBlock(BlockPointer, fileUsed, i, textBlockNo); } // Close resources fileEV1.Close(); fileEV4.Close(); fileEV7.Close(); fileEVCB.Close(); fileREQUEST.Close(); }