mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 13:05:25 -05:00
ui: Moved hex editor settings to settings menu
This commit is contained in:
@@ -131,7 +131,7 @@ namespace hex::plugin::builtin {
|
||||
return [value] { ImGui::TextUnformatted(value.c_str()); return value; };
|
||||
});
|
||||
|
||||
ContentRegistry::DataInspector::add("hex.builtin.inspector.string", 0, [](auto buffer, auto endian, auto style) {
|
||||
ContentRegistry::DataInspector::add("hex.builtin.inspector.string", 1, [](auto buffer, auto endian, auto style) {
|
||||
Region currSelection = { 0 };
|
||||
EventManager::post<QuerySelection>(currSelection);
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace hex::plugin::builtin {
|
||||
stringBuffer += "...";
|
||||
|
||||
for (auto &c : stringBuffer)
|
||||
if (c < 0x20 || c == '\n' || c == '\r')
|
||||
if (c < 0x20)
|
||||
c = ' ';
|
||||
|
||||
|
||||
|
||||
@@ -131,6 +131,83 @@ namespace hex::plugin::builtin {
|
||||
return false;
|
||||
});
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.column_count", 16, [](auto name, nlohmann::json &setting) {
|
||||
static int columns = static_cast<int>(setting);
|
||||
|
||||
if (ImGui::SliderInt(name.data(), &columns, 1, 32)) {
|
||||
setting = columns;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.hexii", 0, [](auto name, nlohmann::json &setting) {
|
||||
static bool hexii = static_cast<int>(setting);
|
||||
|
||||
if (ImGui::Checkbox(name.data(), &hexii)) {
|
||||
setting = static_cast<int>(hexii);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.ascii", 1, [](auto name, nlohmann::json &setting) {
|
||||
static bool ascii = static_cast<int>(setting);
|
||||
|
||||
if (ImGui::Checkbox(name.data(), &ascii)) {
|
||||
setting = static_cast<int>(ascii);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.advanced_decoding", 0, [](auto name, nlohmann::json &setting) {
|
||||
static bool advancedDecoding = static_cast<int>(setting);
|
||||
|
||||
if (ImGui::Checkbox(name.data(), &advancedDecoding)) {
|
||||
setting = static_cast<int>(advancedDecoding);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.grey_zeros", 1, [](auto name, nlohmann::json &setting) {
|
||||
static bool greyZeros = static_cast<int>(setting);
|
||||
|
||||
if (ImGui::Checkbox(name.data(), &greyZeros)) {
|
||||
setting = static_cast<int>(greyZeros);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.uppercase_hex", 1, [](auto name, nlohmann::json &setting) {
|
||||
static bool upperCaseHex = static_cast<int>(setting);
|
||||
|
||||
if (ImGui::Checkbox(name.data(), &upperCaseHex)) {
|
||||
setting = static_cast<int>(upperCaseHex);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.extra_info", 1, [](auto name, nlohmann::json &setting) {
|
||||
static bool extraInfos = static_cast<int>(setting);
|
||||
|
||||
if (ImGui::Checkbox(name.data(), &extraInfos)) {
|
||||
setting = static_cast<int>(extraInfos);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -96,6 +96,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.view.data_inspector.name", "Dateninspektor" },
|
||||
{ "hex.view.data_inspector.table.name", "Name" },
|
||||
{ "hex.view.data_inspector.table.value", "Wert" },
|
||||
{ "hex.view.data_inspector.no_data", "Keine bytes angewählt"},
|
||||
|
||||
{ "hex.view.data_processor.name", "Datenprozessor" },
|
||||
{ "hex.view.data_processor.menu.remove_selection", "Auswahl entfernen" },
|
||||
@@ -596,6 +597,14 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.setting.interface.language", "Sprache" },
|
||||
{ "hex.builtin.setting.interface.fps", "FPS Limite" },
|
||||
{ "hex.builtin.setting.interface.highlight_alpha", "Markierungssichtbarkeit" },
|
||||
{ "hex.builtin.setting.hex_editor", "Hex Editor" },
|
||||
{ "hex.builtin.setting.hex_editor.column_count", "Anzahl Byte Spalten" },
|
||||
{ "hex.builtin.setting.hex_editor.hexii", "HexII anstatt Bytes anzeigen" },
|
||||
{ "hex.builtin.setting.hex_editor.ascii", "ASCII Spalte anzeigen" },
|
||||
{ "hex.builtin.setting.hex_editor.advanced_decoding", "Erweiterte Dekodierungsspalte anzeigen" },
|
||||
{ "hex.builtin.setting.hex_editor.grey_zeros", "Nullen ausgrauen" },
|
||||
{ "hex.builtin.setting.hex_editor.uppercase_hex", "Hex Zeichen als Grossbuchstaben" },
|
||||
{ "hex.builtin.setting.hex_editor.extra_info", "Extra informationen anzeigen" },
|
||||
|
||||
{ "hex.builtin.provider.file.path", "Dateipfad" },
|
||||
{ "hex.builtin.provider.file.size", "Größe" },
|
||||
|
||||
@@ -96,6 +96,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.view.data_inspector.name", "Data Inspector" },
|
||||
{ "hex.view.data_inspector.table.name", "Name" },
|
||||
{ "hex.view.data_inspector.table.value", "Value" },
|
||||
{ "hex.view.data_inspector.no_data", "No bytes selected"},
|
||||
|
||||
{ "hex.view.data_processor.name", "Data Processor" },
|
||||
{ "hex.view.data_processor.menu.remove_selection", "Remove Selected" },
|
||||
@@ -597,6 +598,14 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.setting.interface.language", "Language" },
|
||||
{ "hex.builtin.setting.interface.fps", "FPS Limit" },
|
||||
{ "hex.builtin.setting.interface.highlight_alpha", "Highlighting opacity" },
|
||||
{ "hex.builtin.setting.hex_editor", "Hex Editor" },
|
||||
{ "hex.builtin.setting.hex_editor.column_count", "Byte column count" },
|
||||
{ "hex.builtin.setting.hex_editor.hexii", "Display HexII instead of Bytes" },
|
||||
{ "hex.builtin.setting.hex_editor.ascii", "Display ASCII column" },
|
||||
{ "hex.builtin.setting.hex_editor.advanced_decoding", "Display advanced decoding column" },
|
||||
{ "hex.builtin.setting.hex_editor.grey_zeros", "Grey out zeros" },
|
||||
{ "hex.builtin.setting.hex_editor.uppercase_hex", "Upper case Hex characters" },
|
||||
{ "hex.builtin.setting.hex_editor.extra_info", "Display extra information" },
|
||||
|
||||
{ "hex.builtin.provider.file.path", "File path" },
|
||||
{ "hex.builtin.provider.file.size", "Size" },
|
||||
|
||||
@@ -95,6 +95,8 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.view.data_inspector.name", "Ispezione Dati" },
|
||||
{ "hex.view.data_inspector.table.name", "Nome" },
|
||||
{ "hex.view.data_inspector.table.value", "Valore" },
|
||||
//{ "hex.view.data_inspector.no_data", "No bytes selected"},
|
||||
|
||||
|
||||
{ "hex.view.data_processor.name", "Processa Dati" },
|
||||
{ "hex.view.data_processor.menu.remove_selection", "Rimuovi i selezionati" },
|
||||
@@ -593,8 +595,16 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.setting.interface.scaling.x1_0", "x1.0" },
|
||||
{ "hex.builtin.setting.interface.scaling.x1_5", "x1.5" },
|
||||
{ "hex.builtin.setting.interface.scaling.x2_0", "x2.0" },
|
||||
{ "hex.builtin.setting.interface.fps", "Limite FPS" },
|
||||
{ "hex.builtin.setting.interface.highlight_alpha", "Evidenziazione dell'opacità" },
|
||||
{ "hex.builtin.setting.interface.fps", "Limite FPS" },
|
||||
{ "hex.builtin.setting.interface.highlight_alpha", "Evidenziazione dell'opacità" },
|
||||
//{ "hex.builtin.setting.hex_editor", "Hex Editor" },
|
||||
//{ "hex.builtin.setting.hex_editor.column_count", "Byte column count" },
|
||||
//{ "hex.builtin.setting.hex_editor.hexii", "Display HexII instead of Bytes" },
|
||||
//{ "hex.builtin.setting.hex_editor.ascii", "Display ASCII column" },
|
||||
//{ "hex.builtin.setting.hex_editor.advanced_decoding", "Display advanced decoding column" },
|
||||
//{ "hex.builtin.setting.hex_editor.grey_zeros", "Grey out zeros" },
|
||||
//{ "hex.builtin.setting.hex_editor.uppercase_hex", "Upper case Hex characters" },
|
||||
//{ "hex.builtin.setting.hex_editor.extra_info", "Display extra information" },
|
||||
|
||||
{ "hex.builtin.provider.file.path", "Percorso del File" },
|
||||
{ "hex.builtin.provider.file.size", "Dimensione" },
|
||||
|
||||
@@ -96,6 +96,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.view.data_inspector.name", "数据分析器" },
|
||||
{ "hex.view.data_inspector.table.name", "名称" },
|
||||
{ "hex.view.data_inspector.table.value", "值" },
|
||||
//{ "hex.view.data_inspector.no_data", "No bytes selected"},
|
||||
|
||||
{ "hex.view.data_processor.name", "数据处理器" },
|
||||
{ "hex.view.data_processor.menu.remove_selection", "移除已选" },
|
||||
@@ -598,6 +599,14 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.setting.interface.language", "语言" },
|
||||
{ "hex.builtin.setting.interface.fps", "FPS限制" },
|
||||
{ "hex.builtin.setting.interface.highlight_alpha", "高亮不透明度" },
|
||||
//{ "hex.builtin.setting.hex_editor", "Hex Editor" },
|
||||
//{ "hex.builtin.setting.hex_editor.column_count", "Byte column count" },
|
||||
//{ "hex.builtin.setting.hex_editor.hexii", "Display HexII instead of Bytes" },
|
||||
//{ "hex.builtin.setting.hex_editor.ascii", "Display ASCII column" },
|
||||
//{ "hex.builtin.setting.hex_editor.advanced_decoding", "Display advanced decoding column" },
|
||||
//{ "hex.builtin.setting.hex_editor.grey_zeros", "Grey out zeros" },
|
||||
//{ "hex.builtin.setting.hex_editor.uppercase_hex", "Upper case Hex characters" },
|
||||
//{ "hex.builtin.setting.hex_editor.extra_info", "Display extra information" },
|
||||
|
||||
{ "hex.builtin.provider.file.path", "路径" },
|
||||
{ "hex.builtin.provider.file.size", "大小" },
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include <hex.hpp>
|
||||
|
||||
#include <imgui.h>
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#include <imgui_internal.h>
|
||||
#include <imgui_imhex_extensions.h>
|
||||
|
||||
#include <fontawesome_font.h>
|
||||
|
||||
Reference in New Issue
Block a user