Hex Editor - Find - start searching from highlighted value so that multiple find calls go to the next value. Show highlighted value in input box by default.
This commit is contained in:
parent
e2bc6db3a4
commit
e025ca99bf
|
@ -1271,15 +1271,40 @@ namespace BizHawk.MultiClient
|
|||
prompt.SetMessage("Enter a set of hex values to search for");
|
||||
prompt.SetCasing(CharacterCasing.Upper);
|
||||
prompt.HexOnly = true;
|
||||
if (addressHighlighted > 0)
|
||||
{
|
||||
string initial = String.Format(DigitFormatString, (int)MakeValue(addressHighlighted));
|
||||
initial = initial.Trim();
|
||||
prompt.SetInitialValue(initial);
|
||||
}
|
||||
prompt.ShowDialog();
|
||||
|
||||
|
||||
if (prompt.UserOK)
|
||||
{
|
||||
int found = 0;
|
||||
|
||||
string search = prompt.UserText.Replace(" ", "").ToUpper();
|
||||
if (search.Length == 0)
|
||||
return;
|
||||
|
||||
int numByte = search.Length / 2;
|
||||
for (int i = 0; i < (Domain.Size - numByte); i++)
|
||||
|
||||
int startByte = 0;
|
||||
if (addressHighlighted == -1)
|
||||
{
|
||||
startByte = 0;
|
||||
}
|
||||
else if (addressHighlighted >= (Domain.Size - 1 - numByte))
|
||||
{
|
||||
startByte = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
startByte = addressHighlighted + DataSize;
|
||||
}
|
||||
|
||||
for (int i = startByte; i < (Domain.Size - numByte); i++)
|
||||
{
|
||||
StringBuilder ramblock = new StringBuilder();
|
||||
for (int j = 0; j < numByte; j++)
|
||||
|
|
|
@ -32,6 +32,11 @@ namespace BizHawk.MultiClient
|
|||
PromptBox.CharacterCasing = casing;
|
||||
}
|
||||
|
||||
public void SetInitialValue(string value)
|
||||
{
|
||||
PromptBox.Text = value;
|
||||
}
|
||||
|
||||
private void InputPrompt_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
|
Loading…
Reference in New Issue