static InputFormRef Init(Form self) { return(new InputFormRef(self , "" , Program.ROM.RomInfo.support_attribute_pointer() , 8 , (int i, uint addr) => { //個数が固定できまっている uint v = Program.ROM.u8(addr); return v != 0; } , (int i, uint addr) => { //リストボックスに乗せる項目 return U.ToHexString(i + 1) + " " + InputFormRef.GetAttributeName((uint)i + 1); } )); }
string MakeNMMDropDownList(InputFormRef ifr, string basefilename, Dictionary <string, string> addFiles, List <Control> controls, string linktype, int num) { string filename = basefilename + linktype + ".txt"; if (addFiles.ContainsKey(linktype)) { return(addFiles[filename]); } string data = ""; if (linktype == "INDEX") { data = MakeNMMDropDownListInner(ifr.MakeList()); } else if (linktype == "PORTRAIT") { data = MakeNMMDropDownListInner(ImagePortraitForm.MakePortraitList()); } else if (linktype == "UNIT") { List <U.AddrResult> list = UnitForm.MakeUnitList(); data = MakeNMMDropDownListInner(list); } else if (linktype == "CLASS") { data = MakeNMMDropDownListInner(ClassForm.MakeClassList()); } else if (linktype == "ITEM") { data = MakeNMMDropDownListInner(ItemForm.MakeItemList()); } else if (linktype == "SONG") { data = MakeNMMDropDownListInner(SongTableForm.MakeItemList()); } else if (linktype == "COMBO") { Control c = InputFormRef.FindObject(ifr.Prefix, controls, num + "_" + linktype); if (c is ComboBox) { data = MakeNMMDropDownListInner((ComboBox)c); data = string.Join("\r\n", U.ComboBoxToStringList((ComboBox)c)); } } else if (linktype == "ATTRIBUTE") { StringBuilder sb = new StringBuilder(); sb.AppendLine("8"); for (uint n = 0; n < 8; n++) { sb.AppendLine(U.To0xHexString(n) + " " + InputFormRef.GetAttributeName(n)); } data = sb.ToString(); } else if (linktype == "WEAPON") { StringBuilder sb = new StringBuilder(); sb.AppendLine("7"); sb.AppendLine("0x0 -"); sb.AppendLine("0x1 E"); sb.AppendLine("0x31 D"); sb.AppendLine("0x71 C"); sb.AppendLine("0x121 B"); sb.AppendLine("0x181 A"); sb.AppendLine("0x251 S"); data = sb.ToString(); } else if (linktype == "FLAG") { StringBuilder sb = new StringBuilder(); sb.AppendLine("128"); string dummy; for (uint n = 0; n < 128; n++) { sb.AppendLine(U.To0xHexString(n) + " " + InputFormRef.GetFlagName(n, out dummy)); } data = sb.ToString(); } else if (linktype == "BIT") { filename = basefilename + linktype + num + ".txt"; if (addFiles.ContainsKey(linktype)) { return(addFiles[filename]); } data = MakeBitsListInner(ifr, controls, linktype, num); } if (data == "") { return("NULL"); } addFiles[filename] = data; return(filename); }