private void AICoordinateForm_Load(object sender, EventArgs e) { List <Control> controls = InputFormRef.GetAllControls(this); InputFormRef.RegistNotifyNumlicUpdate(this.AllWriteButton, controls); InputFormRef.WriteButtonToYellow(this.AllWriteButton, false); uint mapid = MainSimpleMenuForm.GetCurrentMapID(); this.MapPictureBox.LoadMap(mapid); }
public AIASMCALLTALKForm() { InitializeComponent(); List <Control> controls = InputFormRef.GetAllControls(this); InputFormRef.makeLinkEventHandler("", controls, this.B0, this.L_0_UNIT, 0, "UNIT", new string[] { "" }); InputFormRef.makeLinkEventHandler("", controls, this.B0, this.L_0_UNITICON, 0, "UNITICON", new string[] { "" }); InputFormRef.makeLinkEventHandler("", controls, this.B1, this.L_1_UNIT, 1, "UNIT", new string[] { "" }); InputFormRef.makeLinkEventHandler("", controls, this.B1, this.L_1_UNITICON, 1, "UNITICON", new string[] { "" }); U.AddCancelButton(this); }
private void ClassForm_Load(object sender, EventArgs e) { List <Control> controls = InputFormRef.GetAllControls(this); this.X_Tooltip = InputFormRef.GetToolTip <ClassForm>(); InputFormRef.LoadCheckboxesResource("unitclass_checkbox_", controls, this.X_Tooltip, "", "L_40_BIT_", "L_41_BIT_", "L_42_BIT_", "L_43_BIT_"); if (Program.ROM.RomInfo.version() == 8) {//FE8の場合、分岐CCへ InputFormRef.markupJumpLabel(this.J_5); //スキル this.X_SkillType = PatchUtil.SearchSkillSystem(); if (this.X_SkillType == PatchUtil.skill_system_enum.SkillSystem || this.X_SkillType == PatchUtil.skill_system_enum.FE8N_ver2 ) { InputFormRef.markupJumpLabel(this.X_CLASSSKILL); this.X_CLASSSKILL.Show(); this.X_SkillButtons = new Button[] { X_SKILL_BUTTON1, X_SKILL_BUTTON2, X_SKILL_BUTTON3, X_SKILL_BUTTON4, X_SKILL_BUTTON5, X_SKILL_BUTTON6, X_SKILL_BUTTON7, X_SKILL_BUTTON8, X_SKILL_BUTTON9 }; for (int i = 0; i < this.X_SkillButtons.Length; i++) { this.X_SkillButtons[i].Click += X_CLASSSKILL_Button_Click; } } } //魔法分離パッチ MagicSplitUtil.magic_split_enum magic_split = MagicSplitUtil.SearchMagicSplit(); if (magic_split == MagicSplitUtil.magic_split_enum.FE8NMAGIC) { InitFE8NMagicExtends(controls); } else if (magic_split == MagicSplitUtil.magic_split_enum.FE7UMAGIC || magic_split == MagicSplitUtil.magic_split_enum.FE8UMAGIC) { InitFE7UMagicExtends(controls); } //クラス拡張を表示するかどうか if (ClassForm.IsShowClassExetdns(this.AddressList)) { AddressListExpandsButton_255.Show(); } else { this.AddressList.Height += AddressListExpandsButton_255.Height; AddressListExpandsButton_255.Hide(); } //SkillSystemsによる 特効リワーク InitFE8ClassType(controls); this.AddressList.Focus(); }
private void MenuExtendSplitMenuForm_Load(object sender, EventArgs e) { List <Control> controls = InputFormRef.GetAllControls(this); InputFormRef.makeLinkEventHandler("", controls, this.STR1, this.STR1_TEXT, 0, "TEXT", new string[] { }); InputFormRef.makeLinkEventHandler("", controls, this.STR2, this.STR2_TEXT, 0, "TEXT", new string[] { }); InputFormRef.makeLinkEventHandler("", controls, this.STR3, this.STR3_TEXT, 0, "TEXT", new string[] { }); InputFormRef.makeLinkEventHandler("", controls, this.STR4, this.STR4_TEXT, 0, "TEXT", new string[] { }); InputFormRef.makeLinkEventHandler("", controls, this.STR5, this.STR5_TEXT, 0, "TEXT", new string[] { }); InputFormRef.RegistNotifyNumlicUpdate(this.AllWriteButton, controls); InputFormRef.WriteButtonToYellow(this.AllWriteButton, false); }
public ExtraUnitForm() { InitializeComponent(); this.AddressList.OwnerDraw(ListBoxEx.DrawUnitAndText, DrawMode.OwnerDrawFixed); this.InputFormRef = Init(this); this.InputFormRef.MakeGeneralAddressListContextMenu(true); List <Control> controls = InputFormRef.GetAllControls(this); InputFormRef.makeLinkEventHandler("", controls, FLAG, FLAG_LABEL, 0, "FLAG", new string[] {}); InputFormRef.makeJumpEventHandler(FLAG, FLAG_JUMP, "FLAG", new string[] { }); }
public ToolMagicEffectMakerForm() { InitializeComponent(); List <Control> controls = InputFormRef.GetAllControls(this); InputFormRef.makeLinkEventHandler("", controls, SoundFire, SoundFireInfo, 0, "SONG", new string[] { }); InputFormRef.makeLinkEventHandler("", controls, SoundFire, SoundFirePlaySoundButton, 0, "SONGPLAY", new string[] { }); InputFormRef.makeLinkEventHandler("", controls, SoundHit, SoundHitInfo, 0, "SONG", new string[] { }); InputFormRef.makeLinkEventHandler("", controls, SoundHit, SoundHitPlaySoundButton, 0, "SONGPLAY", new string[] { }); this.ConvertType.SelectedIndex = 0; }
private void UnitFormFE7_Load(object sender, EventArgs e) { List <Control> controls = InputFormRef.GetAllControls(this); ToolTipEx tooltip = InputFormRef.GetToolTip <UnitFE7Form>(); InputFormRef.LoadCheckboxesResource(U.ConfigDataFilename("unitclass_checkbox_"), controls, tooltip, "", "L_40_BIT_", "L_41_BIT_", "L_42_BIT_", "L_43_BIT_"); //魔法分離パッチ MagicSplitUtil.magic_split_enum magic_split = MagicSplitUtil.SearchMagicSplit(); if (magic_split == MagicSplitUtil.magic_split_enum.FE7UMAGIC) { InitFE7UMagicExtends(controls); } }
private void ImageUnitPaletteForm_Load(object sender, EventArgs e) { this.CurrntControls = InputFormRef.GetAllControls(this); InputFormRef.makeJumpEventHandler(this.X_BATTLEANIME, this.X_BATTLEANIME_LABEL, "BATTLEANIME", new string[] { "MINUS1" }); InputFormRef.makeLinkEventHandler("X_", this.CurrntControls, this.X_BATTLEANIME, this.X_BATTLEANIME_INFO, 0, "BATTLEANIME", new string[] { }); U.AllowDropFilename(this, ImageFormRef.IMAGE_FILE_FILTER, (string filename) => { using (ImageFormRef.AutoDrag ad = new ImageFormRef.AutoDrag(filename)) { ImportButton_Click(null, null); } }); }
public AIASMUnit4Form() { InitializeComponent(); List <Control> controls = InputFormRef.GetAllControls(this); InputFormRef.makeLinkEventHandler("", controls, this.B0, this.L_0_UNIT, 0, "UNIT", new string[] { "" }); InputFormRef.makeLinkEventHandler("", controls, this.B0, this.L_0_UNITICON, 0, "UNITICON", new string[] { "" }); InputFormRef.makeLinkEventHandler("", controls, this.B1, this.L_1_UNIT, 1, "UNIT", new string[] { "" }); InputFormRef.makeLinkEventHandler("", controls, this.B1, this.L_1_UNITICON, 1, "UNITICON", new string[] { "" }); InputFormRef.makeLinkEventHandler("", controls, this.B2, this.L_2_UNIT, 2, "UNIT", new string[] { "" }); InputFormRef.makeLinkEventHandler("", controls, this.B2, this.L_2_UNITICON, 2, "UNITICON", new string[] { "" }); InputFormRef.makeLinkEventHandler("", controls, this.B3, this.L_3_UNIT, 3, "UNIT", new string[] { "" }); InputFormRef.makeLinkEventHandler("", controls, this.B3, this.L_3_UNITICON, 3, "UNITICON", new string[] { "" }); }
bool CheckImportData(InputFormRef ifr, string filename, bool isCSV) { List <Control> controls = InputFormRef.GetAllControls(ifr.SelfForm); ListBox listbox = ifr.AddressList; List <NameMapping> dic = MakeStruct(ifr, controls); uint addr = ifr.BaseAddress; string[] lines = File.ReadAllLines(filename); if (lines.Length > ifr.DataCount + 1) { DialogResult dr = R.ShowNoYes("件数が足りませんが、処理を続行しますか?\r\n現在{0}件しかテーブルを確保していませんが、インポートしようとしているファイルには、{1}件のデータがあります。\r\n\r\n処理を続行して、インポートできるところまで、インポートしますか?", ifr.DataCount, lines.Length - 1); if (dr != System.Windows.Forms.DialogResult.Yes) { return(false); } } for (int i = 1; i < lines.Length; i++, addr += ifr.BlockSize) { if (i > ifr.DataCount) { break; } string line = lines[i]; uint[] array; if (isCSV) { array = U.ParseTSVLine(line, true, ','); } else { array = U.ParseTSVLine(line, true); } if (dic.Count != array.Length) { DialogResult dr = R.ShowNoYes("{0}行目のカラム数が想定の物と違いますが、処理を続行しますか?\r\nこの項目には、{1}件のデータカラム数が必要ですが、インポートしようとしているファイルには、{2}件のデータカラム数があります。\r\nこのファイルは正しいダンプファイルですか?\r\n\r\n処理を続行して、インポートできるところまで、インポートしますか?", i + 1, dic.Count, array.Length); return(dr == System.Windows.Forms.DialogResult.Yes); } } { DialogResult dr = R.ShowYesNo("ファイル({0})の内容をインポートしてもよろしいですか?", Path.GetFileName(filename)); return(dr == System.Windows.Forms.DialogResult.Yes); } }
public void JumpTo(EventScript.ArgType argtype, uint value) { B40.Value = value & 0xff; B41.Value = (value >> 8) & 0xff; string dataname; if (argtype == EventScript.ArgType.DISABLEOPTIONS) { this.Text = "DISABLEOPTIONS"; this.MESSAGE.Text = R._("チェックをつけたメニューを無効にします。"); dataname = "DISABLEOPTIONS_checkbox_"; } else if (argtype == EventScript.ArgType.DISABLEWEAPONS) { this.Text = "DISABLEWEAPONS"; this.MESSAGE.Text = R._("チェックをつけたメニューを無効にします。"); dataname = "DISABLEWEAPONS_checkbox_"; } else if (argtype == EventScript.ArgType.IGNORE_KEYS) { this.Text = "IGNORE_KEYS"; this.MESSAGE.Text = R._("チェックをつけたキーを無効にします。"); dataname = "IGNORE_KEYS_checkbox_"; } else if (argtype == EventScript.ArgType.KEYS) { this.Text = "KEYS"; this.MESSAGE.Text = R._("チェックをつけたキーコードを返します。"); dataname = "IGNORE_KEYS_checkbox_"; } else if (argtype == EventScript.ArgType.ATTACK_TYPE) { this.Text = "ATTACK_TYPE"; this.MESSAGE.Text = R._("チェックをつけた攻撃を行います。"); dataname = "EVENTBATTLE_checkbox_"; } else { return; } List <Control> controls = InputFormRef.GetAllControls(this); X_Tooltip = InputFormRef.GetToolTip <UshortBitFlagForm>(); InputFormRef.LoadCheckboxesResource(dataname, controls, X_Tooltip, "", "L_40_BIT_", "L_41_BIT_", "L_42_BIT_", "L_43_BIT_"); }
public string MakeStructString(InputFormRef ifr) { List <Control> controls = InputFormRef.GetAllControls(ifr.SelfForm); ListBox listbox = ifr.AddressList; List <NameMapping> dic = MakeStruct(ifr, controls); StringBuilder sb = new StringBuilder(); sb.AppendLine("struct " + ifr.SelfForm.Name + " {" + "//" + ifr.SelfForm.Text); foreach (NameMapping nm in dic) { string comment = ";//" + nm.GetName(); if (nm.TypeName[0] == 'b') { sb.AppendLine("sbyte _" + nm.Id + comment); } else if (nm.TypeName[0] == 'l') { sb.AppendLine("byte _" + nm.Id + comment); } else if (nm.TypeName[0] == 'h') { } else if (nm.TypeName[0] == 'B') { sb.AppendLine("byte _" + nm.Id + comment); } else if (nm.TypeName[0] == 'W') { sb.AppendLine("ushort _" + nm.Id + comment); } else if (nm.TypeName[0] == 'D') { sb.AppendLine("dword _" + nm.Id + comment); } else if (nm.TypeName[0] == 'P') { sb.AppendLine("void* _" + nm.Id + comment); } } sb.AppendLine("}; sizeof(" + ifr.BlockSize + ")"); return(sb.ToString()); }
private void ClassFE6Form_Load(object sender, EventArgs e) { List <Control> controls = InputFormRef.GetAllControls(this); ToolTipEx tooltip = InputFormRef.GetToolTip <ClassFE6Form>(); InputFormRef.LoadCheckboxesResource(U.ConfigDataFilename("unitclass_checkbox_"), controls, tooltip, "", "L_36_BIT_", "L_37_BIT_", "L_38_BIT_", "L_39_BIT_"); if (ClassForm.IsShowClassExetdns(this.AddressList)) { AddressListExpandsButton_255.Show(); } else { this.AddressList.Height += AddressListExpandsButton_255.Height; AddressListExpandsButton_255.Hide(); } }
public SkillSystemsEffectivenessReworkClassTypeForm() { InitializeComponent(); L_50_BIT_01.Text = R._("アーマー系"); L_50_BIT_02.Text = R._("騎兵系"); L_50_BIT_04.Text = R._("飛行系"); L_50_BIT_08.Text = R._("ドラゴン系"); L_50_BIT_10.Text = R._("モンスター系"); L_50_BIT_20.Text = R._("ソード系"); L_50_BIT_40.Text = R._("不明1"); L_50_BIT_80.Text = R._("不明2"); List <Control> controls = InputFormRef.GetAllControls(this); InputFormRef.MakeLinkEvent("", controls); U.AddCancelButton(this); }
public static void MakePaletteUI(Form self, Func <Color, int, bool> onChangeColor, Func <Bitmap> getSampleBitmap) { List <Control> controls = InputFormRef.GetAllControls(self); for (int paletteno = 1; paletteno <= 16; paletteno++) { Label p = (Label)MakePaletteUI_FindObject <Label>(controls, "P", paletteno); NumericUpDown r = (NumericUpDown)MakePaletteUI_FindObject <NumericUpDown>(controls, "R", paletteno); NumericUpDown g = (NumericUpDown)MakePaletteUI_FindObject <NumericUpDown>(controls, "G", paletteno); NumericUpDown b = (NumericUpDown)MakePaletteUI_FindObject <NumericUpDown>(controls, "B", paletteno); p.MouseClick += MakePaletteUI_Label_MouseClickEvent(self, controls, p, paletteno); p.Cursor = Cursors.Hand; ContextMenu contextMenu = new System.Windows.Forms.ContextMenu(); MenuItem menuItem; menuItem = new MenuItem(R._("色の交換")); menuItem.Click += MakePaletteUI_Label_ColorSwap(self, controls, p, paletteno); contextMenu.MenuItems.Add(menuItem); menuItem = new MenuItem(R._("色違いを作る")); menuItem.Click += MakePaletteUI_Label_ColorChanges(self, controls, p, paletteno, getSampleBitmap); contextMenu.MenuItems.Add(menuItem); p.ContextMenu = contextMenu; EventHandler r_eh = MakePaletteUI_NumericUpDown_ChangeEvent(self, controls, r, "R", paletteno, onChangeColor); r.ValueChanged += r_eh; r.Tag = r_eh; r.Increment = 1 << 3; EventHandler g_eh = MakePaletteUI_NumericUpDown_ChangeEvent(self, controls, g, "G", paletteno, onChangeColor); g.ValueChanged += g_eh; g.Tag = g_eh; g.Increment = 1 << 3; EventHandler b_eh = MakePaletteUI_NumericUpDown_ChangeEvent(self, controls, b, "B", paletteno, onChangeColor); b.ValueChanged += b_eh; b.Tag = b_eh; b.Increment = 1 << 3; } }
bool OnCloseingCheckWriteConfirmation(int tabIndex) { if (tabIndex < 0 || tabIndex >= this.TabCount) { return(true); } TabPage tab = this.TabPages[tabIndex]; List <Control> controls = InputFormRef.GetAllControls(tab); if (InputFormRef.IsChangeContents(controls)) { DialogResult dr = R.ShowNoYes("書き込んでいないデータがありますが、フォームを閉じてもよろしいですか?"); if (dr != System.Windows.Forms.DialogResult.Yes) {//ユーザキャンセル. return(false); } } return(true); }
public static byte[] MakePaletteUIToByte(Form self) { byte[] palttebyte = new byte[16 * 2]; List <Control> controls = InputFormRef.GetAllControls(self); for (int paletteno = 1; paletteno <= 16; paletteno++) { NumericUpDown r = (NumericUpDown)MakePaletteUI_FindObject <NumericUpDown>(controls, "R", paletteno); NumericUpDown g = (NumericUpDown)MakePaletteUI_FindObject <NumericUpDown>(controls, "G", paletteno); NumericUpDown b = (NumericUpDown)MakePaletteUI_FindObject <NumericUpDown>(controls, "B", paletteno); uint dr = (((uint)r.Value) >> 3) & 0x1F; uint dg = (((uint)g.Value) >> 3) & 0x1F; uint db = (((uint)b.Value) >> 3) & 0x1F; uint dp = dr + (dg << 5) + (db << 10); U.write_u16(palttebyte, (uint)((paletteno - 1) * 2), dp); } return(palttebyte); }
private void ItemForm_Load(object sender, EventArgs e) { List <Control> controls = InputFormRef.GetAllControls(this); ToolTipEx tooltip = InputFormRef.GetToolTip <ItemForm>(); InputFormRef.LoadCheckboxesResource("item_checkbox_", controls, tooltip, "", "L_8_BIT_", "L_9_BIT_", "L_10_BIT_", "L_11_BIT_"); FE8UItemSkill(); //英語版の魔法分離パッチ MagicSplitUtil.magic_split_enum magic_split = MagicSplitUtil.SearchMagicSplit(); if (magic_split == MagicSplitUtil.magic_split_enum.FE8UMAGIC || magic_split == MagicSplitUtil.magic_split_enum.FE7UMAGIC) { MagicExtUnitBaseLabel.Show(); MagicExtUnitBase.Show(); } VennouWeaponLockArray(controls); this.AddressList.Focus(); }
private void UnitForm_Load(object sender, EventArgs e) { List <Control> controls = InputFormRef.GetAllControls(this); X_Tooltip = InputFormRef.GetToolTip <UnitForm>(); InputFormRef.LoadCheckboxesResource("unitclass_checkbox_", controls, X_Tooltip, "", "L_40_BIT_", "L_41_BIT_", "L_42_BIT_", "L_43_BIT_"); if (Program.ROM.RomInfo.version == 8) {//FE8の場合 //スキル X_SkillType = PatchUtil.SearchSkillSystem(); if (X_SkillType == PatchUtil.skill_system_enum.SkillSystem || X_SkillType == PatchUtil.skill_system_enum.FE8N_ver2 || X_SkillType == PatchUtil.skill_system_enum.FE8N_ver3 ) { InputFormRef.markupJumpLabel(this.X_UNITSKILL); this.X_UNITSKILL.Show(); this.X_SkillButtons = new Button[] { X_SKILL_BUTTON1, X_SKILL_BUTTON2, X_SKILL_BUTTON3, X_SKILL_BUTTON4, X_SKILL_BUTTON5, X_SKILL_BUTTON6, X_SKILL_BUTTON7, X_SKILL_BUTTON8, X_SKILL_BUTTON9 }; for (int i = 0; i < this.X_SkillButtons.Length; i++) { this.X_SkillButtons[i].Click += X_UNITSKILL_Button_Click; } } //魔法分離パッチ MagicSplitUtil.magic_split_enum magic_split = MagicSplitUtil.SearchMagicSplit(); if (magic_split == MagicSplitUtil.magic_split_enum.FE8NMAGIC) { InitFE8NMagicExtends(controls); } else if (magic_split == MagicSplitUtil.magic_split_enum.FE8UMAGIC) { InitFE8UMagicExtends(controls); } } this.AddressList.Focus(); }
public ToolProblemReportForm() { InitializeComponent(); InputFormRef.TabControlHideTabOption(MainTab); OrignalFilename.AllowDropFilename(); SetExplain(); List <Control> controls = InputFormRef.GetAllControls(this); InputFormRef.makeLinkEventHandler("", controls, this.X_MapID, this.X_MapName, 0, "MAP", new string[] { }); U.ForceUpdate(this.X_MapID, 0); InputFormRef.makeLinkEventHandler("", controls, this.X_UnitID, this.X_UnitName, 0, "UNIT", new string[] { }); InputFormRef.makeLinkEventHandler("", controls, this.X_UnitID, this.X_UnitIcon, 0, "UNITICON", new string[] { }); U.ForceUpdate(this.X_UnitID, 1); this.Problem.Placeholder = R._("例: 主人公が戦闘しようとするとフリーズします。\r\n主人公以外のキャラクタでも発生します。\r\n武器や魔法を変更してもフリーズします。\r\n序章で、エイリークがグラド兵と戦闘するとフリーズを再現できます。\r\n(どういう問題があるか、どうしたら問題を再現できるか、できるだけ詳しい情報を書いてください)"); this.URLTextBoxEx.Text = MainFormUtil.GetCommunitiesURL(); this.AboutReport7zText.Text = MainFormUtil.GetReport7zURL(); }
public static void MakePaletteBitmapToUI(Form self, Bitmap bitmap, int palette_index) { ColorPalette pal = bitmap.Palette; List <Control> controls = InputFormRef.GetAllControls(self); for (int paletteno = 1; paletteno <= 16; paletteno++) { NumericUpDown r = (NumericUpDown)MakePaletteUI_FindObject <NumericUpDown>(controls, "R", paletteno); NumericUpDown g = (NumericUpDown)MakePaletteUI_FindObject <NumericUpDown>(controls, "G", paletteno); NumericUpDown b = (NumericUpDown)MakePaletteUI_FindObject <NumericUpDown>(controls, "B", paletteno); int index = palette_index * 0x10 + (paletteno - 1); byte dr = (byte)((pal.Entries[index].R)); byte dg = (byte)((pal.Entries[index].G)); byte db = (byte)((pal.Entries[index].B)); //0だと ChangeValueイベントが発生しないので・・・ if (0 == dr) { r.Value = 1; } r.Value = dr; if (0 == dg) { g.Value = 1; } g.Value = dg; if (0 == db) { b.Value = 1; } b.Value = db; } }
private void AIRangeForm_Load(object sender, EventArgs e) { uint mapid = MainSimpleMenuForm.GetCurrentMapID(); this.MapPictureBox.LoadMap(mapid); uint addr = (uint)this.ReadStartAddress.Value; if (!U.isSafetyOffset(addr + 3)) { return; } this.B0.Value = Program.ROM.u8(addr + 0); this.B1.Value = Program.ROM.u8(addr + 1); this.B2.Value = Program.ROM.u8(addr + 2); this.B3.Value = Program.ROM.u8(addr + 3); List <Control> controls = InputFormRef.GetAllControls(this); InputFormRef.RegistNotifyNumlicUpdate(this.AllWriteButton, controls); InputFormRef.WriteButtonToYellow(this.AllWriteButton, false); this.ActiveControl = this.B0; }
public string MakNMMString(InputFormRef ifr, string basefilename, Dictionary <string, string> addFiles) { List <Control> controls = InputFormRef.GetAllControls(ifr.SelfForm); ListBox listbox = ifr.AddressList; List <NameMapping> dic = MakeStruct(ifr, controls); StringBuilder sb = new StringBuilder(); sb.AppendLine("1"); sb.AppendLine(ifr.SelfForm.Text + " by FEBuilderGBA"); sb.AppendLine(U.To0xHexString(ifr.BaseAddress)); sb.AppendLine(ifr.DataCount.ToString()); sb.AppendLine(ifr.BlockSize.ToString()); { string dropDownFilename = MakeNMMDropDownList(ifr, basefilename, addFiles, controls, "INDEX", 0); sb.AppendLine(dropDownFilename); } sb.AppendLine("NULL"); sb.AppendLine(""); foreach (NameMapping nm in dic) { string name = nm.GetName(); sb.AppendLine(name); sb.AppendLine(nm.Id.ToString()); //index bool is_unsigned = true; if (nm.TypeName[0] == 'b') { sb.AppendLine("1"); //size is_unsigned = false; } else if (nm.TypeName[0] == 'l') { sb.AppendLine("1"); //size is_unsigned = false; } else if (nm.TypeName[0] == 'h') { continue; } else if (nm.TypeName[0] == 'B') { sb.AppendLine("1"); //size } else if (nm.TypeName[0] == 'W') { sb.AppendLine("2"); //size } else if (nm.TypeName[0] == 'D') { sb.AppendLine("4"); //size } else if (nm.TypeName[0] == 'P') { sb.AppendLine("4"); //size } string[] args; string linktype = NameToArgs(nm.LabelName(), ifr.Prefix, out args); string dropDownFilename = MakeNMMDropDownList(ifr, basefilename, addFiles, controls, linktype, (int)nm.Id); string type = "N"; if (dropDownFilename == "NULL") { type += "E"; } else { type += "D"; } if (nm.Value.Hexadecimal) {//16進数 type += "H"; } else {//10進数 type += "D"; } if (is_unsigned) { type += "U"; } else { type += "S"; } sb.AppendLine(type); sb.AppendLine(dropDownFilename); sb.AppendLine(); } return(sb.ToString()); }
string MakEA2String(InputFormRef ifr, uint target) { List <Control> controls = InputFormRef.GetAllControls(ifr.SelfForm); ListBox listbox = ifr.AddressList; List <NameMapping> dic = MakeStruct(ifr, controls); StringBuilder sb = new StringBuilder(); sb.Append("//"); foreach (NameMapping nm in dic) { string comment = nm.GetName(); sb.Append("\t"); if (nm.TypeName[0] == 'b') { sb.Append(comment); } else if (nm.TypeName[0] == 'l') { sb.Append(comment); } else if (nm.TypeName[0] == 'h') { } else if (nm.TypeName[0] == 'B') { sb.Append(comment); } else if (nm.TypeName[0] == 'W') { sb.Append(comment); } else if (nm.TypeName[0] == 'D') { sb.Append(comment); } else if (nm.TypeName[0] == 'P') { sb.Append(comment); } } U.AddrResult[] addr_array; if (target == U.NOT_FOUND) { addr_array = new U.AddrResult[ifr.DataCount]; for (int i = 0; i < ifr.DataCount; i++) { addr_array[i] = InputFormRef.SelectToAddrResult(listbox, i); } } else { addr_array = new U.AddrResult[] { InputFormRef.SelectToAddrResult(listbox, (int)target) }; } sb.AppendLine(""); sb.AppendLine("PUSH"); sb.AppendLine("ORG " + U.To0xHexString(addr_array[0].addr)); string lastData = ""; for (int i = 0; i < addr_array.Length; i++) { string line = ""; U.AddrResult ar = addr_array[i]; if (ar.isNULL()) { continue; } uint addr = ar.addr; foreach (NameMapping nm in dic) { if (nm.TypeName[0] == 'b') { if (lastData != "BYTE") { lastData = "BYTE"; line += ";" + lastData; } line += " "; uint v = Program.ROM.u8(addr + nm.Id); if (nm.Value.Hexadecimal) { line += U.To0xHexString(v); } else { line += (sbyte)v; } } else if (nm.TypeName[0] == 'l') { if (lastData != "BYTE") { lastData = "BYTE"; line += ";" + lastData; } line += " "; uint v = Program.ROM.u8(addr + nm.Id); if (nm.Value.Hexadecimal) { line += U.To0xHexString(v); } else { line += (sbyte)v; } } else if (nm.TypeName[0] == 'h') { } else if (nm.TypeName[0] == 'B') { if (lastData != "BYTE") { lastData = "BYTE"; line += ";" + lastData; } line += " "; uint v = Program.ROM.u8(addr + nm.Id); if (nm.Value.Hexadecimal) { line += U.To0xHexString(v); } else { line += v; } } else if (nm.TypeName[0] == 'W') { if (lastData != "SHORT") { lastData = "SHORT"; line += ";" + lastData; } line += " "; uint v = Program.ROM.u16(addr + nm.Id); if (nm.Value.Hexadecimal) { line += U.To0xHexString(v); } else { line += v; } } else if (nm.TypeName[0] == 'D') { if (lastData != "WORD") { lastData = "WORD"; line += ";" + lastData; } line += " "; uint v = Program.ROM.u32(addr + nm.Id); if (nm.Value.Hexadecimal) { line += U.To0xHexString(v); } else { line += v; } } else if (nm.TypeName[0] == 'P') { if (lastData != "POIN") { lastData = "POIN"; line += ";" + lastData; } line += " "; uint v = Program.ROM.p32(addr + nm.Id); if (nm.Value.Hexadecimal) { line += U.To0xHexString(v); } else { line += v; } } } line = line + " " + "//" + ar.name; lastData = ""; sb.AppendLine(U.substr(line, 1)); } sb.AppendLine("POP"); return(sb.ToString()); }
public static void ImportTSV(InputFormRef ifr, bool isCSV, string filename, Undo.UndoData undodata) { List <Control> controls = InputFormRef.GetAllControls(ifr.SelfForm); ListBox listbox = ifr.AddressList; List <NameMapping> dic = MakeStruct(ifr, controls); uint addr = ifr.BaseAddress; string[] lines = File.ReadAllLines(filename); for (int i = 1; i < lines.Length; i++, addr += ifr.BlockSize) { if (i > ifr.DataCount) { break; } string line = lines[i]; uint[] array; if (isCSV) { array = U.ParseTSVLine(line, true, ','); } else { array = U.ParseTSVLine(line, true); } for (int n = 0; n < dic.Count; n++) { if (n >= array.Length) { break; } NameMapping nm = dic[n]; uint v = array[n]; if (nm.TypeName[0] == 'b') { Program.ROM.write_u8(addr + nm.Id, v, undodata); } else if (nm.TypeName[0] == 'l') { Program.ROM.write_u8(addr + nm.Id, v, undodata); } else if (nm.TypeName[0] == 'h') { continue; } else if (nm.TypeName[0] == 'B') { Program.ROM.write_u8(addr + nm.Id, v, undodata); } else if (nm.TypeName[0] == 'W') { Program.ROM.write_u16(addr + nm.Id, v, undodata); } else if (nm.TypeName[0] == 'D') { Program.ROM.write_u32(addr + nm.Id, v, undodata); } else if (nm.TypeName[0] == 'P') { Program.ROM.write_p32(addr + nm.Id, v, undodata); } } } }
string MakeTSVString(InputFormRef ifr, bool isCSV) { List <Control> controls = InputFormRef.GetAllControls(ifr.SelfForm); ListBox listbox = ifr.AddressList; List <NameMapping> dic = MakeStruct(ifr, controls); StringBuilder sb = new StringBuilder(); sb.Append(U.To0xHexString(ifr.BaseAddress)); foreach (NameMapping nm in dic) { string comment = nm.GetName(); if (isCSV) { sb.Append(","); comment = U.EncloseDoubleQuotesIfNeed(comment); } else { sb.Append("\t"); } if (nm.TypeName[0] == 'b') { sb.Append(comment); } else if (nm.TypeName[0] == 'l') { sb.AppendLine(comment); } else if (nm.TypeName[0] == 'h') { } else if (nm.TypeName[0] == 'B') { sb.Append(comment); } else if (nm.TypeName[0] == 'W') { sb.Append(comment); } else if (nm.TypeName[0] == 'D') { sb.Append(comment); } else if (nm.TypeName[0] == 'P') { sb.Append(comment); } } U.AddrResult[] addr_array; addr_array = new U.AddrResult[ifr.DataCount]; for (int i = 0; i < ifr.DataCount; i++) { addr_array[i] = InputFormRef.SelectToAddrResult(listbox, i); } sb.AppendLine(""); for (int i = 0; i < addr_array.Length; i++) { U.AddrResult ar = addr_array[i]; if (ar.isNULL()) { continue; } if (isCSV) { sb.Append(U.EncloseDoubleQuotesIfNeed(ar.name)); } else { sb.Append(ar.name); } uint addr = ar.addr; foreach (NameMapping nm in dic) { if (isCSV) { sb.Append(","); } else { sb.Append("\t"); } if (nm.TypeName[0] == 'b') { uint v = Program.ROM.u8(addr + nm.Id); sb.Append(U.To0xHexString(v)); } else if (nm.TypeName[0] == 'l') { uint v = Program.ROM.u8(addr + nm.Id); sb.Append(U.To0xHexString(v)); } else if (nm.TypeName[0] == 'h') { } else if (nm.TypeName[0] == 'B') { uint v = Program.ROM.u8(addr + nm.Id); sb.Append(U.To0xHexString(v)); } else if (nm.TypeName[0] == 'W') { uint v = Program.ROM.u16(addr + nm.Id); sb.Append(U.To0xHexString(v)); } else if (nm.TypeName[0] == 'D') { uint v = Program.ROM.u32(addr + nm.Id); sb.Append(U.To0xHexString(v)); } else if (nm.TypeName[0] == 'P') { uint v = Program.ROM.p32(addr + nm.Id); sb.Append(U.To0xHexString(v)); } } sb.AppendLine(""); } return(sb.ToString()); }
private void ImagePalletForm_Load(object sender, EventArgs e) { this.CurrntControls = InputFormRef.GetAllControls(this); }
public static void MakePaletteROMToUI(Form self, uint palette_address, bool isCompress, int palette_index) { uint addr = U.toOffset(palette_address); byte[] palttebyte; if (isCompress) {//圧縮されている場合 if (addr == 0) { return; } palttebyte = LZ77.decompress(Program.ROM.Data, addr); addr = 0; if (palttebyte.Length <= 0) { R.ShowStopError("パレットをlz77解凍できません."); return; } } else {//無圧縮パレット palttebyte = Program.ROM.Data; } List <Control> controls = InputFormRef.GetAllControls(self); for (int paletteno = 1; paletteno <= 16; paletteno++) { NumericUpDown r = (NumericUpDown)MakePaletteUI_FindObject <NumericUpDown>(controls, "R", paletteno); NumericUpDown g = (NumericUpDown)MakePaletteUI_FindObject <NumericUpDown>(controls, "G", paletteno); NumericUpDown b = (NumericUpDown)MakePaletteUI_FindObject <NumericUpDown>(controls, "B", paletteno); uint read_addr = addr + (uint)((paletteno - 1) * 2) + (uint)(palette_index * 0x20); if (read_addr >= palttebyte.Length) {//念のため読み込む範囲チェック continue; } uint dp = U.u16(palttebyte, read_addr); byte dr = (byte)((dp & 0x1F)); byte dg = (byte)(((dp >> 5) & 0x1F)); byte db = (byte)(((dp >> 10) & 0x1F)); //0だと ChangeValueイベントが発生しないので・・・ if (0 == dr) { r.Value = 1; } r.Value = dr << 3; if (0 == dg) { g.Value = 1; } g.Value = dg << 3; if (0 == db) { b.Value = 1; } b.Value = db << 3; } }
public PaletteFormRef(Form self) { this.SelfForm = self; this.Controls = InputFormRef.GetAllControls(self); ClearUndoBuffer(); }
public SkillAssignmentUnitFE8NForm() { InitializeComponent(); PatchUtil.skill_system_enum skill = PatchUtil.SearchSkillSystem(); Dictionary <uint, string> SCROLL1; Dictionary <uint, string> SCROLL2; Dictionary <uint, string> MASTERY; uint[] pointers; if (skill == PatchUtil.skill_system_enum.yugudora) {//ユグドラパッチ 初期FE8Nカスタム pointers = SkillConfigFE8NSkillForm.FindSkillFE8NVer1IconPointers(); SCROLL1 = U.LoadDicResource(U.ConfigDataFilename("skill_extends_yugudora_skill1_scroll_")); SCROLL2 = U.LoadDicResource(U.ConfigDataFilename("skill_extends_yugudora_skill2_scroll_")); MASTERY = U.LoadDicResource(U.ConfigDataFilename("skill_extends_FE8N_skill3_mastery_")); } else if (skill == PatchUtil.skill_system_enum.midori) {//緑パッチ pointers = SkillConfigFE8NSkillForm.FindSkillFE8NVer1IconPointers(); SCROLL1 = U.LoadDicResource(U.ConfigDataFilename("skill_extends_midori_skill1_scroll_")); SCROLL2 = U.LoadDicResource(U.ConfigDataFilename("skill_extends_midori_skill2_scroll_")); MASTERY = U.LoadDicResource(U.ConfigDataFilename("skill_extends_midori_skill3_mastery_")); } else if (skill == PatchUtil.skill_system_enum.FE8N_ver2) {//FE8N ver2 pointers = SkillConfigFE8NVer2SkillForm.FindSkillFE8NVer2IconPointers(); SCROLL1 = U.LoadDicResource(U.ConfigDataFilename("skill_extends_FE8N_skill1_scroll_")); SCROLL2 = U.LoadDicResource(U.ConfigDataFilename("skill_extends_FE8N_skill2_scroll_")); MASTERY = U.LoadDicResource(U.ConfigDataFilename("skill_extends_FE8N_skill3_mastery_")); } else {//FE8N pointers = SkillConfigFE8NSkillForm.FindSkillFE8NVer1IconPointers(); SCROLL1 = U.LoadDicResource(U.ConfigDataFilename("skill_extends_FE8N_skill1_scroll_")); SCROLL2 = U.LoadDicResource(U.ConfigDataFilename("skill_extends_FE8N_skill2_scroll_")); MASTERY = U.LoadDicResource(U.ConfigDataFilename("skill_extends_FE8N_skill3_mastery_")); } string find; string text; uint icon; find = U.at(SCROLL1, 0x01); icon = FindSkillIconAndText(skill, pointers, find, out text); L_40_BIT_01.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE0_0.Image = DrawSkillIcon(skill, icon); find = U.at(SCROLL1, 0x02); icon = FindSkillIconAndText(skill, pointers, find, out text); L_40_BIT_02.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE0_1.Image = DrawSkillIcon(skill, icon); find = U.at(SCROLL1, 0x04); icon = FindSkillIconAndText(skill, pointers, find, out text); L_40_BIT_04.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE0_2.Image = DrawSkillIcon(skill, icon); find = U.at(SCROLL1, 0x08); icon = FindSkillIconAndText(skill, pointers, find, out text); L_40_BIT_08.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE0_3.Image = DrawSkillIcon(skill, icon); find = U.at(SCROLL1, 0x10); icon = FindSkillIconAndText(skill, pointers, find, out text); L_40_BIT_10.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE0_4.Image = DrawSkillIcon(skill, icon); find = U.at(SCROLL1, 0x20); icon = FindSkillIconAndText(skill, pointers, find, out text); L_40_BIT_20.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE0_5.Image = DrawSkillIcon(skill, icon); find = U.at(SCROLL1, 0x40); icon = FindSkillIconAndText(skill, pointers, find, out text); L_40_BIT_40.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE0_6.Image = DrawSkillIcon(skill, icon); find = U.at(SCROLL1, 0x80); icon = FindSkillIconAndText(skill, pointers, find, out text); L_40_BIT_80.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE0_7.Image = DrawSkillIcon(skill, icon); find = U.at(SCROLL2, 0x01); icon = FindSkillIconAndText(skill, pointers, find, out text); L_41_BIT_01.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE1_0.Image = DrawSkillIcon(skill, icon); find = U.at(SCROLL2, 0x02); icon = FindSkillIconAndText(skill, pointers, find, out text); L_41_BIT_02.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE1_1.Image = DrawSkillIcon(skill, icon); find = U.at(SCROLL2, 0x04); icon = FindSkillIconAndText(skill, pointers, find, out text); L_41_BIT_04.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE1_2.Image = DrawSkillIcon(skill, icon); find = U.at(SCROLL2, 0x08); icon = FindSkillIconAndText(skill, pointers, find, out text); L_41_BIT_08.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE1_3.Image = DrawSkillIcon(skill, icon); find = U.at(SCROLL2, 0x10); icon = FindSkillIconAndText(skill, pointers, find, out text); L_41_BIT_10.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE1_4.Image = DrawSkillIcon(skill, icon); find = U.at(SCROLL2, 0x20); icon = FindSkillIconAndText(skill, pointers, find, out text); L_41_BIT_20.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE1_5.Image = DrawSkillIcon(skill, icon); find = U.at(SCROLL2, 0x40); icon = FindSkillIconAndText(skill, pointers, find, out text); L_41_BIT_40.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE1_6.Image = DrawSkillIcon(skill, icon); find = U.at(SCROLL2, 0x80); icon = FindSkillIconAndText(skill, pointers, find, out text); L_41_BIT_80.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE1_7.Image = DrawSkillIcon(skill, icon); icon = FindSkillIconAndText(skill, pointers, find, out text); L_39_RADIO_0.Text = R._("なし"); find = U.at(MASTERY, 0x01); icon = FindSkillIconAndText(skill, pointers, find, out text); L_39_RADIO_1.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE2_1.Image = DrawSkillIcon(skill, icon); find = U.at(MASTERY, 0x02); icon = FindSkillIconAndText(skill, pointers, find, out text); L_39_RADIO_2.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE2_2.Image = DrawSkillIcon(skill, icon); find = U.at(MASTERY, 0x03); icon = FindSkillIconAndText(skill, pointers, find, out text); L_39_RADIO_3.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE2_3.Image = DrawSkillIcon(skill, icon); find = U.at(MASTERY, 0x04); icon = FindSkillIconAndText(skill, pointers, find, out text); L_39_RADIO_4.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE2_4.Image = DrawSkillIcon(skill, icon); find = U.at(MASTERY, 0x05); icon = FindSkillIconAndText(skill, pointers, find, out text); L_39_RADIO_5.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE2_5.Image = DrawSkillIcon(skill, icon); find = U.at(MASTERY, 0x06); icon = FindSkillIconAndText(skill, pointers, find, out text); L_39_RADIO_6.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE2_6.Image = DrawSkillIcon(skill, icon); find = U.at(MASTERY, 0x07); icon = FindSkillIconAndText(skill, pointers, find, out text); L_39_RADIO_7.Text = U.nl2none(icon == U.NOT_FOUND ? find : text); IMAGE2_7.Image = DrawSkillIcon(skill, icon); InputFormRef.TabControlHideTabOption(SkillTab); List <Control> controls = InputFormRef.GetAllControls(this); InputFormRef.MakeLinkEvent("", controls); }