ofs | hex dump | ascii |
---|
0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 02 69 00 00 02 99 08 06 00 00 00 e3 e3 bc | .PNG........IHDR...i............ |
0020 | cb 00 00 00 04 73 42 49 54 08 08 08 08 7c 08 64 88 00 00 20 00 49 44 41 54 78 9c ec bd 7b 78 5c | .....sBIT....|.d.....IDATx...{x\ |
0040 | 57 7d ef fd dd 73 91 2c df 74 b1 64 2b 96 9c ab 2c b0 dc 44 8e ed c4 b2 6c e7 62 93 f4 a5 21 60 | W}...s.,.t.d+...,..D....l.b...!` |
0060 | c8 79 e1 e5 79 ce cb 69 89 42 4e 69 49 03 49 28 6d e1 10 13 da b4 2e 35 2e 50 fa 42 fc 00 a1 ed | .y..y..i.BNiI.I(m......5.P.B.... |
0080 | 13 20 5c 1c 20 f4 94 9c 18 48 7c 4b 1c cb 91 9d d8 24 56 42 b0 15 df 24 5b 92 6d 49 96 46 33 fb | ..\......H|K.....$VB...$[.mI.F3. |
00a0 | fd 63 cf 9e d9 97 b5 d7 5a fb 36 b3 67 e6 f7 f1 33 8f a5 59 6b 5f 66 69 66 ef ef 7c d7 6f fd 7e | .c......Z.6.g...3..Yk_fif..|.o.~ |
00c0 | ca 2b bd ff a1 c6 63 71 f0 48 67 d2 dc f6 e9 d4 34 b7 5d 89 c5 b8 ed 32 a8 99 8c ef 7d f0 58 f7 | .+....cq.Hg.....4.]....2....}.X. |
00e0 | db 4f 70 db 2f bc 71 9e db ae 24 15 e1 31 54 55 75 75 4e 25 cb 14 a7 4d 3c 4c fe e0 bf 55 35 e6 | .Op./.q...$..1TUuuN%...M<L...U5. |
0100 | f1 9b 5f 5e fb 38 b7 3d 23 78 2f c6 04 ef f7 e1 91 61 fe 09 00 98 9c 9a 14 f6 e1 31 af 81 ff 22 | .._^.8.=#x/......a.........1..." |
0120 | ab aa aa f9 ed c9 24 b7 7d 62 62 42 78 0e 13 97 f8 7d aa aa aa 84 fb e0 21 ba 6e c5 13 09 76 43 | ......$.}bbBx....}......!.n...vC |
0140 | f6 63 28 fa 3b 02 c0 4d 47 04 d7 85 d7 f8 d7 05 f0 87 31 77 2e 91 46 74 8e a2 cf b4 df ed 83 40 | .c(.;..MG.........1w..Ft.......@ |
0160 | f4 a7 16 5c 13 0e ac e1 5c 13 94 fc 7b 89 f7 52 fc 5e 17 8a 7d 4d 00 fc 5f 17 c2 be 26 00 3e ae | ...\....\...{..R.^..}M.._...&.>. |
0180 | 0b 59 44 5a 63 dd 61 9f d7 04 99 97 68 f8 cc f0 cf 96 20 bc e0 ff 73 e6 1d 89 ef 03 4a 82 7f 57 | .YDZc.a.....h.........s.....J..W |
01a0 | 10 dd bc cf 0c 9d e1 b6 37 cf 6f 16 9f 04 51 1c 4a 41 14 11 a5 85 6a fe b1 10 9a 93 a8 1c 48 a4 | ........7.o...Q.JA....j.......H. |
01c0 | 11 44 c0 9c 38 39 c0 6d af a9 99 c5 6d 9f 3d 7b 36 66 63 36 b7 8f e8 db 62 55 75 b8 4a d9 69 ff | .D..89.m....m.={6fc6....bUu.J.i. |
01e0 | 53 93 3c 1b b5 c8 90 40 ab 5c ac 7f fb 10 95 14 09 b5 e2 21 ba 2e 96 22 24 d2 08 82 08 0c 5d bc | S.<....@.\.........!..."$.....]. |
0200 | 4d a7 a6 31 6b 26 5f 8c fa 0d 83 10 4d 4b 30 1d 51 17 42 4d 05 c4 ce ac 71 f6 27 c2 fa 94 b0 10 | M..1k&_.....MK0.Q.BM....q.'..... |
0220 | b2 60 27 a1 46 04 05 89 34 82 20 ca 0e e6 3d d8 ad 40 73 0b c3 5c 14 c5 aa 96 55 9c 6a aa d8 27 | .`'.F...4.....=..@s..\....U.j..' |
0240 | 50 44 18 aa 8c 84 1a 11 04 25 21 d2 c2 5e 34 40 10 44 f9 10 94 40 bb 59 b0 98 88 b0 20 5a 24 51 | PD.......%!..^4@.D...@.Y.....Z$Q |
0260 | 4c 04 8e a8 12 f7 17 a7 0a 80 84 1a 11 0c 96 6b 55 02 f0 be 7a 33 91 2c 09 8d 17 09 ca ea 1b 33 | L..............kU...z3.,.......3 |
0280 | 41 44 14 db a7 cc e5 c7 8e 3e a5 84 17 06 9d 16 13 19 14 5a 26 cd cf 82 20 8a 55 15 ad ce 2c 76 | AD.......>.........Z&.....U...,v |
02a0 | 9c 2a 11 0e be 54 96 28 f5 86 ce c5 8b 17 fc 1c 46 6a 59 6e 32 c1 ff 1a 27 4c 9b a0 0a be ef 14 | .*...T.(........FjYn2...'L...... |
02c0 | 30 f0 94 20 08 f7 90 40 23 c2 c2 b3 23 56 61 56 9a 48 08 8a d2 90 84 1d a7 2a db 87 8b f5 14 43 | 0......@#...#VaV.H.......*.....C |
02e0 | 9e e8 23 2b cc 2b 96 2b ba d0 29 2b a7 3b 40 05 5d 74 88 d2 80 04 1a 11 36 7e 85 5a 85 e9 b5 ca | ..#+.+.+..)+.;@.]t......6~.Z.... |
0300 | c1 2a da 04 9e 92 db 38 55 12 69 84 7b 4a fc 8e a6 a6 f9 2f e0 d4 e9 13 dc f6 58 9c 3e 36 51 22 | .*.....8U.i.{J...../......X.>6Q" |
0320 | 14 81 56 e2 ef 71 22 1c 7c 09 35 3f db 13 15 0b dd 6d 88 ca a2 d6 ff 2e aa 05 99 b9 67 cc e0 1f | ..V..q".|.5?.....m..........g... |
0340 | a4 66 46 0d b7 5d 26 d6 33 9d 0e d7 63 77 8a 53 8d 5a 1e a2 c0 05 1a 89 33 29 de f3 e2 9d f8 f9 | .fF..]&.3...cw.S.Z......3)...... |
0360 | 8d 3f 2b f6 69 14 05 bf 42 8b 84 1a e1 06 12 69 04 51 62 84 2d d0 b8 c7 ce 8a 37 d9 78 54 1e 41 | .?+.i...B......i.Qb.-.....7.xT.A |
0380 | c6 aa b2 c4 96 4c 9c 2a cf 45 b3 c6 a9 66 14 52 70 00 f0 d0 85 bf c4 11 1c c6 7b 5e bc 13 37 de | .....L.*.E...f.Rp.........{^..7. |
03a0 | --Minetest
--Copyright (C) 2014 sapier
--Copyright (C) 2018 rubenwardy <rw@rubenwardy.com>
--
--This program is free software; you can redistribute it and/or modify
--it under the terms of the GNU Lesser General Public License as published by
--the Free Software Foundation; either version 2.1 of the License, or
--(at your option) any later version.
--
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--GNU Lesser General Public License for more details.
--
--You should have received a copy of the GNU Lesser General Public License along
--with this program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
local packages_raw
local packages
--------------------------------------------------------------------------------
local function get_formspec(tabview, name, tabdata)
if pkgmgr.global_mods == nil then
pkgmgr.refresh_globals()
end
if pkgmgr.games == nil then
pkgmgr.update_gamelist()
end
if packages == nil then
packages_raw = {}
table.insert_all(packages_raw, pkgmgr.games)
table.insert_all(packages_raw, pkgmgr.get_texture_packs())
table.insert_all(packages_raw, pkgmgr.global_mods:get_list())
local function get_data()
return packages_raw
end
local function is_equal(element, uid) --uid match
return (element.type == "game" and element.id == uid) or
element.name == uid
end
packages = filterlist.create(get_data, pkgmgr.compare_package,
is_equal, nil, {})
end
if tabdata.selected_pkg == nil then
tabdata.selected_pkg = 1
end
local retval =
"label[0.05,-0.25;".. fgettext("Installed Packages:") .. "]" ..
"tablecolumns[color;tree;text]" ..
"table[0,0.25;5.1,4.3;pkglist;" ..
pkgmgr.render_packagelist(packages) ..
";" .. tabdata.selected_pkg .. "]" ..
"button[0,4.85;5.25,0.5;btn_contentdb;".. fgettext("Browse online content") .. "]"
local selected_pkg
if filterlist.size(packages) >= tabdata.selected_pkg then
selected_pkg = packages:get_list()[tabdata.selected_pkg]
end
if selected_pkg ~= nil then
--check for screenshot beeing available
local screenshotfilename = selected_pkg.path .. DIR_DELIM .. "screenshot.png"
local screenshotfile, error = io.open(screenshotfilename, "r")
local modscreenshot
if error == nil then
screenshotfile:close()
modscreenshot = screenshotfilename
end
if modscreenshot == nil then
modscreenshot = defaulttexturedir .. "no_screenshot.png"
end
local info = core.get_content_info(selected_pkg.path)
local desc = fgettext("No package description available")
if info.description and info.description:trim() ~= "" then
desc = info. | ....8~.........J.jD..-.."..%....<
"image[5.5,0;3,2;" .. core.formspec_escape(modscreenshot) .. "]" ..
"label[8.25,0.6;" .. core.formspec_escape(selected_pkg.name) .. "]" ..
"box[5.5,2.2;6.15,2.35;#000]"
if selected_pkg.type == "mod" then
if selected_pkg.is_modpack then
retval = retval ..
"button[8.65,4.65;3.25,1;btn_mod_mgr_rename_modpack;" ..
fgettext("Rename") .. "]"
else
--show dependencies
desc = desc .. "\n\n"
local toadd_hard = table.concat(info.depends or {}, "\n")
local toadd_soft = table.concat(info.optional_depends or {}, "\n")
if toadd_hard == "" and toadd_soft == "" then
desc = desc .. fgettext("No dependencies.")
else
if toadd_hard ~= "" then
desc = desc ..fgettext("Dependencies:") ..
"\n" .. toadd_hard
end
if toadd_soft ~= "" then
if toadd_hard ~= "" then
desc = desc .. "\n\n"
end
desc = desc .. fgettext("Optional dependencies:") ..
"\n" .. toadd_soft
end
end
end
else
if selected_pkg.type == "txp" then
if selected_pkg.enabled then
retval = retval ..
"button[8.65,4.65;3.25,1;btn_mod_mgr_disable_txp;" ..
fgettext("Disable Texture Pack") .. "]"
else
retval = retval ..
"button[8.65,4.65;3.25,1;btn_mod_mgr_use_txp;" ..
fgettext("Use Texture Pack") .. "]"
end
end
end
retval = retval .. "textarea[5.85,2.2;6.35,2.9;;" ..
fgettext("Information:") .. ";" .. desc .. "]" ..
"button[5.5,4.65;3.25,1;btn_mod_mgr_delete_mod;" ..
fgettext("Uninstall Package") .. "]"
end
return retval
end
--------------------------------------------------------------------------------
local function handle_buttons(tabview, fields, tabname, tabdata)
if fields["pkglist"] ~= nil then
local event = core.explode_table_event(fields["pkglist"])
tabdata.selected_pkg = event.row
return true
end
if fields["btn_mod_mgr_install_local"] ~= nil then
core.show_file_open_dialog("mod_mgt_open_dlg", fgettext("Select Package File:"))
return true
end
if fields["btn_contentdb"] ~= nil then
local dlg = create_store_dlg()
dlg:set_parent(tabview)
tabview:hide()
dlg:show()
packages = nil
return true
end
if fields["btn_mod_mgr_rename_modpack"] ~= nil then
local dlg_renamemp = create_rename_modpack_dlg(tabdata.selected_pkg)
dlg_renamemp:set_parent(tabview)
tabview:hide()
dlg_renamemp:show()
return true
end
if fields["btn_mod_mgr_delete_mod"] ~= nil then
local mod = packages:get_list()[tabdata.selected_pkg]
local dlg_delmod = create_delete_content_dlg(mod)
dlg_delmod:set_parent(tabview)
tabview:hide()
dlg_delmod:show()
packages = nil
return true
end
if fields.btn_mod_mgr_use_txp then
local txp = packages:get_list()[tabdata.selected_pkg]
core.settings:set("texture_path", txp.path)
packages = nil
return true
end
if fields.btn_mod_mgr_disable_txp then
core.settings:set("texture_path", "")
packages = nil
return true
end
if fields["mod_mgt_open_dlg_accepted"] and
fields["mod_mgt_open_dlg_accepted"] ~= "" then
pkgmgr.install_mod(fields["mod_mgt_open_dlg_accepted"],nil)
return true
end
return false
end
--------------------------------------------------------------------------------
return {
name = "content",
caption = fgettext("Content"),
cbf_formspec = get_formspec,
cbf_button_handler = handle_buttons,
on_change = pkgmgr.update_gamelist
}
|