69 |
{ |
{ |
70 |
//logger.Warn.WriteLine("plugin_OnSelectedProcessChanged::has not been implemented!"); |
//logger.Warn.WriteLine("plugin_OnSelectedProcessChanged::has not been implemented!"); |
71 |
} |
} |
72 |
/* |
|
73 |
* foreach (var col in Enumerable.Range(0, lstCheats.Columns.Count)) |
|
74 |
|
private void ResizeColumns() |
75 |
|
{ |
76 |
|
foreach (var col in Enumerable.Range(0, lstCheats.Columns.Count)) |
77 |
{ |
{ |
78 |
lstCheats.AutoResizeColumn(col, ColumnHeaderAutoResizeStyle.ColumnContent); |
lstCheats.AutoResizeColumn(col, ColumnHeaderAutoResizeStyle.ColumnContent); |
79 |
} |
} |
80 |
*/ |
} |
81 |
|
|
82 |
private void btnAdd_Click(object sender, EventArgs e) |
private void btnAdd_Click(object sender, EventArgs e) |
83 |
{ |
{ |
84 |
string name = string.Empty; |
CheatInputDialog dlg = new CheatInputDialog(); |
85 |
string address = string.Empty; |
DialogResult result = dlg.ShowDialog(); |
86 |
|
if (result == DialogResult.Cancel) { return; } |
87 |
name = Microsoft.VisualBasic.Interaction.InputBox("Input Dialog", "Enter the cheat name", string.Empty); |
uint physical = dlg.CheatAddress + txtRVA.ToUInt32(); |
88 |
address = Microsoft.VisualBasic.Interaction.InputBox("Input Dialog", "Enter the cheat address (in hex : 0xXXXXXXXX)", string.Empty); |
ListViewItem li = new ListViewItem(dlg.CheatName); |
89 |
uint physical = Convert.ToUInt32(address, 16) + txtRVA.ToUInt32(); |
li.SubItems.Add(new ListViewItem.ListViewSubItem(li, string.Format("0x{0:x8}", dlg.CheatAddress))); |
|
ListViewItem li = new ListViewItem(name); |
|
|
li.SubItems.Add(new ListViewItem.ListViewSubItem(li, string.Format("0x{0:x8}", Convert.ToUInt32(address, 16)))); |
|
90 |
li.SubItems.Add(new ListViewItem.ListViewSubItem(li, string.Format("0x{0:x8}", physical))); |
li.SubItems.Add(new ListViewItem.ListViewSubItem(li, string.Format("0x{0:x8}", physical))); |
91 |
lstCheats.Items.Add(li); |
lstCheats.Items.Add(li); |
92 |
|
ResizeColumns(); |
93 |
} |
} |
94 |
|
|
95 |
private void btnRemove_Click(object sender, EventArgs e) |
private void btnRemove_Click(object sender, EventArgs e) |
97 |
if (lstCheats.SelectedItems.Count == 0 || lstCheats.SelectedItems.Count > 1) { return; } |
if (lstCheats.SelectedItems.Count == 0 || lstCheats.SelectedItems.Count > 1) { return; } |
98 |
int index = lstCheats.SelectedIndices[0]; |
int index = lstCheats.SelectedIndices[0]; |
99 |
lstCheats.Items.RemoveAt(index); |
lstCheats.Items.RemoveAt(index); |
100 |
|
ResizeColumns(); |
101 |
} |
} |
102 |
|
|
103 |
private void btnUpdate_Click(object sender, EventArgs e) |
private void btnUpdate_Click(object sender, EventArgs e) |
108 |
string name = li.Text; |
string name = li.Text; |
109 |
string address = li.SubItems[1].Text; |
string address = li.SubItems[1].Text; |
110 |
|
|
111 |
name = Microsoft.VisualBasic.Interaction.InputBox("Input Dialog", "Enter the cheat name", name); |
CheatInputDialog dlg = new CheatInputDialog(name, Convert.ToUInt32(address, 16)); |
112 |
address = Microsoft.VisualBasic.Interaction.InputBox("Input Dialog", "Enter the cheat address (in hex : 0xXXXXXXXX)", address); |
DialogResult result = dlg.ShowDialog(); |
113 |
uint physical = Convert.ToUInt32(address, 16) + txtRVA.ToUInt32(); |
if (result == DialogResult.Cancel) { return; } |
114 |
li.Text = name; |
uint physical = dlg.CheatAddress + txtRVA.ToUInt32(); |
115 |
li.SubItems[1].Text = string.Format("0x{0:x8}", Convert.ToUInt32(address, 16)); |
li.Text = dlg.CheatName; |
116 |
|
li.SubItems[1].Text = string.Format("0x{0:x8}", dlg.CheatAddress); |
117 |
li.SubItems[2].Text = string.Format("0x{0:x8}", physical); |
li.SubItems[2].Text = string.Format("0x{0:x8}", physical); |
118 |
lstCheats.Items[index] = li; |
lstCheats.Items[index] = li; |
119 |
|
ResizeColumns(); |
120 |
} |
} |
121 |
|
|
122 |
private void btnCopy_Click(object sender, EventArgs e) |
private void btnCopy_Click(object sender, EventArgs e) |
238 |
logger.VerboseError.WriteLine(ex.ToString()); |
logger.VerboseError.WriteLine(ex.ToString()); |
239 |
MessageBox.Show(string.Format("Failed to open: '{0}'", new FileInfo(CheatLoader.FileName).Name), "", MessageBoxButtons.OK, MessageBoxIcon.Error); |
MessageBox.Show(string.Format("Failed to open: '{0}'", new FileInfo(CheatLoader.FileName).Name), "", MessageBoxButtons.OK, MessageBoxIcon.Error); |
240 |
} |
} |
241 |
|
ResizeColumns(); |
242 |
} |
} |
243 |
|
|
244 |
private void btnRefresh_Click(object sender, EventArgs e) |
private void btnRefresh_Click(object sender, EventArgs e) |
253 |
lstCheats.Items[index] = li; |
lstCheats.Items[index] = li; |
254 |
index++; |
index++; |
255 |
} |
} |
256 |
|
ResizeColumns(); |
257 |
} |
} |
258 |
private void btnCopyAll_Click(object sender, EventArgs e) |
private void btnCopyAll_Click(object sender, EventArgs e) |
259 |
{ |
{ |