mirror of
https://github.com/minetest/minetest.git
synced 2025-01-23 14:31:36 +01:00
Condense renderer information into a single string
This commit is contained in:
parent
9f52f84f2b
commit
0bfd9bc09e
9
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
9
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
@ -34,13 +34,6 @@ body:
|
|||||||
render: "true"
|
render: "true"
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: Irrlicht device
|
|
||||||
description:
|
|
||||||
placeholder: "Example: X11"
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: input
|
- type: input
|
||||||
attributes:
|
attributes:
|
||||||
label: Operating system and version
|
label: Operating system and version
|
||||||
@ -69,7 +62,7 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: Active renderer
|
label: Active renderer
|
||||||
description: You can find this in the "About" tab in the main menu.
|
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:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
@ -32,6 +32,27 @@ local function get_credits()
|
|||||||
return json
|
return json
|
||||||
end
|
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 {
|
return {
|
||||||
name = "about",
|
name = "about",
|
||||||
caption = fgettext("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/]" ..
|
"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) .. "]"
|
"hypertext[5.5,0.25;9.75,6.6;credits;" .. core.formspec_escape(hypertext) .. "]"
|
||||||
|
|
||||||
-- Render information
|
local active_renderer_info = fgettext("Active renderer:") .. "\n" ..
|
||||||
local active_renderer_info = fgettext("Active renderer:") .. " " ..
|
core.formspec_escape(get_renderer_info())
|
||||||
core.formspec_escape(core.get_active_renderer())
|
|
||||||
fs = fs .. "style[label_button2;border=false]" ..
|
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 .. "]"
|
"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
|
if PLATFORM == "Android" then
|
||||||
fs = fs .. "button[0.5,5.1;4.5,0.8;share_debug;" .. fgettext("Share debug log") .. "]"
|
fs = fs .. "button[0.5,5.1;4.5,0.8;share_debug;" .. fgettext("Share debug log") .. "]"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user