]> git.lizzy.rs Git - minetest.git/blob - builtin/mainmenu/tab_about.lua
a84ebce3f69506d8d4ad11d2b8de6eeba53c8d74
[minetest.git] / builtin / mainmenu / tab_about.lua
1 --Minetest
2 --Copyright (C) 2013 sapier
3 --
4 --This program is free software; you can redistribute it and/or modify
5 --it under the terms of the GNU Lesser General Public License as published by
6 --the Free Software Foundation; either version 2.1 of the License, or
7 --(at your option) any later version.
8 --
9 --This program is distributed in the hope that it will be useful,
10 --but WITHOUT ANY WARRANTY; without even the implied warranty of
11 --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 --GNU Lesser General Public License for more details.
13 --
14 --You should have received a copy of the GNU Lesser General Public License along
15 --with this program; if not, write to the Free Software Foundation, Inc.,
16 --51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18 -- https://github.com/orgs/minetest/teams/engine/members
19
20 local core_developers = {
21         "Perttu Ahola (celeron55) <celeron55@gmail.com> [Project founder]",
22         "sfan5 <sfan5@live.de>",
23         "ShadowNinja <shadowninja@minetest.net>",
24         "Nathanaëlle Courant (Nore/Ekdohibs) <nore@mesecons.net>",
25         "Loic Blot (nerzhul/nrz) <loic.blot@unix-experience.fr>",
26         "Andrew Ward (rubenwardy) <rw@rubenwardy.com>",
27         "Krock/SmallJoker <mk939@ymail.com>",
28         "Lars Hofhansl <larsh@apache.org>",
29         "v-rob <robinsonvincent89@gmail.com>",
30         "hecks",
31         "Hugues Ross <hugues.ross@gmail.com>",
32         "Dmitry Kostenko (x2048) <codeforsmile@gmail.com>",
33 }
34
35 local core_team = {
36         "Zughy [Issue triager]",
37 }
38
39 -- For updating active/previous contributors, see the script in ./util/gather_git_credits.py
40
41 local active_contributors = {
42         "Wuzzy [Features, translations, devtest]",
43         "Lars Müller [Lua optimizations and fixes]",
44         "Jude Melton-Houghton [Optimizations, bugfixes]",
45         "paradust7 [Performance, fixes, Irrlicht refactoring]",
46         "Desour [Fixes]",
47         "ROllerozxa [Main menu]",
48         "savilli [Bugfixes]",
49         "Lexi Hale [Particlespawner animation]",
50         "Liso [Shadow Mapping]",
51         "JosiahWI [Fixes, build system]",
52         "numzero [Graphics and rendering]",
53         "HybridDog [Fixes]",
54         "NeroBurner [Joystick]",
55         "pecksin [Clickable web links]",
56         "Daroc Alden [Fixes]",
57         "Jean-Patrick Guerrero (kilbith) [Fixes]",
58 }
59
60 local previous_core_developers = {
61         "BlockMen",
62         "Maciej Kasatkin (RealBadAngel) [RIP]",
63         "Lisa Milne (darkrose) <lisa@ltmnet.com>",
64         "proller",
65         "Ilya Zhuravlev (xyz) <xyz@minetest.net>",
66         "PilzAdam <pilzadam@minetest.net>",
67         "est31 <MTest31@outlook.com>",
68         "kahrl <kahrl@gmx.net>",
69         "Ryan Kwolek (kwolekr) <kwolekr@minetest.net>",
70         "sapier",
71         "Zeno",
72         "Auke Kok (sofar) <sofar@foo-projects.org>",
73         "Aaron Suen <warr1024@gmail.com>",
74         "paramat",
75         "Pierre-Yves Rollo <dev@pyrollo.com>",
76 }
77
78 local previous_contributors = {
79         "Nils Dagsson Moskopp (erlehmann) <nils@dieweltistgarnichtso.net> [Minetest logo]",
80         "red-001 <red-001@outlook.ie>",
81         "Giuseppe Bilotta",
82         "ClobberXD",
83         "Dániel Juhász (juhdanad) <juhdanad@gmail.com>",
84         "MirceaKitsune <mirceakitsune@gmail.com>",
85         "MoNTE48",
86         "Constantin Wenger (SpeedProg)",
87         "Ciaran Gultnieks (CiaranG)",
88         "Paul Ouellette (pauloue)",
89         "stujones11",
90         "srifqi",
91         "Rogier <rogier777@gmail.com>",
92         "Gregory Currie (gregorycu)",
93         "JacobF",
94         "Jeija <jeija@mesecons.net>",
95 }
96
97 local function prepare_credits(dest, source)
98         for _, s in ipairs(source) do
99                 -- if there's text inside brackets make it gray-ish
100                 s = s:gsub("%[.-%]", core.colorize("#aaa", "%1"))
101                 dest[#dest+1] = s
102         end
103 end
104
105 local function build_hacky_list(items, spacing)
106         spacing = spacing or 0.5
107         local y = spacing / 2
108         local ret = {}
109         for _, item in ipairs(items) do
110                 if item ~= "" then
111                         ret[#ret+1] = ("label[0,%f;%s]"):format(y, core.formspec_escape(item))
112                 end
113                 y = y + spacing
114         end
115         return table.concat(ret, ""), y
116 end
117
118 return {
119         name = "about",
120         caption = fgettext("About"),
121         cbf_formspec = function(tabview, name, tabdata)
122                 local logofile = defaulttexturedir .. "logo.png"
123                 local version = core.get_version()
124
125                 local credit_list = {}
126                 table.insert_all(credit_list, {
127                         core.colorize("#ff0", fgettext("Core Developers"))
128                 })
129                 prepare_credits(credit_list, core_developers)
130                 table.insert_all(credit_list, {
131                         "",
132                         core.colorize("#ff0", fgettext("Core Team"))
133                 })
134                 prepare_credits(credit_list, core_team)
135                 table.insert_all(credit_list, {
136                         "",
137                         core.colorize("#ff0", fgettext("Active Contributors"))
138                 })
139                 prepare_credits(credit_list, active_contributors)
140                 table.insert_all(credit_list, {
141                         "",
142                         core.colorize("#ff0", fgettext("Previous Core Developers"))
143                 })
144                 prepare_credits(credit_list, previous_core_developers)
145                 table.insert_all(credit_list, {
146                         "",
147                         core.colorize("#ff0", fgettext("Previous Contributors"))
148                 })
149                 prepare_credits(credit_list, previous_contributors)
150                 local credit_fs, scroll_height = build_hacky_list(credit_list)
151                 -- account for the visible portion
152                 scroll_height = math.max(0, scroll_height - 6.9)
153
154                 local fs = "image[1.5,0.6;2.5,2.5;" .. core.formspec_escape(logofile) .. "]" ..
155                         "style[label_button;border=false]" ..
156                         "button[0.1,3.4;5.3,0.5;label_button;" ..
157                         core.formspec_escape(version.project .. " " .. version.string) .. "]" ..
158                         "button[1.5,4.1;2.5,0.8;homepage;minetest.net]" ..
159                         "scroll_container[5.5,0.1;9.5,6.9;scroll_credits;vertical;" ..
160                         tostring(scroll_height / 1000) .. "]" .. credit_fs ..
161                         "scroll_container_end[]"..
162                         "scrollbar[15,0.1;0.4,6.9;vertical;scroll_credits;0]"
163
164                 -- Render information
165                 fs = fs .. "style[label_button2;border=false]" ..
166                         "button[0.1,6;5.3,1;label_button2;" ..
167                         fgettext("Active renderer:") .. "\n" ..
168                         core.formspec_escape(core.get_screen_info().render_info) .. "]"
169
170                 if PLATFORM == "Android" then
171                         fs = fs .. "button[0.5,5.1;4.5,0.8;share_debug;" .. fgettext("Share debug log") .. "]"
172                 else
173                         fs = fs .. "tooltip[userdata;" ..
174                                         fgettext("Opens the directory that contains user-provided worlds, games, mods,\n" ..
175                                                         "and texture packs in a file manager / explorer.") .. "]"
176                         fs = fs .. "button[0.5,5.1;4.5,0.8;userdata;" .. fgettext("Open User Data Directory") .. "]"
177                 end
178
179                 return fs, "size[15.5,7.1,false]real_coordinates[true]"
180         end,
181         cbf_button_handler = function(this, fields, name, tabdata)
182                 if fields.homepage then
183                         core.open_url("https://www.minetest.net")
184                 end
185
186                 if fields.share_debug then
187                         local path = core.get_user_path() .. DIR_DELIM .. "debug.txt"
188                         core.share_file(path)
189                 end
190
191                 if fields.userdata then
192                         core.open_dir(core.get_user_path())
193                 end
194         end,
195 }