2025-04-05 01:19:52 +02:00
|
|
|
-- Luanti
|
|
|
|
-- Copyright (C) 2013 sapier
|
|
|
|
-- SPDX-License-Identifier: LGPL-2.1-or-later
|
2014-04-18 15:39:15 +02:00
|
|
|
|
2016-03-21 13:15:50 +09:00
|
|
|
|
2022-07-28 21:02:01 +02:00
|
|
|
local function prepare_credits(dest, source)
|
2023-10-22 15:32:14 +02:00
|
|
|
local string = table.concat(source, "\n") .. "\n"
|
|
|
|
|
2024-03-31 19:24:27 +01:00
|
|
|
string = core.hypertext_escape(string)
|
2023-10-22 15:32:14 +02:00
|
|
|
string = string:gsub("%[.-%]", "<gray>%1</gray>")
|
2022-07-28 21:02:01 +02:00
|
|
|
|
2023-10-22 15:32:14 +02:00
|
|
|
table.insert(dest, string)
|
2017-05-28 20:37:44 +01:00
|
|
|
end
|
|
|
|
|
2024-08-17 15:49:53 +01:00
|
|
|
local function get_credits()
|
|
|
|
local f = assert(io.open(core.get_mainmenu_path() .. "/credits.json"))
|
|
|
|
local json = core.parse_json(f:read("*all"))
|
|
|
|
f:close()
|
|
|
|
return json
|
|
|
|
end
|
|
|
|
|
2024-12-14 17:25:52 +01:00
|
|
|
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
|
|
|
|
|
2016-03-31 17:26:39 +09:00
|
|
|
return {
|
2021-03-30 21:49:15 +02:00
|
|
|
name = "about",
|
|
|
|
caption = fgettext("About"),
|
2023-10-18 20:18:50 +02:00
|
|
|
|
2016-03-21 13:15:50 +09:00
|
|
|
cbf_formspec = function(tabview, name, tabdata)
|
|
|
|
local logofile = defaulttexturedir .. "logo.png"
|
2014-05-06 22:31:35 -04:00
|
|
|
local version = core.get_version()
|
2022-07-28 21:02:01 +02:00
|
|
|
|
2023-10-22 15:32:14 +02:00
|
|
|
local hypertext = {
|
|
|
|
"<tag name=heading color=#ff0>",
|
|
|
|
"<tag name=gray color=#aaa>",
|
|
|
|
}
|
|
|
|
|
2024-08-17 15:49:53 +01:00
|
|
|
local credits = get_credits()
|
|
|
|
|
2023-10-22 15:32:14 +02:00
|
|
|
table.insert_all(hypertext, {
|
|
|
|
"<heading>", fgettext_ne("Core Developers"), "</heading>\n",
|
2022-07-28 21:02:01 +02:00
|
|
|
})
|
2024-08-17 15:49:53 +01:00
|
|
|
prepare_credits(hypertext, credits.core_developers)
|
2023-10-22 15:32:14 +02:00
|
|
|
table.insert_all(hypertext, {
|
|
|
|
"\n",
|
|
|
|
"<heading>", fgettext_ne("Core Team"), "</heading>\n",
|
2022-07-28 21:02:01 +02:00
|
|
|
})
|
2024-08-17 15:49:53 +01:00
|
|
|
prepare_credits(hypertext, credits.core_team)
|
2023-10-22 15:32:14 +02:00
|
|
|
table.insert_all(hypertext, {
|
|
|
|
"\n",
|
|
|
|
"<heading>", fgettext_ne("Active Contributors"), "</heading>\n",
|
2022-07-28 21:02:01 +02:00
|
|
|
})
|
2024-08-17 15:49:53 +01:00
|
|
|
prepare_credits(hypertext, credits.contributors)
|
2023-10-22 15:32:14 +02:00
|
|
|
table.insert_all(hypertext, {
|
|
|
|
"\n",
|
|
|
|
"<heading>", fgettext_ne("Previous Core Developers"), "</heading>\n",
|
2022-07-28 21:02:01 +02:00
|
|
|
})
|
2024-08-17 15:49:53 +01:00
|
|
|
prepare_credits(hypertext, credits.previous_core_developers)
|
2023-10-22 15:32:14 +02:00
|
|
|
table.insert_all(hypertext, {
|
|
|
|
"\n",
|
|
|
|
"<heading>", fgettext_ne("Previous Contributors"), "</heading>\n",
|
2022-07-28 21:02:01 +02:00
|
|
|
})
|
2024-08-17 15:49:53 +01:00
|
|
|
prepare_credits(hypertext, credits.previous_contributors)
|
2023-10-22 15:32:14 +02:00
|
|
|
|
|
|
|
hypertext = table.concat(hypertext):sub(1, -2)
|
2022-07-28 21:02:01 +02:00
|
|
|
|
|
|
|
local fs = "image[1.5,0.6;2.5,2.5;" .. core.formspec_escape(logofile) .. "]" ..
|
2020-12-19 13:27:15 +00:00
|
|
|
"style[label_button;border=false]" ..
|
2022-07-28 21:02:01 +02:00
|
|
|
"button[0.1,3.4;5.3,0.5;label_button;" ..
|
|
|
|
core.formspec_escape(version.project .. " " .. version.string) .. "]" ..
|
2024-10-27 14:04:51 +01:00
|
|
|
"button_url[1.5,4.1;2.5,0.8;homepage;luanti.org;https://www.luanti.org/]" ..
|
2024-10-28 19:40:18 +01:00
|
|
|
"hypertext[5.5,0.25;9.75,6.6;credits;" .. core.formspec_escape(hypertext) .. "]"
|
2020-12-19 13:27:15 +00:00
|
|
|
|
2024-12-14 17:25:52 +01:00
|
|
|
local active_renderer_info = fgettext("Active renderer:") .. "\n" ..
|
|
|
|
core.formspec_escape(get_renderer_info())
|
2022-07-28 21:02:01 +02:00
|
|
|
fs = fs .. "style[label_button2;border=false]" ..
|
2024-12-14 17:25:52 +01:00
|
|
|
"button[0.1,6;5.3,1;label_button2;" .. active_renderer_info .. "]"..
|
2023-07-17 20:44:54 +02:00
|
|
|
"tooltip[label_button2;" .. active_renderer_info .. "]"
|
|
|
|
|
2022-06-05 17:42:09 +01:00
|
|
|
if PLATFORM == "Android" then
|
2022-07-28 21:02:01 +02:00
|
|
|
fs = fs .. "button[0.5,5.1;4.5,0.8;share_debug;" .. fgettext("Share debug log") .. "]"
|
2022-06-05 17:42:09 +01:00
|
|
|
else
|
2020-12-19 13:27:15 +00:00
|
|
|
fs = fs .. "tooltip[userdata;" ..
|
|
|
|
fgettext("Opens the directory that contains user-provided worlds, games, mods,\n" ..
|
|
|
|
"and texture packs in a file manager / explorer.") .. "]"
|
2022-07-28 21:02:01 +02:00
|
|
|
fs = fs .. "button[0.5,5.1;4.5,0.8;userdata;" .. fgettext("Open User Data Directory") .. "]"
|
2020-12-19 13:27:15 +00:00
|
|
|
end
|
|
|
|
|
2023-08-28 22:36:54 +01:00
|
|
|
return fs
|
2020-05-17 19:09:10 +01:00
|
|
|
end,
|
2023-10-18 20:18:50 +02:00
|
|
|
|
2020-05-17 19:09:10 +01:00
|
|
|
cbf_button_handler = function(this, fields, name, tabdata)
|
2022-06-05 17:42:09 +01:00
|
|
|
if fields.share_debug then
|
|
|
|
local path = core.get_user_path() .. DIR_DELIM .. "debug.txt"
|
|
|
|
core.share_file(path)
|
|
|
|
end
|
|
|
|
|
2020-12-19 13:27:15 +00:00
|
|
|
if fields.userdata then
|
|
|
|
core.open_dir(core.get_user_path())
|
|
|
|
end
|
2020-05-17 19:09:10 +01:00
|
|
|
end,
|
2023-10-18 20:18:50 +02:00
|
|
|
|
|
|
|
on_change = function(type)
|
|
|
|
if type == "ENTER" then
|
|
|
|
mm_game_theme.set_engine()
|
|
|
|
end
|
|
|
|
end,
|
2016-03-21 13:15:50 +09:00
|
|
|
}
|