private void B0_ValueChanged(object sender, EventArgs e) { PatchUtil.ItemUsingExtends itemUsingExtends = PatchUtil.ItemUsingExtendsPatch(); if (itemUsingExtends != PatchUtil.ItemUsingExtends.IER) { return; } uint skillScrollItemID = SkillConfigSkillSystemForm.FindSkillScrollItemID(); if (B0.Value != skillScrollItemID) { J_1.Text = R._("耐久"); SKILLNAME.Hide(); SKILLICON.Hide(); InputFormRef.UseDecMode(B1); } else { J_1.Text = R._("スキルID"); SKILLNAME.Show(); SKILLICON.Show(); InputFormRef.UseHexMode(B1); } }
//Skill + テキストを書くルーチン Size DrawSkillAndText(ListBox lb, int index, Graphics g, Rectangle listbounds, bool isWithDraw) { if (index < 0 || index >= lb.Items.Count) { return(new Size(listbounds.X, listbounds.Y)); } string text = lb.Items[index].ToString(); SolidBrush brush = new SolidBrush(lb.ForeColor); Font normalFont = lb.Font; Rectangle bounds = listbounds; int textmargineY = (ListBoxEx.OWNER_DRAW_ICON_SIZE - (int)lb.Font.Height) / 2; Bitmap bitmap = SkillConfigSkillSystemForm.DrawIcon((uint)index, this.IconBaseAddress); U.MakeTransparent(bitmap); //アイコンを描く. Rectangle b = bounds; b.Width = ListBoxEx.OWNER_DRAW_ICON_SIZE; b.Height = ListBoxEx.OWNER_DRAW_ICON_SIZE; bounds.X += U.DrawPicture(bitmap, g, isWithDraw, b); bitmap.Dispose(); //テキストを描く. b = bounds; b.Y += textmargineY; bounds.X += U.DrawText(text, g, normalFont, brush, isWithDraw, b); bounds.Y += ListBoxEx.OWNER_DRAW_ICON_SIZE; brush.Dispose(); return(new Size(bounds.X, bounds.Y)); }
public SkillAssignmentClassSkillSystemForm() { InitializeComponent(); uint iconP = SkillConfigSkillSystemForm.FindIconPointer(); uint textP = SkillConfigSkillSystemForm.FindTextPointer(); uint assignClassP = SkillConfigSkillSystemForm.FindAssignClassSkillPointer(); uint assignLevelUpP = SkillConfigSkillSystemForm.FindAssignClassLevelUpSkillPointer(); if (iconP == U.NOT_FOUND) { R.ShowStopError("スキル拡張 SkillSystem の、アイコンを取得できません。"); return; } if (textP == U.NOT_FOUND) { R.ShowStopError("スキル拡張 SkillSystem の、テキストを取得できません。"); return; } if (assignClassP == U.NOT_FOUND) { R.ShowStopError("スキル拡張 SkillSystem の、クラススキルを取得できません。"); return; } if (assignLevelUpP == U.NOT_FOUND) { R.ShowStopError("スキル拡張 SkillSystem の、レベルアップスキルを取得できません。"); return; } this.SkillNames = SkillConfigSkillSystemForm.LoadSkillNames(); this.TextBaseAddress = Program.ROM.p32(textP); this.IconBaseAddress = Program.ROM.p32(iconP); this.AssignClassBaseAddress = Program.ROM.p32(assignClassP); this.AssignLevelUpBaseAddress = Program.ROM.p32(assignLevelUpP); this.N1_AddressList.OwnerDraw(DrawSkillAndText, DrawMode.OwnerDrawFixed); InputFormRef.markupJumpLabel(this.N1_J_1_SKILLASSIGNMENT); N1_InputFormRef = N1_Init(this, this.SkillNames); N1_InputFormRef.PostAddressListExpandsEvent += N1_InputFormRef_AddressListExpandsEvent; N1_InputFormRef.MakeGeneralAddressListContextMenu(true); this.AddressList.OwnerDraw(ListBoxEx.DrawClassAndText, DrawMode.OwnerDrawFixed); InputFormRef.markupJumpLabel(this.J_0_SKILLASSIGNMENT); InputFormRef = Init(this, assignClassP); this.InputFormRef.MakeGeneralAddressListContextMenu(true); this.InputFormRef.CheckProtectionPaddingALIGN4 = false; U.SetIcon(ExportAllButton, Properties.Resources.icon_arrow); U.SetIcon(ImportAllButton, Properties.Resources.icon_upload); InputFormRef.markupJumpLabel(X_LEARNINFO); if (SkillConfigSkillSystemForm.IsClassSkillExtends()) { UseXLevelAddPanel = true; } }
//全データの取得 public static void MakeAllDataLength(List <Address> list) { InputFormRef InputFormRef; if (PatchUtil.SearchSkillSystem() != PatchUtil.skill_system_enum.SkillSystem) { return; } { uint iconP = SkillConfigSkillSystemForm.FindIconPointer(); uint textP = SkillConfigSkillSystemForm.FindTextPointer(); uint assignClassP = SkillConfigSkillSystemForm.FindAssignClassSkillPointer(); uint assignLevelUpP = SkillConfigSkillSystemForm.FindAssignClassLevelUpSkillPointer(); if (iconP == U.NOT_FOUND) { return; } if (textP == U.NOT_FOUND) { return; } if (assignClassP == U.NOT_FOUND) { return; } if (assignLevelUpP == U.NOT_FOUND) { return; } InputFormRef = Init(null, assignClassP); FEBuilderGBA.Address.AddAddress(list, InputFormRef, "SkillAssignmentClassSkillSystem", new uint[] { }); Dictionary <uint, string> skillNames = new Dictionary <uint, string>(); InputFormRef N1_InputFormRef = N1_Init(null, skillNames); uint assignLevelUpAddr = Program.ROM.p32(assignLevelUpP); for (uint i = 0; i < InputFormRef.DataCount; i++, assignLevelUpAddr += 4) { if (!U.isSafetyOffset(assignLevelUpAddr)) { break; } uint levelupList = Program.ROM.p32(assignLevelUpAddr); if (!U.isSafetyOffset(levelupList)) { continue; } N1_InputFormRef.ReInitPointer(assignLevelUpAddr); FEBuilderGBA.Address.AddAddress(list, N1_InputFormRef, "SkillAssignmentClassSkillSystem.Levelup" + i, new uint[] { }); } } }
public void InitExportFilter(uint filter) { List <UseValsID> list = new List <UseValsID>(); if (filter == 1) {//ユニット関係のみ UnitForm.MakeVarsIDArray(list); } else if (filter == 2) {//クラス関係のみ ClassForm.MakeVarsIDArray(list); } else if (filter == 3) {//アイテム関係のみ ItemForm.MakeVarsIDArray(list); } else if (filter == 4) {//サウンドルーム関係のみ if (Program.ROM.RomInfo.version == 6) { SoundRoomFE6Form.MakeVarsIDArray(list); } else { SoundRoomForm.MakeVarsIDArray(list); } } else if (filter == 5) {//支援会話関係 SupportTalkForm.MakeVarsIDArray(list); } else if (filter == 6) {//スキル関係 if (Program.ROM.RomInfo.is_multibyte) { SkillConfigFE8NSkillForm.MakeVarsIDArray(list); SkillConfigFE8NVer2SkillForm.MakeVarsIDArray(list); } else { SkillConfigSkillSystemForm.MakeVarsIDArray(list); } } else {//all ExportFilterArray = null; return; } ExportFilterArray = new Dictionary <int, bool>(); foreach (UseValsID val in list) { ExportFilterArray[(int)val.ID] = true; } }
public static void MakeCheckError(List <FELint.ErrorSt> errors) { InputFormRef InputFormRef; if (PatchUtil.SearchSkillSystem() != PatchUtil.skill_system_enum.SkillSystem) { return; } { uint assignUnitP = SkillConfigSkillSystemForm.FindAssignPersonalSkillPointer(); if (assignUnitP == U.NOT_FOUND) { return; } InputFormRef = Init(null, assignUnitP); uint assignLevelUpP = SkillConfigSkillSystemForm.FindAssignUnitLevelUpSkillPointer(); if (assignLevelUpP == U.NOT_FOUND) { return; } Dictionary <uint, string> skillNames = new Dictionary <uint, string>(); InputFormRef N1_InputFormRef = N1_Init(null, skillNames); uint assignLevelUpAddr = Program.ROM.p32(assignLevelUpP); for (uint i = 0; i < InputFormRef.DataCount; i++, assignLevelUpAddr += 4) { if (!U.isSafetyOffset(assignLevelUpAddr)) { errors.Add(new FELint.ErrorSt(FELint.Type.SKILL_UNIT, assignLevelUpAddr, R._("Skillのユニット割り当てが(UnitID: {0})までで、途中で終わってしまいました。", U.To0xHexString(i)), i)); break; } uint levelupList = Program.ROM.u32(assignLevelUpAddr); if (levelupList == 0) {//empty continue; } else if (!U.isSafetyPointer(levelupList)) { errors.Add(new FELint.ErrorSt(FELint.Type.SKILL_UNIT, assignLevelUpAddr, R._("Skillのユニット割り当て(UnitID: {0})のデータポインタ({1})が壊れています。\r\nこのユニットをLOADする時に無限ループが発生する可能性があります。\r\n正しいアドレスを入力するか、0に設定してください。", U.To0xHexString(i), U.To0xHexString(levelupList)), i)); continue; } N1_InputFormRef.ReInitPointer(assignLevelUpAddr); if (N1_InputFormRef.DataCount >= 20) { errors.Add(new FELint.ErrorSt(FELint.Type.SKILL_UNIT, assignLevelUpAddr, R._("Skillのユニット割り当て(UnitID: {0})のデータポインタ({1})には、大量の({2})個のデータが登録されています。\r\nアドレスが間違っていませんか?\r\n正しいアドレスを入力するか、0に設定してください。", U.To0xHexString(i), U.To0xHexString(levelupList), N1_InputFormRef.DataCount), i)); continue; } } } }
private void B35_ValueChanged(object sender, EventArgs e) { if (IsFE8UItemSkill()) { uint skillid = (uint)B35.Value; SKILLICON.Image = SkillConfigSkillSystemForm.DrawSkillIcon(skillid); SKILLNAME.Text = SkillConfigSkillSystemForm.GetSkillName(skillid); SKILLICON.Visible = true; SKILLNAME.Visible = true; } }
public SkillAssignmentUnitSkillSystemForm() { InitializeComponent(); uint icon = SkillConfigSkillSystemForm.FindIconPointer(); uint text = SkillConfigSkillSystemForm.FindTextPointer(); uint assignUnit = SkillConfigSkillSystemForm.FindAssignPersonalSkillPointer(); uint assignLevelUpP = SkillConfigSkillSystemForm.FindAssignUnitLevelUpSkillPointer(); if (icon == U.NOT_FOUND) { R.ShowStopError("スキル拡張 SkillSystem の、アイコンを取得できません。"); return; } if (text == U.NOT_FOUND) { R.ShowStopError("スキル拡張 SkillSystem の、テキストを取得できません。"); return; } if (assignUnit == U.NOT_FOUND) { R.ShowStopError("スキル拡張 SkillSystem の、個人スキルを取得できません。"); return; } this.SkillNames = SkillConfigSkillSystemForm.LoadSkillNames(); this.TextBaseAddress = Program.ROM.p32(text); this.IconBaseAddress = Program.ROM.p32(icon); this.AssignUnitBaseAddress = Program.ROM.p32(assignUnit); if (assignLevelUpP == U.NOT_FOUND) {//古いパッチでは、ユニットベースのレベルアップスキルが存在しない this.AssignLevelUpBaseAddress = U.NOT_FOUND; UnitLevelUpSkill.Hide(); } else { this.AssignLevelUpBaseAddress = Program.ROM.p32(assignLevelUpP); } this.AddressList.OwnerDraw(ListBoxEx.DrawUnitAndText, DrawMode.OwnerDrawFixed); InputFormRef.markupJumpLabel(this.J_0_SKILLASSIGNMENT); InputFormRef = Init(this, assignUnit); InputFormRef.MakeGeneralAddressListContextMenu(true); InputFormRef.CheckProtectionPaddingALIGN4 = false; this.N1_AddressList.OwnerDraw(DrawSkillAndText, DrawMode.OwnerDrawFixed); InputFormRef.markupJumpLabel(this.N1_J_1_SKILLASSIGNMENT); N1_InputFormRef = N1_Init(this, this.SkillNames); N1_InputFormRef.AddressListExpandsEvent += N1_InputFormRef_AddressListExpandsEvent; N1_InputFormRef.MakeGeneralAddressListContextMenu(true); InputFormRef.markupJumpLabel(X_LEARNINFO); }
public SkillAssignmentClassSkillSystemForm() { InitializeComponent(); uint iconP = SkillConfigSkillSystemForm.FindIconPointer(); uint textP = SkillConfigSkillSystemForm.FindTextPointer(); uint assignClassP = SkillConfigSkillSystemForm.FindAssignClassSkillPointer(); uint assignLevelUpP = SkillConfigSkillSystemForm.FindAssignClassLevelUpSkillPointer(); if (iconP == U.NOT_FOUND) { R.ShowStopError("スキル拡張 SkillSystem の、アイコンを取得できません。"); return; } if (textP == U.NOT_FOUND) { R.ShowStopError("スキル拡張 SkillSystem の、テキストを取得できません。"); return; } if (assignClassP == U.NOT_FOUND) { R.ShowStopError("スキル拡張 SkillSystem の、クラススキルを取得できません。"); return; } if (assignLevelUpP == U.NOT_FOUND) { R.ShowStopError("スキル拡張 SkillSystem の、レベルアップスキルを取得できません。"); return; } this.SkillNames = U.LoadDicResource(U.ConfigDataFilename("skill_extends_skillsystem_name_")); this.TextBaseAddress = Program.ROM.p32(textP); this.IconBaseAddress = Program.ROM.p32(iconP); this.AssignClassBaseAddress = Program.ROM.p32(assignClassP); this.AssignLevelUpBaseAddress = Program.ROM.p32(assignLevelUpP); this.N1_AddressList.OwnerDraw(DrawSkillAndText, DrawMode.OwnerDrawFixed); InputFormRef.markupJumpLabel(this.N1_J_1_SKILLASSIGNMENT); N1_InputFormRef = N1_Init(this, this.SkillNames); N1_InputFormRef.AddressListExpandsEvent += N1_InputFormRef_AddressListExpandsEvent; N1_InputFormRef.MakeGeneralAddressListContextMenu(true); this.AddressList.OwnerDraw(ListBoxEx.DrawClassAndText, DrawMode.OwnerDrawFixed); InputFormRef.markupJumpLabel(this.J_0_SKILLASSIGNMENT); InputFormRef = Init(this, assignClassP); this.InputFormRef.MakeGeneralAddressListContextMenu(true); this.InputFormRef.CheckProtectionPaddingALIGN4 = false; }
private void B1_ValueChanged(object sender, EventArgs e) { PatchUtil.ItemUsingExtends itemUsingExtends = PatchUtil.ItemUsingExtendsPatch(); if (itemUsingExtends != PatchUtil.ItemUsingExtends.IER) { return; } if (!SKILLNAME.Visible) { return; } uint skillid = (uint)B1.Value; SKILLICON.Image = SkillConfigSkillSystemForm.DrawSkillIcon(skillid); SKILLNAME.Text = SkillConfigSkillSystemForm.GetSkillName(skillid); }
public static Bitmap DrawIcon(uint skillid) { if (Program.ROM.RomInfo.version() != 8) { return(ImageUtil.BlankDummy()); } PatchUtil.skill_system_enum skillsystem = PatchUtil.SearchSkillSystem(); if (skillsystem == PatchUtil.skill_system_enum.SkillSystem) { Bitmap bitmap = SkillConfigSkillSystemForm.DrawSkillIcon(skillid); return(bitmap); } else if (skillsystem == PatchUtil.skill_system_enum.FE8N_ver2) { Bitmap bitmap = SkillConfigFE8NVer2SkillForm.DrawSkillIcon(skillid); return(bitmap); } return(ImageUtil.BlankDummy()); }
public static string GetSkillName(uint skillid) { if (Program.ROM.RomInfo.version() != 8) { return(""); } PatchUtil.skill_system_enum skillsystem = PatchUtil.SearchSkillSystem(); if (skillsystem == PatchUtil.skill_system_enum.SkillSystem) { string name = SkillConfigSkillSystemForm.GetSkillName(skillid); return(name); } else if (skillsystem == PatchUtil.skill_system_enum.FE8N_ver2) { string name = SkillConfigFE8NVer2SkillForm.GetSkillText(skillid); return(name); } return(""); }
public static int MakeClassSkillButtons(uint cid, Button[] buttons, ToolTipEx tooltip) { uint iconP = SkillConfigSkillSystemForm.FindIconPointer(); uint textP = SkillConfigSkillSystemForm.FindTextPointer(); uint assignClassP = SkillConfigSkillSystemForm.FindAssignClassSkillPointer(); uint assignLevelUpP = SkillConfigSkillSystemForm.FindAssignClassLevelUpSkillPointer(); if (iconP == U.NOT_FOUND) { return(0); } if (textP == U.NOT_FOUND) { return(0); } if (assignClassP == U.NOT_FOUND) { return(0); } if (assignLevelUpP == U.NOT_FOUND) { return(0); } InputFormRef InputFormRef = Init(null, assignClassP); List <U.AddrResult> list = InputFormRef.MakeList(); if (cid >= list.Count) { return(0); } uint classaddr = list[(int)cid].addr; if (!U.isSafetyOffset(classaddr)) { return(0); } uint icon = Program.ROM.p32(iconP); uint text = Program.ROM.p32(textP); uint assignLevelUp = Program.ROM.p32(assignLevelUpP); int skillCount = 0; uint b0 = Program.ROM.u8(classaddr); if (b0 > 0) {//クラスの基本スキル. Bitmap bitmap = SkillConfigSkillSystemForm.DrawIcon((uint)b0, icon); U.MakeTransparent(bitmap); buttons[0].BackgroundImage = bitmap; buttons[0].Tag = b0; string skillCaption = SkillConfigSkillSystemForm.GetSkillText((uint)b0, text); tooltip.SetToolTip(buttons[skillCount], skillCaption); skillCount++; } MakeUnitSkillButtonsList(cid, buttons, tooltip, assignLevelUpP, icon, text, skillCount); return(skillCount); }
public static int MakeUnitSkillButtonsList(uint id, Button[] buttons, ToolTipEx tooltip, uint assignLevelUpP, uint icon, uint text, int skillCount) { uint assignLevelUp = Program.ROM.p32(assignLevelUpP); if (!U.isSafetyOffset(assignLevelUp)) { return(skillCount); } uint assignLevelUpAddr = assignLevelUp + (id * 4); if (!U.isSafetyOffset(assignLevelUpAddr)) { return(skillCount); } uint levelupList = Program.ROM.p32(assignLevelUpAddr); if (!U.isSafetyOffset(levelupList)) { return(skillCount); } //レベルアップで覚えるスキル. Dictionary <uint, string> skillNames = new Dictionary <uint, string>(); InputFormRef N1_InputFormRef = N1_Init(null, skillNames); N1_InputFormRef.ReInit(levelupList); List <U.AddrResult> levelupSkillList = N1_InputFormRef.MakeList(); for (int i = 0; i < levelupSkillList.Count; i++) { uint levelUpSkillAddr = levelupSkillList[i].addr; uint level = Program.ROM.u8(levelUpSkillAddr + 0); uint skill = Program.ROM.u8(levelUpSkillAddr + 1); if (skill <= 0) { continue; } Bitmap bitmap = SkillConfigSkillSystemForm.DrawIcon(skill, icon); U.MakeTransparent(bitmap); buttons[skillCount].BackgroundImage = bitmap; buttons[skillCount].Tag = skill; string skillCaption = SkillConfigSkillSystemForm.GetSkillText(skill, text); if (level > 0 && level < 0xFF) { skillCaption = skillCaption + "\r\n" + R._("(Lv{0}で習得)", level); } tooltip.SetToolTip(buttons[skillCount], skillCaption); skillCount++; if (skillCount >= buttons.Length) { break; } } return(skillCount); }
public static bool ImportAllData(string filename) { InputFormRef InputFormRef; if (PatchUtil.SearchSkillSystem() != PatchUtil.skill_system_enum.SkillSystem) { return(false); } string[] lines = File.ReadAllLines(filename); { uint iconP = SkillConfigSkillSystemForm.FindIconPointer(); uint textP = SkillConfigSkillSystemForm.FindTextPointer(); uint assignClassP = SkillConfigSkillSystemForm.FindAssignClassSkillPointer(); uint assignLevelUpP = SkillConfigSkillSystemForm.FindAssignClassLevelUpSkillPointer(); if (iconP == U.NOT_FOUND) { return(false); } if (textP == U.NOT_FOUND) { return(false); } if (assignClassP == U.NOT_FOUND) { return(false); } if (assignLevelUpP == U.NOT_FOUND) { return(false); } InputFormRef = Init(null, assignClassP); Dictionary <uint, string> skillNames = new Dictionary <uint, string>(); InputFormRef N1_InputFormRef = N1_Init(null, skillNames); uint classBaseSkillAddr = InputFormRef.BaseAddress; uint assignLevelUpAddr = Program.ROM.p32(assignLevelUpP); for (uint i = 0; i < InputFormRef.DataCount; i++, assignLevelUpAddr += 4, classBaseSkillAddr += 1) { if (!U.isSafetyOffset(assignLevelUpAddr)) { break; } if (i >= lines.Length) { break; } string[] sp = lines[i].Split('\t'); if (sp.Length < 2) { continue; } { uint skill = U.atoh(sp[0]); Program.ROM.write_u8(classBaseSkillAddr + 0, skill); } uint levelupSkillAddr = U.atoh(sp[1]); if (U.isExtrendsROMArea(levelupSkillAddr) || levelupSkillAddr == 0) {//拡張領域、または0の値が設定されている場合は書き戻す Program.ROM.write_p32(assignLevelUpAddr, levelupSkillAddr); continue; } uint levelupList = Program.ROM.p32(assignLevelUpAddr); if (!U.isSafetyOffset(levelupList)) { continue; } N1_InputFormRef.ReInitPointer(assignLevelUpAddr); uint levelupAddr = N1_InputFormRef.BaseAddress; for (uint n = 0; n < N1_InputFormRef.DataCount; n++, levelupAddr += 2) { uint level = U.atoh(U.at(sp, 2 + (n * 2) + 0)); uint skill = U.atoh(U.at(sp, 2 + (n * 2) + 1)); Program.ROM.write_u8(levelupAddr + 0, level); Program.ROM.write_u8(levelupAddr + 1, skill); } } } return(true); }
public static void ExportAllData(string filename) { InputFormRef InputFormRef; if (PatchUtil.SearchSkillSystem() != PatchUtil.skill_system_enum.SkillSystem) { return; } List <string> lines = new List <string>(); { uint iconP = SkillConfigSkillSystemForm.FindIconPointer(); uint textP = SkillConfigSkillSystemForm.FindTextPointer(); uint assignClassP = SkillConfigSkillSystemForm.FindAssignClassSkillPointer(); uint assignLevelUpP = SkillConfigSkillSystemForm.FindAssignClassLevelUpSkillPointer(); if (iconP == U.NOT_FOUND) { return; } if (textP == U.NOT_FOUND) { return; } if (assignClassP == U.NOT_FOUND) { return; } if (assignLevelUpP == U.NOT_FOUND) { return; } InputFormRef = Init(null, assignClassP); Dictionary <uint, string> skillNames = new Dictionary <uint, string>(); InputFormRef N1_InputFormRef = N1_Init(null, skillNames); uint classBaseSkillAddr = InputFormRef.BaseAddress; uint assignLevelUpAddr = Program.ROM.p32(assignLevelUpP); for (uint i = 0; i < InputFormRef.DataCount; i++, assignLevelUpAddr += 4, classBaseSkillAddr += 1) { if (!U.isSafetyOffset(assignLevelUpAddr)) { break; } StringBuilder sb = new StringBuilder(); sb.Append(U.ToHexString(Program.ROM.u8(classBaseSkillAddr + 0))); uint levelupList = Program.ROM.p32(assignLevelUpAddr); sb.Append("\t"); sb.Append(U.ToHexString(levelupList)); if (!U.isSafetyOffset(levelupList)) { lines.Add(sb.ToString()); continue; } N1_InputFormRef.ReInitPointer(assignLevelUpAddr); uint levelupAddr = N1_InputFormRef.BaseAddress; for (uint n = 0; n < N1_InputFormRef.DataCount; n++, levelupAddr += 2) { sb.Append("\t"); sb.Append(U.ToHexString(Program.ROM.u8(levelupAddr + 0))); sb.Append("\t"); sb.Append(U.ToHexString(Program.ROM.u8(levelupAddr + 1))); } lines.Add(sb.ToString()); } } File.WriteAllLines(filename, lines); }
public static string MakeEAAutoDef(string target_filename, uint freearea, uint org_sp) { StringBuilder sb = new StringBuilder(); string target_text = File.ReadAllText(target_filename); if (IsInjectHackInstallation(target_text)) { sb.AppendLine("#include \"Extensions/Hack Installation.txt\""); } if (freearea == U.NOT_FOUND && org_sp == U.NOT_FOUND) { sb.AppendLine(String.Format("#include \"{0}\"\r\n" , Path.GetFileName(target_filename))); return(sb.ToString()); } EAUtil ea = new EAUtil(target_filename); for (int i = 0; i < ea.IfNDefList.Count; i++) { string ifndef_keyword = ea.IfNDefList[i]; switch (ifndef_keyword) { case "FreeSpace": if (freearea != 0) { sb.AppendLine("#define FreeSpace " + U.To0xHexString(freearea)); } break; } } sb.AppendLine("#define ItemImage " + U.To0xHexString(Program.ROM.p32(Program.ROM.RomInfo.icon_pointer()))); sb.AppendLine("#define ItemPalette " + U.To0xHexString(Program.ROM.p32(Program.ROM.RomInfo.icon_palette_pointer()))); sb.AppendLine("#define ItemTable " + U.To0xHexString(Program.ROM.p32(Program.ROM.RomInfo.item_pointer()))); sb.AppendLine("#define TextTable " + U.To0xHexString(Program.ROM.p32(Program.ROM.RomInfo.text_pointer()))); sb.AppendLine("#define PortraitTable " + U.To0xHexString(Program.ROM.p32(Program.ROM.RomInfo.face_pointer()))); if (Program.ROM.RomInfo.version() == 8) { sb.AppendLine("#define SummonUnitTable " + U.To0xHexString(Program.ROM.p32(Program.ROM.RomInfo.summon_unit_pointer()))); if (PatchUtil.SearchSkillSystem() == PatchUtil.skill_system_enum.SkillSystem) { SkillConfigSkillSystemForm.Export(sb); } } sb.AppendLine("#define AI1Table " + U.To0xHexString(Program.ROM.p32(Program.ROM.RomInfo.ai1_pointer()))); sb.AppendLine("#define AI2Table " + U.To0xHexString(Program.ROM.p32(Program.ROM.RomInfo.ai2_pointer()))); UnitActionPointerForm.SupportActionRework(sb); if (org_sp != U.NOT_FOUND) { sb.AppendLine("#define FEBUILDER_EXTRA_ORG " + U.To0xHexString(org_sp)); } Program.ExportFunction.ExportEA(sb); if (freearea != 0) { sb.AppendLine(String.Format("ORG {0}\r\n#include \"{1}\"\r\n" , U.To0xHexString(freearea), target_filename)); } else { sb.AppendLine(String.Format("#include \"{0}\"\r\n" , Path.GetFileName(target_filename))); } return(sb.ToString()); }
private void N1_B1_ValueChanged(object sender, EventArgs e) { N1_SKILLICON.Image = SkillConfigSkillSystemForm.DrawIcon((uint)this.N1_B1.Value, this.IconBaseAddress); N1_SKILLTEXT.Text = SkillConfigSkillSystemForm.GetSkillText((uint)this.N1_B1.Value, this.TextBaseAddress); N1_SKILLNAME.Text = U.at(this.SkillNames, (uint)this.N1_B1.Value); }
static void ScanSystem(List <FELint.ErrorSt> errors, List <DisassemblerTrumb.LDRPointer> ldrmap) { ROMCheck(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImageBattleAnimeForm")) { return; } ImageBattleAnimeForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImageBGForm")) { return; } ImageBGForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem UnitForm")) { return; } UnitForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ClassForm")) { return; } ClassForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ItemForm")) { return; } ItemForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem MoveCostForm")) { return; } MoveCostForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem PatchForm")) { return; } PatchForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImageUnitMoveIconFrom")) { return; } ImageUnitMoveIconFrom.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImageUnitWaitIconFrom")) { return; } ImageUnitWaitIconFrom.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ItemEffectPointerForm")) { return; } ItemEffectPointerForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImageUnitPaletteForm")) { return; } ImageUnitPaletteForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImageBattleScreen")) { return; } ImageBattleScreenForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImageMagic")) { return; } ImageMagicFEditorForm.MakeCheckError(errors); ImageMagicCSACreatorForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem Procs")) { return; } ProcsScriptForm.MakeCheckError(errors, ldrmap); if (InputFormRef.DoEvents(null, "ScanSystem MenuDefinition")) { return; } MenuDefinitionForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EventUnit")) { return; } EventUnitForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem AIScript")) { return; } AIScriptForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem SongTable")) { return; } SongTableForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ItemWeaponEffect")) { return; } ItemWeaponEffectForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImageMapActionAnimation")) { return; } ImageMapActionAnimationForm.MakeCheckError(errors); if (Program.ROM.RomInfo.version == 8) { if (InputFormRef.DoEvents(null, "ScanSystem SoundFootStepsForm")) { return; } SoundFootStepsForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImagePortraitForm")) { return; } ImagePortraitForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EventHaikuForm")) { return; } EventHaikuForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EventBattleTalkForm")) { return; } EventBattleTalkForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem SupportTalkForm")) { return; } SupportTalkForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem SupportUnitForm")) { return; } SupportUnitForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem SoundRoomForm")) { return; } SoundRoomForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EDForm")) { return; } EDForm.MakeCheckError(errors); if (Program.ROM.RomInfo.is_multibyte) { } else { SkillConfigSkillSystemForm.MakeCheckError(errors); SkillAssignmentClassSkillSystemForm.MakeCheckError(errors); SkillAssignmentUnitSkillSystemForm.MakeCheckError(errors); } } else if (Program.ROM.RomInfo.version == 7) { if (InputFormRef.DoEvents(null, "ScanSystem ImagePortraitForm")) { return; } ImagePortraitForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EventHaikuFE7Form")) { return; } EventHaikuFE7Form.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EventBattleTalkFE7Form")) { return; } EventBattleTalkFE7Form.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem SupportTalkFE7Form")) { return; } SupportTalkFE7Form.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem SupportUnitForm")) { return; } SupportUnitForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem SoundRoomForm")) { return; } SoundRoomForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EDForm")) { return; } EDFE7Form.MakeCheckError(errors); } else { if (InputFormRef.DoEvents(null, "ScanSystem ImagePortraitFE6Form")) { return; } ImagePortraitFE6Form.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EventHaikuFE6Form")) { return; } EventHaikuFE6Form.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EventBattleTalkFE6Form")) { return; } EventBattleTalkFE6Form.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem SupportTalkFE6Form")) { return; } SupportTalkFE6Form.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EDForm")) { return; } EDFE6Form.MakeCheckError(errors); } }
public static int MakeUnitSkillButtons(uint uid, Button[] buttons, ToolTipEx tooltip) { uint iconP = SkillConfigSkillSystemForm.FindIconPointer(); uint textP = SkillConfigSkillSystemForm.FindTextPointer(); uint assignUnitP = SkillConfigSkillSystemForm.FindAssignPersonalSkillPointer(); if (iconP == U.NOT_FOUND) { return(0); } if (textP == U.NOT_FOUND) { return(0); } if (assignUnitP == U.NOT_FOUND) { return(0); } InputFormRef InputFormRef = Init(null, assignUnitP); List <U.AddrResult> list = InputFormRef.MakeList(); if (uid < 0 || uid >= list.Count) { return(0); } uint classaddr = list[(int)uid].addr; if (!U.isSafetyOffset(classaddr)) { return(0); } uint b0 = Program.ROM.u8(classaddr); if (b0 <= 0) { return(0); } uint icon = Program.ROM.p32(iconP); uint text = Program.ROM.p32(textP); int skillCount = 0; { Bitmap bitmap = SkillConfigSkillSystemForm.DrawIcon((uint)b0, icon); U.MakeTransparent(bitmap); buttons[0].BackgroundImage = bitmap; buttons[0].Tag = b0; string skillCaption = SkillConfigSkillSystemForm.GetSkillText((uint)b0, text); tooltip.SetToolTipOverraide(buttons[skillCount], skillCaption); } skillCount++; //レベルアップで覚えるスキル. Dictionary <uint, string> skillNames = new Dictionary <uint, string>(); InputFormRef N1_InputFormRef = N1_Init(null, skillNames); uint assignLevelUpP = SkillConfigSkillSystemForm.FindAssignUnitLevelUpSkillPointer(); if (assignLevelUpP == U.NOT_FOUND) {//昔のバージョンには、存在しなかった return(skillCount); } SkillAssignmentClassSkillSystemForm.MakeUnitSkillButtonsList(uid, buttons, tooltip, assignLevelUpP, icon, text, skillCount); return(skillCount); }
public static string MakeEAAutoDef(string target_filename, uint freearea, uint org_sp, uint org_data, bool isColorzCore) { StringBuilder sb = new StringBuilder(); string target_text = File.ReadAllText(target_filename); if (IsInjectHackInstallation(target_text)) { sb.AppendLine("#include \"Extensions/Hack Installation.txt\""); } if (freearea == U.NOT_FOUND && org_sp == U.NOT_FOUND) { sb.AppendLine(String.Format("#include \"{0}\"\r\n" , Path.GetFileName(target_filename))); return(sb.ToString()); } EAUtil ea = new EAUtil(target_filename); for (int i = 0; i < ea.IfNDefList.Count; i++) { string ifndef_keyword = ea.IfNDefList[i]; switch (ifndef_keyword) { case "FreeSpace": if (freearea != 0) { sb.AppendLine("#define FreeSpace " + U.To0xHexString(freearea)); } break; } } sb.AppendLine("#define ItemImage " + U.To0xHexString(Program.ROM.p32(Program.ROM.RomInfo.icon_pointer))); sb.AppendLine("#define ItemPalette " + U.To0xHexString(Program.ROM.p32(Program.ROM.RomInfo.icon_palette_pointer))); sb.AppendLine("#define ItemTable " + U.To0xHexString(Program.ROM.p32(Program.ROM.RomInfo.item_pointer))); sb.AppendLine("#define TextTable " + U.To0xHexString(Program.ROM.p32(Program.ROM.RomInfo.text_pointer))); sb.AppendLine("#define PortraitTable " + U.To0xHexString(Program.ROM.p32(Program.ROM.RomInfo.portrait_pointer))); if (Program.ROM.RomInfo.version == 8) { sb.AppendLine("#define SummonUnitTable " + U.To0xHexString(Program.ROM.p32(Program.ROM.RomInfo.summon_unit_pointer))); if (PatchUtil.SearchSkillSystem() == PatchUtil.skill_system_enum.SkillSystem) { SkillConfigSkillSystemForm.Export(sb, isColorzCore); } } sb.AppendLine("#define AI1Table " + U.To0xHexString(Program.ROM.p32(Program.ROM.RomInfo.ai1_pointer))); sb.AppendLine("#define AI2Table " + U.To0xHexString(Program.ROM.p32(Program.ROM.RomInfo.ai2_pointer))); UnitActionPointerForm.SupportActionRework(sb); if (org_sp != U.NOT_FOUND) { sb.AppendLine("#define FEBUILDER_EXTRA_ORG " + U.To0xHexString(org_sp)); } if (org_data != U.NOT_FOUND) { sb.AppendLine("#define FEBUILDER_DATA_ORG " + U.To0xHexString(org_data)); } Program.ExportFunction.ExportEA(sb, isColorzCore); PatchUtil.skill_system_enum skillsystem = PatchUtil.SearchSkillSystem(); if (skillsystem == PatchUtil.skill_system_enum.SkillSystem) { if (sb.ToString().IndexOf("SkillTester") >= 0) { sb.AppendLine("#define SKILLSYSTEM_SKILL_TESTER SkillTester"); } } //魔法分離パッチ MagicSplitUtil.magic_split_enum magic_split = MagicSplitUtil.SearchMagicSplit(); if (magic_split == MagicSplitUtil.magic_split_enum.FE8NMAGIC) { sb.AppendLine("#define MAGIC_PATCH"); } else if (magic_split == MagicSplitUtil.magic_split_enum.FE8UMAGIC) { sb.AppendLine("#define USE_STRMAG_SPLIT"); } else if (magic_split == MagicSplitUtil.magic_split_enum.FE7UMAGIC) { sb.AppendLine("#define USE_STRMAG_SPLIT"); } if (freearea == 0 || freearea == U.NOT_FOUND) { sb.AppendLine(String.Format("#include \"{0}\"\r\n" , Path.GetFileName(target_filename))); } else { sb.AppendLine(String.Format("ORG {0}\r\n#include \"{1}\"\r\n" , U.To0xHexString(freearea), target_filename)); } return(sb.ToString()); }