public EventUnitFE7Form() { InitializeComponent(); this.InputFormRef = Init(this); this.MAP_LISTBOX.OwnerDraw(ListBoxEx.DrawTextOnly, DrawMode.OwnerDrawFixed); this.AddressList.OwnerDraw(EventUnitForm.AddressList_Draw, DrawMode.OwnerDrawVariable); this.EVENT_LISTBOX.OwnerDraw(EventUnitForm.EVENT_LISTBOX_Draw, DrawMode.OwnerDrawVariable); //マップIDリストを作る. U.ConvertListBox(MapSettingForm.MakeMapIDList(), ref this.MAP_LISTBOX); EventUnitForm.AI1ToCombo(L_12_COMBO); EventUnitForm.AI2ToCombo(L_13_COMBO); EventUnitForm.AI3ToCombo(L_14_AI3_HYOUTEKI); //右クリックメニューを出す. this.InputFormRef.MakeGeneralAddressListContextMenu(true, true, CustomKeydownHandler); this.InputFormRef.PreAddressListExpandsEvent += EventUnitForm.OnPreClassExtendsWarningHandler; this.InputFormRef.AddressListExpandsEvent += AddressListExpandsEvent; this.MapPictureBox.MapMouseDownEvent += MapMouseDownEvent; this.L_3_UNITGROW_LV.ValueChanged += Sim_Change_EventHandler; this.L_3_UNITGROW_GROW.SelectedIndexChanged += Sim_Change_EventHandler; this.L_3_UNITGROW_LV.Enter += Sim_Show_EventHandler; this.L_3_UNITGROW_GROW.Enter += Sim_Show_EventHandler; this.L_3_UNITGROW_LV.Leave += Sim_Hide_EventHandler; this.L_3_UNITGROW_GROW.Leave += Sim_Hide_EventHandler; this.X_Sim.Hide(); }
public EventUnitFE6Form() { InitializeComponent(); this.MAP_LISTBOX.OwnerDraw(ListBoxEx.DrawTextOnly, DrawMode.OwnerDrawFixed); this.AddressList.OwnerDraw(EventUnitForm.AddressList_Draw, DrawMode.OwnerDrawVariable); this.EVENT_LISTBOX.OwnerDraw(EventUnitForm.EVENT_LISTBOX_Draw, DrawMode.OwnerDrawVariable); this.InputFormRef = Init(this); //マップIDリストを作る. U.ConvertListBox(MapSettingForm.MakeMapIDList(), ref this.MAP_LISTBOX); //AI EventUnitForm.AI1ToCombo(L_12_COMBO); EventUnitForm.AI2ToCombo(L_13_COMBO); EventUnitForm.AI3ToCombo(L_14_AI3_HYOUTEKI); //右クリックメニューを出す. this.InputFormRef.MakeGeneralAddressListContextMenu(true); this.InputFormRef.PreAddressListExpandsEvent += EventUnitForm.OnPreClassExtendsWarningHandler; this.InputFormRef.AddressListExpandsEvent += AddressListExpandsEvent; this.MapPictureBox.MapMouseDownEvent += MapMouseDownEvent; // //ユニットID重複チェック // //ダメ、重複が許されるケースがあった // this.B0.ValueChanged += EventUnitForm_CheckDuplicatePlayerUnits; }
static List <U.AddrResult> MakeShopListLow() { List <U.AddrResult> ret = new List <U.AddrResult>(); uint p; //編成準備店. p = Program.ROM.RomInfo.item_shop_hensei_pointer; if (p != 0) { ret.Add(new U.AddrResult( Program.ROM.p32(p) , R._("編成準備店") , p)); } if (Program.ROM.RomInfo.version >= 8) { //まずワールドマップイベントをスキャン. List <U.AddrResult> worldmaplist = WorldMapPointForm.MakeWorldMapPointList(); for (uint i = 0; i < worldmaplist.Count; i++) { List <U.AddrResult> shops = WorldMapPointForm.GetShopAddr(U.toOffset(worldmaplist[(int)i].addr)); foreach (U.AddrResult shop in shops) { if (Program.ROM.u8(shop.addr) == 0) {//店に品物がない. continue; } ret.Add(shop); } } } List <U.AddrResult> maplist = MapSettingForm.MakeMapIDList(); for (int n = 0; n < maplist.Count; n++) { uint addr = MapSettingForm.GetEventAddrWhereMapID((uint)n); if (!U.isSafetyOffset(addr)) { continue; } string mapname = MapSettingForm.GetMapName((uint)n); List <U.AddrResult> shops = EventCondForm.MakeShopPointerListBox(addr); foreach (U.AddrResult shop in shops) { if (Program.ROM.u8(shop.addr) == 0) {//店に品物がない. continue; } shop.name = mapname + " " + shop.name; ret.Add(shop); } } return(ret); }
private void MapStyleEditorForm_Load(object sender, EventArgs e) { IsInit = true; //マップIDリストを作る. List <U.AddrResult> maplist = MapSettingForm.MakeMapIDList(); //マップスタイルリストを作る this.MapEditConf = MapEditorForm.MakeMapStyleList(maplist); //マップスタイルリストを作る MakeMapStyleCombo(); U.SelectedIndexSafety(this.MapStyle, 0); List <U.AddrResult> terrainList = MapTerrainNameForm.MakeList(); U.ConvertComboBox(terrainList, ref this.ConfigTerrain); //マップオブジェクト this.MAP.SetChipSize(8); Bitmap black = ImageUtil.BlankDummy(); U.MakeTransparent(black); this.MAP.SetDefaultIcon(black); //パレット this.PFR = new PaletteFormRef(this); PFR.MakePaletteUI(OnChangeColor, GetSampleBitmap); U.SelectedIndexSafety(this.PaletteCombo, 0); //TSA変更のイベント適応. List <Control> controls = InputFormRef.GetAllControls(this); InputFormRef.MakeLinkEvent("Config_", controls); //最大化禁止 //C#のバグである Anchorを四隅にすると、スクロールバーが消えるというバグに対処するために、 //フォームを固定化しないとおかしなことになる。 //クレームは microsoft あたりまでどうぞ. this.MaximizeBox = false; IsInit = false; U.AllowDropFilename(this, ImageFormRef.IMAGE_FILE_FILTER, (string filename) => { using (ImageFormRef.AutoDrag ad = new ImageFormRef.AutoDrag(filename)) { ObjImportButton_Click(null, null); } }); U.AllowDropFilename(this, new string[] { ".MAPCHIP_CONFIG" }, (string filename) => { using (ImageFormRef.AutoDrag ad = new ImageFormRef.AutoDrag(filename)) { MapChipImportButton_Click(null, null); } }); }
public ToolUseFlagForm() { InitializeComponent(); this.AddressList.OwnerDraw(Draw, DrawMode.OwnerDrawVariable); //マップIDリストを作る. U.ConvertListBox(MapSettingForm.MakeMapIDList(), ref this.MAP_LISTBOX); this.MAP_LISTBOX.OwnerDraw(ListBoxEx.DrawTextOnly, DrawMode.OwnerDrawFixed); }
static InputFormRef Init(Form self, bool isPLISTSplit) { List <U.AddrResult> mapSetting = MapSettingForm.MakeMapIDList(); uint limit; if (isPLISTSplit) {//plistはbyteで参照するため、255までしかありえない limit = 256; } else { limit = Program.ROM.RomInfo.map_map_pointer_list_default_size; } InputFormRef ifr = null; ifr = new InputFormRef(self , "" , 0 , 4 , (int i, uint addr) => { if (i == 0) { return(true); } if (i >= limit) { return(false); } return(true); } , (int i, uint addr) => { if (self == null) { return(""); } uint plist = (uint)i; string usermapname; if (isPLISTSplit) { usermapname = GetPListNameSplited(plist, ifr.BaseAddress, mapSetting); } else { usermapname = GetPListNameNotSplite(plist, mapSetting); } return(U.ToHexString(i) + " " + usermapname); } ); return(ifr); }
public EventMapChangeForm() { InitializeComponent(); this.InputFormRef = Init(this); //マップIDリストを作る. U.ConvertListBox(MapSettingForm.MakeMapIDList(), ref this.MAP_LISTBOX); //マップを最前面に移動する. MapPictureBox.BringToFront(); }
static InputFormRef Init(Form self, bool isPLISTSplit) { List <U.AddrResult> mapSetting = MapSettingForm.MakeMapIDList(); InputFormRef ifr = null; ifr = new InputFormRef(self , "" , 0 , 4 , (int i, uint addr) => { if (i == 0) { return(true); } if (i >= 256) { //plistはbyteで参照するため、255までしかありえない return(false); } if (isPLISTSplit) { return(U.isPointerOrNULL(Program.ROM.u32(addr + 0))); } //0 がポインタであればデータがあると考える. return(U.isPointer(Program.ROM.u32(addr + 0))); } , (int i, uint addr) => { if (self == null) { return(""); } uint plist = (uint)i; string usermapname; if (isPLISTSplit) { usermapname = GetPListNameSplited(plist, ifr.BaseAddress, mapSetting); } else { usermapname = GetPListNameNotSplite(plist, mapSetting); } return(U.ToHexString(i) + " " + usermapname); } ); return(ifr); }
private void MapPictureBox_Load(object sender, EventArgs e) { if (this.DesignMode) { return; } this.ZoomComboBox.Text = "100%"; this.StopDrawMarkupMarkNotUnionTab = ""; U.ConvertComboBox(MapSettingForm.MakeMapIDList(), ref this.MapSelector); //最後にワールドマップを追加. this.MapSelector.Items.Add(R._("ワールドマップ")); this.ConstWorldMapID = MapSettingForm.GetDataCount(); this.DefualtIcon = ImageSystemIconForm.YubiTate(); U.MakeTransparent(this.DefualtIcon); }
uint PListSplitsExpandsOne(MapPointerForm.PLIST_TYPE type, Undo.UndoData undodata) { Debug.Assert(type != PLIST_TYPE.ANIMATION2); //Animation1と一緒に処理しないといけない Debug.Assert(type != PLIST_TYPE.PALETTE); //OBJECTと一緒に処理しないといけない InputFormRef InputFormRef = Init(null, false); InputFormRef.ReInitPointer(GetBasePointer(type)); byte[] newArray = new byte[4 * (256)]; List <U.AddrResult> mapSetting = MapSettingForm.MakeMapIDList(); int mapmax = mapSetting.Count; for (int mapid = 0; mapid < mapmax; mapid++) { if (type == PLIST_TYPE.WORLDMAP_FE6ONLY) { Debug.Assert(Program.ROM.RomInfo.version == 6); uint wmapevent_plist = MapSettingForm.GetWorldMapEventIDWhereAddr(mapSetting[mapid].addr); PListSplitExpandsOneConvertPointer(wmapevent_plist, InputFormRef, newArray); continue; } MapSettingForm.PLists plists = MapSettingForm.GetMapPListsWhereAddr(mapSetting[mapid].addr); if (type == PLIST_TYPE.CHANGE) { PListSplitExpandsOneConvertPointer(plists.mapchange_plist, InputFormRef, newArray); } else if (type == PLIST_TYPE.EVENT) { PListSplitExpandsOneConvertPointer(plists.event_plist, InputFormRef, newArray); } else if (type == PLIST_TYPE.MAP) { PListSplitExpandsOneConvertPointer(plists.mappointer_plist, InputFormRef, newArray); } else if (type == PLIST_TYPE.CONFIG) { PListSplitExpandsOneConvertPointer(plists.config_plist, InputFormRef, newArray); } else if (type == PLIST_TYPE.ANIMATION) { PListSplitExpandsOneConvertPointer(plists.anime1_plist, InputFormRef, newArray); PListSplitExpandsOneConvertPointer(plists.anime2_plist, InputFormRef, newArray); } else { uint obj1_plist = (plists.obj_plist & 0xFF); uint obj2_plist = (plists.obj_plist >> 8) & 0xFF; //FE8にはないが FE7は、 plistを2つ設定できることがある. PListSplitExpandsOneConvertPointer(obj1_plist, InputFormRef, newArray); PListSplitExpandsOneConvertPointer(obj2_plist, InputFormRef, newArray); PListSplitExpandsOneConvertPointer(plists.palette_plist, InputFormRef, newArray); } } //終端の0xFFFFFFFFを念のため入れておきます. // U.write_u32(newArray, 256 * 4, U.NOT_FOUND); uint newpos = InputFormRef.AppendBinaryData(newArray, undodata); if (newpos == U.NOT_FOUND) { throw new PLISTExpandsException(R._("PLIST拡張に失敗しました。\r\ntype={0}\r\nnewaddr=NOT_FOUND", type.ToString())); } if (type == PLIST_TYPE.CONFIG) { Program.ROM.write_p32(Program.ROM.RomInfo.map_config_pointer, newpos, undodata); } else if (type == PLIST_TYPE.ANIMATION) { Program.ROM.write_p32(Program.ROM.RomInfo.map_tileanime1_pointer, newpos, undodata); Program.ROM.write_p32(Program.ROM.RomInfo.map_tileanime2_pointer, newpos, undodata); } else if (type == PLIST_TYPE.OBJECT) { Program.ROM.write_p32(Program.ROM.RomInfo.map_obj_pointer, newpos, undodata); Program.ROM.write_p32(Program.ROM.RomInfo.map_pal_pointer, newpos, undodata); } else if (type == PLIST_TYPE.MAP) { Program.ROM.write_p32(Program.ROM.RomInfo.map_map_pointer_pointer, newpos, undodata); } else if (type == PLIST_TYPE.CHANGE) { Program.ROM.write_p32(Program.ROM.RomInfo.map_mapchange_pointer, newpos, undodata); } else if (type == PLIST_TYPE.EVENT) { Program.ROM.write_p32(Program.ROM.RomInfo.map_event_pointer, newpos, undodata); } else if (type == PLIST_TYPE.WORLDMAP_FE6ONLY) { Program.ROM.write_p32(Program.ROM.RomInfo.map_worldmapevent_pointer, newpos, undodata); } else { Debug.Assert(false); } return(newpos); }
//全データの取得 public static void MakeAllDataLength(List <Address> list, bool isPointerOnly) { InputFormRef InputFormRef = Init(null, IsPlistSplits()); InputFormRef.ReInitPointer(GetBasePointer(PLIST_TYPE.CONFIG)); FEBuilderGBA.Address.AddAddress(list, InputFormRef, "MAPPOINTERS", new uint[] { 0 }); List <U.AddrResult> configList = InputFormRef.MakeList(); InputFormRef.ReInitPointer(GetBasePointer(PLIST_TYPE.ANIMATION)); //ANIMATION2と共有 FEBuilderGBA.Address.AddAddress(list, InputFormRef, "MAPPOINTERS_ANIMATION", new uint[] { 0 }); InputFormRef.ReInitPointer(GetBasePointer(PLIST_TYPE.OBJECT)); //PALETTEと共有 FEBuilderGBA.Address.AddAddress(list, InputFormRef, "MAPPOINTERS_OBJECT", new uint[] { 0 }); List <U.AddrResult> objList = InputFormRef.MakeList(); InputFormRef.ReInitPointer(GetBasePointer(PLIST_TYPE.MAP)); FEBuilderGBA.Address.AddAddress(list, InputFormRef, "MAPPOINTERS_MAP", new uint[] { 0 }); List <U.AddrResult> mapList = InputFormRef.MakeList(); InputFormRef.ReInitPointer(GetBasePointer(PLIST_TYPE.EVENT)); FEBuilderGBA.Address.AddAddress(list, InputFormRef, "MAPPOINTERS_EVENT", new uint[] { 0 }); InputFormRef.ReInitPointer(GetBasePointer(PLIST_TYPE.CHANGE)); FEBuilderGBA.Address.AddAddress(list, InputFormRef, "MAPPOINTERS_CHANGE", new uint[] { 0 }); if (Program.ROM.RomInfo.version == 6) { InputFormRef.ReInitPointer(GetBasePointer(PLIST_TYPE.CHANGE)); FEBuilderGBA.Address.AddAddress(list, InputFormRef, "MAPPOINTERS_WMAP_EVENT", new uint[] { 0 }); } List <U.AddrResult> mapSetting = MapSettingForm.MakeMapIDList(); for (int mapid = 0; mapid < mapSetting.Count; mapid++) { MapSettingForm.PLists plists = MapSettingForm.GetMapPListsWhereAddr(mapSetting[mapid].addr); //plists.mapchange_plist //別途処理 //plists.event_plist //別途処理 //plists.anime1_plist; //別途処理 //plists.anime2_plist; //別途処理 if (plists.config_plist > 0 && plists.config_plist < configList.Count) { uint pointer = configList[(int)plists.config_plist].addr; string name = "MAP:" + U.To0xHexString(mapid) + " MAP_CHIPSET" + U.ToHexString(plists.config_plist); FEBuilderGBA.Address.AddLZ77Pointer(list , pointer + 0 , name , isPointerOnly , FEBuilderGBA.Address.DataTypeEnum.LZ77MAPCONFIG); } if (plists.mappointer_plist > 0 && plists.mappointer_plist < mapList.Count) { uint pointer = mapList[(int)plists.mappointer_plist].addr; string name = "MAP:" + U.To0xHexString(mapid) + " MAP MAR:" + U.ToHexString(plists.mappointer_plist); FEBuilderGBA.Address.AddLZ77Pointer(list , pointer + 0 , name , isPointerOnly , FEBuilderGBA.Address.DataTypeEnum.LZ77MAPMAR); } if (plists.palette_plist > 0 && plists.palette_plist < objList.Count) { uint pointer = objList[(int)plists.palette_plist].addr; string name = "MAP:" + U.ToHexString(mapid) + " PALETTE:" + U.ToHexString(plists.palette_plist); uint size = 0x20 * MapStyleEditorForm.MAX_MAP_PALETTE_COUNT; FEBuilderGBA.Address.AddPointer(list , pointer + 0 , size , name , FEBuilderGBA.Address.DataTypeEnum.PAL); } if (plists.palette2_plist > 0 && plists.palette2_plist < objList.Count) { uint pointer = objList[(int)plists.palette2_plist].addr; string name = "MAP:" + U.ToHexString(mapid) + " SECOND PALETTE:" + U.ToHexString(plists.palette2_plist); uint size = 0x20 * MapStyleEditorForm.MAX_MAP_PALETTE_COUNT; FEBuilderGBA.Address.AddPointer(list , pointer + 0 , size , name , FEBuilderGBA.Address.DataTypeEnum.PAL); } uint obj_plist_low = (plists.obj_plist & 0xFF); uint obj_plist_high = ((plists.obj_plist >> 8) & 0xFF); if (obj_plist_low > 0 && obj_plist_low < objList.Count) { uint pointer = objList[(int)obj_plist_low].addr; string name = "MAP:" + U.ToHexString(mapid) + " OBJ:" + U.ToHexString(obj_plist_low); FEBuilderGBA.Address.AddLZ77Pointer(list , pointer + 0 , name , isPointerOnly , FEBuilderGBA.Address.DataTypeEnum.LZ77IMG); } if (obj_plist_high > 0 && obj_plist_high < objList.Count) { uint pointer = objList[(int)obj_plist_high].addr; string name = "MAP:" + U.ToHexString(mapid) + " OBJ:" + U.ToHexString(obj_plist_high); FEBuilderGBA.Address.AddLZ77Pointer(list , pointer + 0 , name , isPointerOnly , FEBuilderGBA.Address.DataTypeEnum.LZ77IMG); } } }
static List <U.AddrResult> ScanWithoutUI(InputFormRef.AutoPleaseWait pleaseWait, bool useIgnoreData) { List <U.AddrResult> errorMapUI = new List <U.AddrResult>(); List <U.AddrResult> maps = MapSettingForm.MakeMapIDList(); List <DisassemblerTrumb.LDRPointer> ldrmap; ldrmap = DisassemblerTrumb.MakeLDRMap(Program.ROM.Data, 0x100); //システム全体の問題 { if (pleaseWait != null) { pleaseWait.DoEvents(R._("システムチェック中")); } List <FELint.ErrorSt> errorList = FELint.ScanMAP(FELint.SYSTEM_MAP_ID, ldrmap); if (!useIgnoreData) { errorList = FELint.HiddenErrorFilter(errorList); } if (errorList.Count > 0) {//エラーがある U.AddrResult ar = new U.AddrResult(); ar.addr = FELint.SYSTEM_MAP_ID; ar.name = R._("システム"); ar.tag = (uint)errorList.Count; errorMapUI.Add(ar); } } for (int i = 0; i < maps.Count; i++) { if (pleaseWait != null) { pleaseWait.DoEvents(R._("調査中 {0}/{1}", i, maps.Count)); } uint mapid = (uint)i; U.AddrResult ar = new U.AddrResult(); //このマップのエラースキャン List <FELint.ErrorSt> errorList = FELint.ScanMAP(mapid, ldrmap); if (!useIgnoreData) { errorList = FELint.HiddenErrorFilter(errorList); } if (errorList.Count <= 0) {//エラーがない continue; } ar.addr = mapid; ar.name = maps[i].name; ar.tag = (uint)errorList.Count; errorMapUI.Add(ar); } return(errorMapUI); }
private void ToolExportEAEventForm_Load(object sender, EventArgs e) { //マップIDリストを作る. U.ConvertListBox(MapSettingForm.MakeMapIDList(), ref this.MAP_LISTBOX); }