]> git.lizzy.rs Git - dragonfireclient.git/blob - builtin/mainmenu/tab_about.lua
Android: Add support for sharing debug.txt (#12370)
[dragonfireclient.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 --------------------------------------------------------------------------------
19
20 local core_developers = {
21         "Perttu Ahola (celeron55) <celeron55@gmail.com>",
22         "sfan5 <sfan5@live.de>",
23         "Nathanaël Courant (Nore/Ekdohibs) <nore@mesecons.net>",
24         "Loic Blot (nerzhul/nrz) <loic.blot@unix-experience.fr>",
25         "paramat",
26         "Andrew Ward (rubenwardy) <rw@rubenwardy.com>",
27         "Krock/SmallJoker <mk939@ymail.com>",
28         "Lars Hofhansl <larsh@apache.org>",
29         "Pierre-Yves Rollo <dev@pyrollo.com>",
30         "v-rob <robinsonvincent89@gmail.com>",
31         "hecks",
32         "Hugues Ross <hugues.ross@gmail.com>",
33         "Dmitry Kostenko (x2048) <codeforsmile@gmail.com>",
34 }
35
36 -- For updating active/previous contributors, see the script in ./util/gather_git_credits.py
37
38 local active_contributors = {
39         "Wuzzy [I18n for builtin, liquid features, fixes]",
40         "Zughy [Various features and fixes]",
41         "numzero [Graphics and rendering]",
42         "Desour [Internal fixes, Clipboard on X11]",
43         "Lars Müller [Various internal fixes]",
44         "JosiahWI [CMake, cleanups and fixes]",
45         "HybridDog [builtin, documentation]",
46         "Jude Melton-Houghton [Database implementation]",
47         "savilli [Fixes]",
48         "Liso [Shadow Mapping]",
49         "MoNTE48 [Build fix]",
50         "Jean-Patrick Guerrero (kilbith) [Fixes]",
51         "ROllerozxa [Code cleanups]",
52         "Lejo [bitop library integration]",
53         "LoneWolfHT [Build fixes]",
54         "NeroBurner [Joystick]",
55         "Elias Fleckenstein [Internal fixes]",
56         "David CARLIER [Unix & Haiku build fixes]",
57         "pecksin [Clickable web links]",
58         "srfqi [Android & rendering fixes]",
59         "EvidenceB [Formspec]",
60 }
61
62 local previous_core_developers = {
63         "BlockMen",
64         "Maciej Kasatkin (RealBadAngel) [RIP]",
65         "Lisa Milne (darkrose) <lisa@ltmnet.com>",
66         "proller",
67         "Ilya Zhuravlev (xyz) <xyz@minetest.net>",
68         "PilzAdam <pilzadam@minetest.net>",
69         "est31 <MTest31@outlook.com>",
70         "kahrl <kahrl@gmx.net>",
71         "Ryan Kwolek (kwolekr) <kwolekr@minetest.net>",
72         "sapier",
73         "Zeno",
74         "ShadowNinja <shadowninja@minetest.net>",
75         "Auke Kok (sofar) <sofar@foo-projects.org>",
76         "Aaron Suen <warr1024@gmail.com>",
77 }
78
79 local previous_contributors = {
80         "Nils Dagsson Moskopp (erlehmann) <nils@dieweltistgarnichtso.net> [Minetest Logo]",
81         "red-001 <red-001@outlook.ie>",
82         "Giuseppe Bilotta",
83         "Dániel Juhász (juhdanad) <juhdanad@gmail.com>",
84         "MirceaKitsune <mirceakitsune@gmail.com>",
85         "Constantin Wenger (SpeedProg)",
86         "Ciaran Gultnieks (CiaranG)",
87         "Paul Ouellette (pauloue)",
88         "stujones11",
89         "Rogier <rogier777@gmail.com>",
90         "Gregory Currie (gregorycu)",
91         "JacobF",
92         "Jeija <jeija@mesecons.net> [HTTP, particles]",
93 }
94
95 local function buildCreditList(source)
96         local ret = {}
97         for i = 1, #source do
98                 ret[i] = core.formspec_escape(source[i])
99         end
100         return table.concat(ret, ",,")
101 end
102
103 return {
104         name = "about",
105         caption = fgettext("About"),
106         cbf_formspec = function(tabview, name, tabdata)
107                 local logofile = defaulttexturedir .. "logo.png"
108                 local version = core.get_version()
109                 local fs = "image[0.75,0.5;2.2,2.2;" .. core.formspec_escape(logofile) .. "]" ..
110                         "style[label_button;border=false]" ..
111                         "button[0.5,2;2.5,2;label_button;" .. version.project .. " " .. version.string .. "]" ..
112                         "button[0.75,2.75;2,2;homepage;minetest.net]" ..
113                         "tablecolumns[color;text]" ..
114                         "tableoptions[background=#00000000;highlight=#00000000;border=false]" ..
115                         "table[3.5,-0.25;8.5,6.05;list_credits;" ..
116                         "#FFFF00," .. fgettext("Core Developers") .. ",," ..
117                         buildCreditList(core_developers) .. ",,," ..
118                         "#FFFF00," .. fgettext("Active Contributors") .. ",," ..
119                         buildCreditList(active_contributors) .. ",,," ..
120                         "#FFFF00," .. fgettext("Previous Core Developers") ..",," ..
121                         buildCreditList(previous_core_developers) .. ",,," ..
122                         "#FFFF00," .. fgettext("Previous Contributors") .. ",," ..
123                         buildCreditList(previous_contributors) .. "," ..
124                         ";1]"
125
126                 -- Render information
127                 fs = fs .. "label[0.75,4.9;" ..
128                         fgettext("Active renderer:") .. "\n" ..
129                         core.formspec_escape(core.get_screen_info().render_info) .. "]"
130
131                 if PLATFORM == "Android" then
132                         fs = fs .. "button[0,4;3.5,1;share_debug;" .. fgettext("Share debug log") .. "]"
133                 else
134                         fs = fs .. "tooltip[userdata;" ..
135                                         fgettext("Opens the directory that contains user-provided worlds, games, mods,\n" ..
136                                                         "and texture packs in a file manager / explorer.") .. "]"
137                         fs = fs .. "button[0,4;3.5,1;userdata;" .. fgettext("Open User Data Directory") .. "]"
138                 end
139
140                 return fs
141         end,
142         cbf_button_handler = function(this, fields, name, tabdata)
143                 if fields.homepage then
144                         core.open_url("https://www.minetest.net")
145                 end
146
147                 if fields.share_debug then
148                         local path = core.get_user_path() .. DIR_DELIM .. "debug.txt"
149                         core.share_file(path)
150                 end
151
152                 if fields.userdata then
153                         core.open_dir(core.get_user_path())
154                 end
155         end,
156 }