From 0bfd9bc09ea5aec9aa2b597e13efad2384c3ecf7 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 14 Dec 2024 17:25:52 +0100 Subject: [PATCH] Condense renderer information into a single string --- .github/ISSUE_TEMPLATE/bug_report.yaml | 9 +------ builtin/mainmenu/tab_about.lua | 35 ++++++++++++++++++-------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 828d29b59..ae736d52f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -34,13 +34,6 @@ body: render: "true" validations: required: true - - type: input - attributes: - label: Irrlicht device - description: - placeholder: "Example: X11" - validations: - required: false - type: input attributes: label: Operating system and version @@ -69,7 +62,7 @@ body: attributes: label: Active renderer description: You can find this in the "About" tab in the main menu. - placeholder: "Example: OpenGL 4.6.0" + placeholder: "Example: ES 3.2 / ogles2 / X11" validations: required: false - type: textarea diff --git a/builtin/mainmenu/tab_about.lua b/builtin/mainmenu/tab_about.lua index a038db9bc..86c811457 100644 --- a/builtin/mainmenu/tab_about.lua +++ b/builtin/mainmenu/tab_about.lua @@ -32,6 +32,27 @@ local function get_credits() return json end +local function get_renderer_info() + local ret = {} + + -- OpenGL version, stripped to just the important part + local s1 = core.get_active_renderer() + if s1:sub(1, 7) == "OpenGL " then + s1 = s1:sub(8) + end + local m = s1:match("^[%d.]+") + if not m then + m = s1:match("^ES [%d.]+") + end + ret[#ret+1] = m or s1 + -- video driver + ret[#ret+1] = core.get_active_driver():lower() + -- irrlicht device + ret[#ret+1] = core.get_active_irrlicht_device():upper() + + return table.concat(ret, " / ") +end + return { name = "about", caption = fgettext("About"), @@ -81,20 +102,12 @@ return { "button_url[1.5,4.1;2.5,0.8;homepage;luanti.org;https://www.luanti.org/]" .. "hypertext[5.5,0.25;9.75,6.6;credits;" .. core.formspec_escape(hypertext) .. "]" - -- Render information - local active_renderer_info = fgettext("Active renderer:") .. " " .. - core.formspec_escape(core.get_active_renderer()) + local active_renderer_info = fgettext("Active renderer:") .. "\n" .. + core.formspec_escape(get_renderer_info()) fs = fs .. "style[label_button2;border=false]" .. - "button[0.1,6;5.3,0.5;label_button2;" .. active_renderer_info .. "]".. + "button[0.1,6;5.3,1;label_button2;" .. active_renderer_info .. "]".. "tooltip[label_button2;" .. active_renderer_info .. "]" - -- Irrlicht device information - local irrlicht_device_info = fgettext("Irrlicht device:") .. " " .. - core.formspec_escape(core.get_active_irrlicht_device()) - fs = fs .. "style[label_button3;border=false]" .. - "button[0.1,6.5;5.3,0.5;label_button3;" .. irrlicht_device_info .. "]".. - "tooltip[label_button3;" .. irrlicht_device_info .. "]" - if PLATFORM == "Android" then fs = fs .. "button[0.5,5.1;4.5,0.8;share_debug;" .. fgettext("Share debug log") .. "]" else