public FormXXEditHex(FormXX formXX, List<int[]> gotoCells) { InitializeComponent(); this.Text += " of " + formXX.ToolTipText; this.formXX = formXX; this.editor = formXX.Editor; this.parser = editor.Parser; this.gotoCells = gotoCells; foreach (TabPage page in tabControl1.TabPages) { foreach (Control control in page.Controls) { if (control is DataGridViewEditor) { page.Tag = control; break; } } } xxTable.BeginLoadData(); frameTable.BeginLoadData(); meshTable.BeginLoadData(); submeshTable.BeginLoadData(); materialTable.BeginLoadData(); textureTable.BeginLoadData(); InitColumns(); InitTables(); xxTable.EndLoadData(); xxTable.AcceptChanges(); frameTable.EndLoadData(); frameTable.AcceptChanges(); meshTable.EndLoadData(); meshTable.AcceptChanges(); submeshTable.EndLoadData(); submeshTable.AcceptChanges(); materialTable.EndLoadData(); materialTable.AcceptChanges(); textureTable.EndLoadData(); textureTable.AcceptChanges(); this.KeyDown += new KeyEventHandler(FormXXEditHex_KeyDown); this.Load += new EventHandler(FormXXEditHex_Load); }
public FormXX OpenXXSubfile(string name) { DockContent child; if (!ChildForms.TryGetValue(name, out child)) { string childParserVar; bool changed = true; if (!ChildParserVars.TryGetValue(name, out childParserVar)) { childParserVar = Gui.Scripting.GetNextVariable("xxParser"); Gui.Scripting.RunScript(childParserVar + " = OpenXX(parser=" + ParserVar + ", name=\"" + name + "\")"); Gui.Scripting.RunScript(EditorVar + ".ReplaceSubfile(file=" + childParserVar + ")"); ChildParserVars.Add(name, childParserVar); foreach (ListViewItem item in xxSubfilesList.Items) { if (((IWriteFile)item.Tag).Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)) { item.Font = new Font(item.Font, FontStyle.Bold); changed = item.Tag is ppSwapfile || item.Tag is RawFile; item.Tag = Gui.Scripting.Variables[childParserVar]; break; } } } child = new FormXX(Editor.Parser, childParserVar); ((FormXX)child).Changed = changed; child.FormClosing += new FormClosingEventHandler(ChildForms_FormClosing); child.Tag = name; ChildForms.Add(name, child); } return child as FormXX; }
public FormXX OpenXXSubfile(string name) { DockContent child; if (!ChildForms.TryGetValue(name, out child)) { string childParserVar; if (!ChildParserVars.TryGetValue(name, out childParserVar)) { childParserVar = Gui.Scripting.GetNextVariable("xxParser"); Gui.Scripting.RunScript(childParserVar + " = OpenXX(parser=" + ParserVar + ", name=\"" + name + "\")"); Gui.Scripting.RunScript(EditorVar + ".ReplaceSubfile(file=" + childParserVar + ")"); ChildParserVars.Add(name, childParserVar); foreach (ListViewItem item in xxSubfilesList.Items) { if (((IWriteFile)item.Tag).Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)) { item.Font = new Font(item.Font, FontStyle.Bold); xxSubfilesList.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); break; } } } child = new FormXX(Editor.Parser, childParserVar); child.FormClosing += new FormClosingEventHandler(ChildForms_FormClosing); child.Tag = name; ChildForms.Add(name, child); } return child as FormXX; }