From 1702112097b11d4e8b95a2e87cd9f60b9ca29e2d Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Fri, 15 Nov 2024 18:57:13 +0000 Subject: [PATCH] Add review count to tab bar --- builtin/mainmenu/content/dlg_package.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/builtin/mainmenu/content/dlg_package.lua b/builtin/mainmenu/content/dlg_package.lua index 74dd5e233..fa0bb0cca 100644 --- a/builtin/mainmenu/content/dlg_package.lua +++ b/builtin/mainmenu/content/dlg_package.lua @@ -138,11 +138,12 @@ local function get_formspec(data) formspec[#formspec + 1] = "]" end + local review_count = info.reviews.positive + info.reviews.neutral + info.reviews.negative local current_tab = data.current_tab or 1 local tab_titles = { fgettext("Description"), fgettext("Information"), - fgettext("Reviews"), + fgettext("Reviews") .. core.formspec_escape(" [" .. review_count .. "]"), } local tab_body_height = bottom_buttons_y - 2.8 @@ -165,7 +166,7 @@ local function get_formspec(data) local fs_to_px = winfo.size.x / winfo.max_formspec_size.x for i, ss in ipairs(info.screenshots) do local path = get_screenshot(package, ss.url, 2) - hypertext = hypertext .. "" if i ~= #info.screenshots then