1
0
mirror of synced 2024-11-28 09:30:51 +01:00

ui: Added ImHex directories table to about page

This commit is contained in:
WerWolv 2021-05-23 23:35:04 +02:00
parent c760ccb5bb
commit 21525a7261
4 changed files with 39 additions and 2 deletions

View File

@ -134,6 +134,7 @@ namespace hex::plugin::builtin {
{ "hex.view.help.about.donations", "Spenden" },
{ "hex.view.help.about.thanks", "Wenn dir meine Arbeit gefällt, bitte ziehe eine Spende in Betracht, um das Projekt am Laufen zu halten. Vielen Dank <3" },
{ "hex.view.help.about.libs", "Benutzte Libraries" },
{ "hex.view.help.about.paths", "ImHex Ordner" },
{ "hex.view.help.pattern_cheat_sheet", "Pattern Language Cheat Sheet"},
{ "hex.view.help.calc_cheat_sheet", "Rechner Cheat Sheet" },

View File

@ -134,6 +134,7 @@ namespace hex::plugin::builtin {
{ "hex.view.help.about.donations", "Donations" },
{ "hex.view.help.about.thanks", "If you like my work, please consider donating to keep the project going. Thanks a lot <3" },
{ "hex.view.help.about.libs", "Libraries used" },
{ "hex.view.help.about.paths", "ImHex Directories" },
{ "hex.view.help.pattern_cheat_sheet", "Pattern Language Cheat Sheet"},
{ "hex.view.help.calc_cheat_sheet", "Calculator Cheat Sheet" },

View File

@ -134,6 +134,7 @@ namespace hex::plugin::builtin {
{ "hex.view.help.about.donations", "Donazioni" },
{ "hex.view.help.about.thanks", "Se ti piace il mio lavoro, per favore considera di fare una donazione. Grazie mille <3" },
{ "hex.view.help.about.libs", "Librerie usate" },
{ "hex.view.help.about.paths", "ImHex cartelle" },
{ "hex.view.help.pattern_cheat_sheet", "Pattern Language Cheat Sheet"},
{ "hex.view.help.calc_cheat_sheet", "Calcolatrice Cheat Sheet" },

View File

@ -64,7 +64,7 @@ namespace hex {
hex::openWebpage(url.data());
};
ImGui::Text("hex.view.help.about.libs"_lang);
ImGui::TextUnformatted("hex.view.help.about.libs"_lang);
ImGui::Separator();
ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.2F, 0.2F, 0.2F, 0.3F));
Link("ImGui by ocornut", "https://github.com/ocornut/imgui");
@ -89,6 +89,40 @@ namespace hex {
if (ImGui::IsKeyDown(ImGui::GetKeyIndex(ImGuiKey_Escape)))
ImGui::CloseCurrentPopup();
ImGui::NewLine();
ImGui::TextUnformatted("hex.view.help.about.paths"_lang);
ImGui::Separator();
if (ImGui::BeginTable("##imhex_paths", 2, ImGuiTableFlags_ScrollY | ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg)) {
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableSetupColumn("Type");
ImGui::TableSetupColumn("Paths");
constexpr std::array<std::pair<const char*, ImHexPath>, 8> PathTypes = {{
{ "Resources", ImHexPath::Resources },
{ "Config", ImHexPath::Config },
{ "Magic", ImHexPath::Magic },
{ "Patterns", ImHexPath::Patterns },
{ "Patterns Includes", ImHexPath::PatternsInclude },
{ "Plugins", ImHexPath::Plugins },
{ "Python Scripts", ImHexPath::Python },
{ "Yara Patterns", ImHexPath::Yara }
}};
ImGui::TableHeadersRow();
for (const auto &[name, type] : PathTypes) {
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::TextUnformatted(name);
ImGui::TableNextColumn();
for (auto &path : hex::getPath(type))
ImGui::TextUnformatted(path.c_str());
}
ImGui::EndTable();
}
ImGui::EndPopup();
}
}
@ -322,7 +356,7 @@ namespace hex {
void ViewHelp::drawMenu() {
if (ImGui::BeginMenu("hex.menu.help"_lang)) {
if (ImGui::MenuItem("hex.view.help.about.name"_lang, "")) {
View::doLater([] { ImGui::OpenPopup(View::toWindowName("hex.view.about.name").c_str()); });
View::doLater([] { ImGui::OpenPopup(View::toWindowName("hex.view.help.about.name").c_str()); });
this->m_aboutWindowOpen = true;
this->getWindowOpenState() = true;
}