feat: Added Edit -> Jump to option to jump to selected address
This commit is contained in:
parent
d643f8f8f7
commit
f52dae4297
@ -1624,8 +1624,9 @@ namespace hex::plugin::builtin {
|
||||
|
||||
// Popups
|
||||
ContentRegistry::Interface::addMenuItem("hex.builtin.menu.edit", 1200, [&] {
|
||||
auto provider = ImHexApi::Provider::get();
|
||||
bool providerValid = ImHexApi::Provider::isValid();
|
||||
auto provider = ImHexApi::Provider::get();
|
||||
bool providerValid = ImHexApi::Provider::isValid();
|
||||
auto selection = ImHexApi::HexEditor::getSelection();
|
||||
|
||||
if (ImGui::MenuItem("hex.builtin.view.hex_editor.menu.edit.set_base"_lang, nullptr, false, providerValid && provider->isReadable())) {
|
||||
this->openPopup<PopupBaseAddress>(provider->getBaseAddress());
|
||||
@ -1635,13 +1636,24 @@ namespace hex::plugin::builtin {
|
||||
this->openPopup<PopupResize>(provider->getActualSize());
|
||||
}
|
||||
|
||||
if (ImGui::MenuItem("hex.builtin.view.hex_editor.menu.edit.insert"_lang, nullptr, false, providerValid && provider->isResizable())) {
|
||||
this->openPopup<PopupInsert>(this->getSelection().getStartAddress(), 0x00);
|
||||
if (ImGui::MenuItem("hex.builtin.view.hex_editor.menu.edit.insert"_lang, nullptr, false, providerValid && provider->isResizable() && selection.has_value())) {
|
||||
this->openPopup<PopupInsert>(selection->getStartAddress(), 0x00);
|
||||
}
|
||||
|
||||
if (ImGui::MenuItem("hex.builtin.view.hex_editor.menu.edit.remove"_lang, nullptr, false, providerValid && provider->isResizable())) {
|
||||
auto selection = this->getSelection();
|
||||
this->openPopup<PopupRemove>(selection.getStartAddress(), selection.getSize());
|
||||
if (ImGui::MenuItem("hex.builtin.view.hex_editor.menu.edit.remove"_lang, nullptr, false, providerValid && provider->isResizable() && selection.has_value())) {
|
||||
this->openPopup<PopupRemove>(selection->getStartAddress(), selection->getSize());
|
||||
}
|
||||
|
||||
if (ImGui::MenuItem("hex.builtin.view.hex_editor.menu.edit.jump_to"_lang, nullptr, false, providerValid && provider->isResizable() && selection.has_value())) {
|
||||
if (selection->getSize() <= sizeof(u64)) {
|
||||
u64 value = 0;
|
||||
provider->read(selection->getStartAddress(), &value, selection->getSize());
|
||||
|
||||
if (value < provider->getBaseAddress() + provider->getActualSize()) {
|
||||
ImHexApi::HexEditor::setSelection(value, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -339,6 +339,8 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.set_base", "Basisadresse setzen" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.resize", "Grösse ändern..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.insert", "Einsetzen..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.remove", "Entfernen..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.jump_to", "Springen" },
|
||||
|
||||
{ "hex.builtin.view.information.name", "Dateninformationen" },
|
||||
{ "hex.builtin.view.information.control", "Einstellungen" },
|
||||
|
@ -343,6 +343,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.resize", "Resize..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.insert", "Insert..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.remove", "Remove..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.jump_to", "Jump to" },
|
||||
|
||||
{ "hex.builtin.view.information.name", "Data Information" },
|
||||
{ "hex.builtin.view.information.control", "Control" },
|
||||
|
@ -344,6 +344,8 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.set_base", "Imposta indirizzo di base" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.resize", "Ridimensiona..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.insert", "Inserisci..." },
|
||||
//{ "hex.builtin.view.hex_editor.menu.edit.remove", "Remove..." },
|
||||
//{ "hex.builtin.view.hex_editor.menu.edit.jump_to", "Jump to" },
|
||||
|
||||
{ "hex.builtin.view.information.name", "Informazione sui Dati" },
|
||||
{ "hex.builtin.view.information.control", "Controllo" },
|
||||
|
@ -344,6 +344,8 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.set_base", "ベースアドレスをセット" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.resize", "リサイズ…" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.insert", "挿入…" },
|
||||
//{ "hex.builtin.view.hex_editor.menu.edit.remove", "Remove..." },
|
||||
//{ "hex.builtin.view.hex_editor.menu.edit.jump_to", "Jump to" },
|
||||
|
||||
{ "hex.builtin.view.information.name", "データ解析" },
|
||||
{ "hex.builtin.view.information.control", "コントロール" },
|
||||
|
@ -342,6 +342,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.resize", "크기 변경..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.insert", "삽입..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.remove", "삭제..." },
|
||||
//{ "hex.builtin.view.hex_editor.menu.edit.jump_to", "Jump to" },
|
||||
|
||||
{ "hex.builtin.view.information.name", "데이터 정보" },
|
||||
{ "hex.builtin.view.information.control", "컨트롤" },
|
||||
|
@ -341,6 +341,8 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.set_base", "Definir endereço base" },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.resize", "Redimensionar..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.insert", "Inserir..." },
|
||||
//{ "hex.builtin.view.hex_editor.menu.edit.remove", "Remove..." },
|
||||
//{ "hex.builtin.view.hex_editor.menu.edit.jump_to", "Jump to" },
|
||||
|
||||
{ "hex.builtin.view.information.name", "Data Information" },
|
||||
{ "hex.builtin.view.information.control", "Controle" },
|
||||
|
@ -345,6 +345,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.resize", "修改大小..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.insert", "插入..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.remove", "删除..." },
|
||||
//{ "hex.builtin.view.hex_editor.menu.edit.jump_to", "Jump to" },
|
||||
|
||||
{ "hex.builtin.view.information.name", "数据信息" },
|
||||
{ "hex.builtin.view.information.control", "控制" },
|
||||
|
@ -342,6 +342,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.resize", "縮放..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.insert", "插入..." },
|
||||
{ "hex.builtin.view.hex_editor.menu.edit.remove", "移除..." },
|
||||
//{ "hex.builtin.view.hex_editor.menu.edit.jump_to", "Jump to" },
|
||||
|
||||
{ "hex.builtin.view.information.name", "資料資訊" },
|
||||
{ "hex.builtin.view.information.control", "控制" },
|
||||
|
Loading…
x
Reference in New Issue
Block a user