tab_about.lua 6.2 KB

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