diff --git a/plugins/builtin/include/content/views/view_store.hpp b/plugins/builtin/include/content/views/view_store.hpp index 4cfb676bf..38af2376e 100644 --- a/plugins/builtin/include/content/views/view_store.hpp +++ b/plugins/builtin/include/content/views/view_store.hpp @@ -24,6 +24,7 @@ namespace hex::plugin::builtin { struct StoreEntry { std::string name; std::string description; + std::vector authors; std::string fileName; std::string link; std::string hash; diff --git a/plugins/builtin/romfs/lang/en_US.json b/plugins/builtin/romfs/lang/en_US.json index ec3c26f90..233290000 100644 --- a/plugins/builtin/romfs/lang/en_US.json +++ b/plugins/builtin/romfs/lang/en_US.json @@ -962,6 +962,7 @@ "hex.builtin.view.store.reload": "Reload", "hex.builtin.view.store.remove": "Remove", "hex.builtin.view.store.row.description": "Description", + "hex.builtin.view.store.row.authors": "Authors", "hex.builtin.view.store.row.name": "Name", "hex.builtin.view.store.tab.constants": "Constants", "hex.builtin.view.store.tab.encodings": "Encodings", diff --git a/plugins/builtin/source/content/views/view_store.cpp b/plugins/builtin/source/content/views/view_store.cpp index c6296ae63..08edbd0be 100644 --- a/plugins/builtin/source/content/views/view_store.cpp +++ b/plugins/builtin/source/content/views/view_store.cpp @@ -55,10 +55,11 @@ namespace hex::plugin::builtin { void ViewStore::drawTab(hex::plugin::builtin::StoreCategory &category) { if (ImGui::BeginTabItem(LangEntry(category.unlocalizedName))) { - if (ImGui::BeginTable("##pattern_language", 3, ImGuiTableFlags_ScrollY | ImGuiTableFlags_Borders | ImGuiTableFlags_SizingStretchSame | ImGuiTableFlags_RowBg)) { + if (ImGui::BeginTable("##pattern_language", 4, ImGuiTableFlags_ScrollY | ImGuiTableFlags_Borders | ImGuiTableFlags_SizingStretchSame | ImGuiTableFlags_RowBg)) { ImGui::TableSetupScrollFreeze(0, 1); ImGui::TableSetupColumn("hex.builtin.view.store.row.name"_lang, ImGuiTableColumnFlags_WidthFixed); ImGui::TableSetupColumn("hex.builtin.view.store.row.description"_lang, ImGuiTableColumnFlags_None); + ImGui::TableSetupColumn("hex.builtin.view.store.row.authors"_lang, ImGuiTableColumnFlags_WidthFixed); ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed); ImGui::TableHeadersRow(); @@ -70,6 +71,16 @@ namespace hex::plugin::builtin { ImGui::TextUnformatted(entry.name.c_str()); ImGui::TableNextColumn(); ImGui::TextUnformatted(entry.description.c_str()); + if (ImGui::IsItemHovered()) { + ImGui::BeginTooltip(); + ImGui::PushTextWrapPos(500); + ImGui::TextUnformatted(entry.description.c_str()); + ImGui::PopTextWrapPos(); + ImGui::EndTooltip(); + } + ImGui::TableNextColumn(); + // the space makes a padding in the UI + ImGui::Text("%s ", wolv::util::combineStrings(entry.authors, ", ").c_str()); ImGui::TableNextColumn(); const auto buttonSize = ImVec2(100_scaled, ImGui::GetTextLineHeightWithSpacing()); @@ -196,10 +207,10 @@ namespace hex::plugin::builtin { for (auto &entry : storeJson[category.requestName]) { // Check if entry is valid - if (entry.contains("name") && entry.contains("desc") && entry.contains("file") && entry.contains("url") && entry.contains("hash") && entry.contains("folder")) { + if (entry.contains("name") && entry.contains("desc") && entry.contains("authors") && entry.contains("file") && entry.contains("url") && entry.contains("hash") && entry.contains("folder")) { // Parse entry - StoreEntry storeEntry = { entry["name"], entry["desc"], entry["file"], entry["url"], entry["hash"], entry["folder"], false, false, false }; + StoreEntry storeEntry = { entry["name"], entry["desc"], entry["authors"], entry["file"], entry["url"], entry["hash"], entry["folder"], false, false, false }; // Check if file is installed already or has an update available for (const auto &folder : fs::getDefaultPaths(category.path)) {