diff --git a/MT_skins_updater.exe b/MT_skins_updater.exe deleted file mode 100644 index 5b4ee3e..0000000 Binary files a/MT_skins_updater.exe and /dev/null differ diff --git a/Newtonsoft.Json.dll b/Newtonsoft.Json.dll deleted file mode 100644 index 054c933..0000000 Binary files a/Newtonsoft.Json.dll and /dev/null differ diff --git a/README b/README old mode 100644 new mode 100755 diff --git a/generate_previews.py b/generate_previews.py new file mode 100755 index 0000000..460f7f9 --- /dev/null +++ b/generate_previews.py @@ -0,0 +1,85 @@ +#!/bin/env python2 + +from __future__ import print_function +import sys, os, subprocess +from os import listdir +from os.path import isfile, join, sep + +def eprint(*args, **kwargs): + print(*args, file=sys.stderr, **kwargs) + +def which(program): + import os + def is_exe(fpath): + return os.path.isfile(fpath) and os.access(fpath, os.X_OK) + + fpath, fname = os.path.split(program) + if fpath: + if is_exe(program): + return program + else: + for path in os.environ["PATH"].split(os.pathsep): + path = path.strip('"') + exe_file = os.path.join(path, program) + if is_exe(exe_file): + return exe_file + + return None + +try: + from PIL import Image +except ImportError: + eprint("Could not import PIL, is it installed ?") + sys.exit(1) + +uskins_path = "u_skins" +meta_path = join(uskins_path, "meta") +textures_path = join(uskins_path, "textures") +pngcrush = which('pngcrush') +optipng = which('optipng') + +def process_copies(src, dst, copies): + for copy in copies: + srcrect = copy[0] + dstrect = copy[1] + flip = copy[2] if len(copy) > 2 else None + region = src.crop(srcrect) + if flip is not None: + region = region.transpose(flip) + dst.paste(region, dstrect) + +def make_preview(src, dst): + skin = Image.open(src) + preview = Image.new('RGBA', (16, 32)) + process_copies(skin, preview, [ + [(8, 8, 16, 16), (4, 0)], # Head + [(44, 20, 48, 32), (0, 8)], # Left arm + [(44, 20, 48, 32), (12, 8), Image.FLIP_LEFT_RIGHT], # Right arm + [(20, 20, 28, 32), (4, 8)], # Body + [(4, 20, 8, 32), (4, 20)], # Left leg + [(4, 20, 8, 32), (8, 20), Image.FLIP_LEFT_RIGHT], # Right leg + ]) + overlay = Image.new('RGBA', (16, 32)) + process_copies(skin, overlay, [ + [(40, 8, 48, 16), (4, 0)], # Head + ]) + preview = Image.alpha_composite(preview, overlay) + preview.save(dst) + if optipng is not None: + p = subprocess.Popen([optipng, '-o7', '-quiet', dst]) + p.wait() + elif pngcrush is not None: + p = subprocess.Popen([pngcrush, '-ow', '-s', dst]) + p.wait() + +if __name__ == '__main__': + metas = [f for f in listdir(meta_path) if + isfile(join(meta_path, f)) and + f.endswith(".txt")] + for meta in metas: + f = open(join(meta_path, meta), 'r') + metadata = f.read().splitlines() + f.close() + skin = meta[:-4] + print("Processing {} \"{}\" by {} ({})...".format(skin, metadata[0], metadata[1], metadata[2])) + make_preview(join(textures_path, skin + ".png"), join(textures_path, skin + "_preview.png")) diff --git a/modpack.txt b/modpack.txt old mode 100644 new mode 100755 diff --git a/u_skins/depends.txt b/u_skins/depends.txt old mode 100644 new mode 100755 diff --git a/u_skins/init.lua b/u_skins/init.lua old mode 100644 new mode 100755 index a0be27d..95260a0 --- a/u_skins/init.lua +++ b/u_skins/init.lua @@ -51,12 +51,12 @@ unified_inventory.register_page("u_skins", { if not u_skins.is_skin(u_skins.u_skins[name]) then u_skins.u_skins[name] = u_skins.default end - + local formspec = ("background[0.06,0.99;7.92,7.52;ui_misc_form.png]" .."image[0,.75;1,2;"..u_skins.u_skins[name].."_preview.png]" .."label[6,.5;Raw texture:]" .."image[6,1;2,1;"..u_skins.u_skins[name]..".png]") - + local meta = u_skins.meta[u_skins.u_skins[name]] if meta then if meta.name ~= "" then @@ -84,6 +84,8 @@ unified_inventory.register_page("u_skins", { unified_inventory.register_button("u_skins", { type = "image", image = "u_skins_button.png", + tooltip = "Skin inventory", + show_with = false, -- modif MFF (Crabman 30/06/2015) }) -- Create all of the skin-picker pages. @@ -109,8 +111,9 @@ u_skins.generate_pages = function(texture) if i > 1 and x == 0 then y = 1.8 end - formspec = (formspec.."image_button["..x..","..y..";1,2;" - ..skin[2].."_preview.png;u_skins_set$"..skin[1]..";]") + formspec = (formspec.."image_button["..x..","..y..";1,2;".. + skin[2].."_preview.png;u_skins_set$"..skin[1]..";]".. + "tooltip[u_skins_set$"..skin[1]..";"..u_skins.meta[skin[2]].name.."]") end local page_prev = page - 2 local page_next = page @@ -124,7 +127,7 @@ u_skins.generate_pages = function(texture) .."button[0,3.8;1,.5;u_skins_page$"..page_prev..";<<]" .."button[.75,3.8;6.5,.5;u_skins_null;Page "..page.."/"..total_pages.."]" .."button[7,3.8;1,.5;u_skins_page$"..page_next..";>>]") - + unified_inventory.register_page("u_skins_page$"..(page - 1), { get_formspec = function(player) return {formspec=formspec} @@ -162,4 +165,4 @@ minetest.register_on_joinplayer(function(player) end) u_skins.generate_pages() -u_skins.load_players() \ No newline at end of file +u_skins.load_players() diff --git a/u_skins/meta.lua b/u_skins/meta.lua new file mode 100755 index 0000000..350dbe8 --- /dev/null +++ b/u_skins/meta.lua @@ -0,0 +1,15 @@ +u_skins.meta = {} +for _, i in ipairs(u_skins.list) do + u_skins.meta[i] = {} + local f = io.open(u_skins.modpath.."/meta/"..i..".txt") + local data = nil + if f then + data = minetest.deserialize("return {"..f:read('*all').."}") + f:close() + end + data = data or {} + u_skins.meta[i].name = data.name or "" + u_skins.meta[i].author = data.author or "" + u_skins.meta[i].description = data.description or nil + u_skins.meta[i].comment = data.comment or nil +end diff --git a/u_skins/meta/character_1.txt b/u_skins/meta/character_1.txt old mode 100644 new mode 100755 index 7211029..dab8dce --- a/u_skins/meta/character_1.txt +++ b/u_skins/meta/character_1.txt @@ -1,3 +1,3 @@ -Sam 0 +Sam II Jordach -CC BY-SA 3.0 \ No newline at end of file +CC BY-SA 3.0 diff --git a/u_skins/meta/character_10.txt b/u_skins/meta/character_10.txt new file mode 100755 index 0000000..aca0b9c --- /dev/null +++ b/u_skins/meta/character_10.txt @@ -0,0 +1,3 @@ +lordphoenixmh +lordphoenixmh +CC BY 4.0 diff --git a/u_skins/meta/character_11.txt b/u_skins/meta/character_11.txt new file mode 100755 index 0000000..39a00d1 --- /dev/null +++ b/u_skins/meta/character_11.txt @@ -0,0 +1,3 @@ +Ladyvioletkitty +lordphoenixmh +CC BY 4.0 diff --git a/u_skins/meta/character_12.txt b/u_skins/meta/character_12.txt new file mode 100755 index 0000000..b842c08 --- /dev/null +++ b/u_skins/meta/character_12.txt @@ -0,0 +1,3 @@ +Jaded Bow +jadedtest +CC BY 4.0 diff --git a/u_skins/meta/character_13.txt b/u_skins/meta/character_13.txt new file mode 100755 index 0000000..4d23898 --- /dev/null +++ b/u_skins/meta/character_13.txt @@ -0,0 +1,3 @@ +Trevor +Ferdi Napoli +CC BY-NC-SA 3.0 diff --git a/u_skins/meta/character_14.txt b/u_skins/meta/character_14.txt new file mode 100755 index 0000000..b17c089 --- /dev/null +++ b/u_skins/meta/character_14.txt @@ -0,0 +1,3 @@ +ranta mk 2 +ranta +CC BY-SA 3.0 diff --git a/u_skins/meta/character_15.txt b/u_skins/meta/character_15.txt new file mode 100755 index 0000000..ea5909e --- /dev/null +++ b/u_skins/meta/character_15.txt @@ -0,0 +1,3 @@ +Mammu +hansuke123 +CC BY-SA 3.0 diff --git a/u_skins/meta/character_16.txt b/u_skins/meta/character_16.txt new file mode 100755 index 0000000..8bc8f23 --- /dev/null +++ b/u_skins/meta/character_16.txt @@ -0,0 +1,3 @@ +Sasuke +Bajanhgk +CC BY-NC-SA 3.0 diff --git a/u_skins/meta/character_17.txt b/u_skins/meta/character_17.txt new file mode 100755 index 0000000..7e79a2c --- /dev/null +++ b/u_skins/meta/character_17.txt @@ -0,0 +1,3 @@ +Hunky Simon with Jacket +Andromeda +CC BY-NC-SA 3.0 diff --git a/u_skins/meta/character_18.txt b/u_skins/meta/character_18.txt new file mode 100755 index 0000000..4e73e2d --- /dev/null +++ b/u_skins/meta/character_18.txt @@ -0,0 +1,3 @@ +Jayne +Andromeda +CC BY-NC-SA 3.0 diff --git a/u_skins/meta/character_19.txt b/u_skins/meta/character_19.txt new file mode 100755 index 0000000..b41f280 --- /dev/null +++ b/u_skins/meta/character_19.txt @@ -0,0 +1,3 @@ +Red-brown-shirt-dude +Krock +CC BY-SA 4.0 diff --git a/u_skins/meta/character_2.txt b/u_skins/meta/character_2.txt old mode 100644 new mode 100755 index 0187cab..383c531 --- a/u_skins/meta/character_2.txt +++ b/u_skins/meta/character_2.txt @@ -1,3 +1,3 @@ -Sam I -Jordach -CC BY-SA 3.0 \ No newline at end of file +Azou +Azeddine +CC BY-SA 3.0 diff --git a/u_skins/meta/character_20.txt b/u_skins/meta/character_20.txt new file mode 100755 index 0000000..4ab7e8a --- /dev/null +++ b/u_skins/meta/character_20.txt @@ -0,0 +1,3 @@ +ColerArt26 +Colerart_26 +CC BY-SA 4.0 diff --git a/u_skins/meta/character_21.txt b/u_skins/meta/character_21.txt new file mode 100755 index 0000000..7b8b72f --- /dev/null +++ b/u_skins/meta/character_21.txt @@ -0,0 +1,3 @@ +BrightGirl +Malarif +CC BY-NC-SA 3.0 diff --git a/u_skins/meta/character_22.txt b/u_skins/meta/character_22.txt new file mode 100755 index 0000000..adf8e8a --- /dev/null +++ b/u_skins/meta/character_22.txt @@ -0,0 +1,3 @@ +take bake the night studant +lovehart +CC BY-SA 3.0 diff --git a/u_skins/meta/character_23.txt b/u_skins/meta/character_23.txt new file mode 100755 index 0000000..f4b5262 --- /dev/null +++ b/u_skins/meta/character_23.txt @@ -0,0 +1,3 @@ +dwarf from lottmob +lovehart +CC BY-SA 3.0 diff --git a/u_skins/meta/character_24.txt b/u_skins/meta/character_24.txt new file mode 100755 index 0000000..b9acdf0 --- /dev/null +++ b/u_skins/meta/character_24.txt @@ -0,0 +1,3 @@ +Pirate girl +Misty +CC BY-SA 3.0 diff --git a/u_skins/meta/character_25.txt b/u_skins/meta/character_25.txt new file mode 100755 index 0000000..8f7bab9 --- /dev/null +++ b/u_skins/meta/character_25.txt @@ -0,0 +1,3 @@ +elf from lottmob +lovehart +CC BY-SA 3.0 diff --git a/u_skins/meta/character_26.txt b/u_skins/meta/character_26.txt new file mode 100755 index 0000000..1dd4fc7 --- /dev/null +++ b/u_skins/meta/character_26.txt @@ -0,0 +1,3 @@ +gondor guard from lottmob +lovehart +CC BY-SA 3.0 diff --git a/u_skins/meta/character_27.txt b/u_skins/meta/character_27.txt new file mode 100755 index 0000000..d648489 --- /dev/null +++ b/u_skins/meta/character_27.txt @@ -0,0 +1,3 @@ +hobbit from lottmob +lovehart +CC BY-SA 3.0 diff --git a/u_skins/meta/character_28.txt b/u_skins/meta/character_28.txt new file mode 100755 index 0000000..3fcd6f4 --- /dev/null +++ b/u_skins/meta/character_28.txt @@ -0,0 +1,3 @@ +rohan guard from lottmob +lovehart +CC BY-SA 3.0 diff --git a/u_skins/meta/character_29.txt b/u_skins/meta/character_29.txt new file mode 100755 index 0000000..df797f6 --- /dev/null +++ b/u_skins/meta/character_29.txt @@ -0,0 +1,3 @@ +npc trader from mobf +lovehart +CC BY-SA 3.0 diff --git a/u_skins/meta/character_3.txt b/u_skins/meta/character_3.txt new file mode 100755 index 0000000..50db67f --- /dev/null +++ b/u_skins/meta/character_3.txt @@ -0,0 +1,3 @@ +Older Man Sam +philipbenr +CC BY-SA 3.0 diff --git a/u_skins/meta/character_30.txt b/u_skins/meta/character_30.txt new file mode 100755 index 0000000..5f18fee --- /dev/null +++ b/u_skins/meta/character_30.txt @@ -0,0 +1,3 @@ +Adventer girl +lovehart +CC BY-SA 3.0 diff --git a/u_skins/meta/character_31.txt b/u_skins/meta/character_31.txt new file mode 100755 index 0000000..744e50d --- /dev/null +++ b/u_skins/meta/character_31.txt @@ -0,0 +1,3 @@ +Adventurer +XSuperSaintX +CC BY 3.0 diff --git a/u_skins/meta/character_32.txt b/u_skins/meta/character_32.txt new file mode 100755 index 0000000..37da348 --- /dev/null +++ b/u_skins/meta/character_32.txt @@ -0,0 +1,3 @@ +Builder +Jyrgenf +CC BY 3.0 diff --git a/u_skins/meta/character_33.txt b/u_skins/meta/character_33.txt new file mode 100755 index 0000000..5af8d93 --- /dev/null +++ b/u_skins/meta/character_33.txt @@ -0,0 +1,3 @@ +Orange +Wuzzy +CC BY-SA 3.0 diff --git a/u_skins/meta/character_34.txt b/u_skins/meta/character_34.txt new file mode 100755 index 0000000..c822f36 --- /dev/null +++ b/u_skins/meta/character_34.txt @@ -0,0 +1,3 @@ +thewillyrex +edwar masterchieft +CC BY-SA 4.0 diff --git a/u_skins/meta/character_35.txt b/u_skins/meta/character_35.txt new file mode 100755 index 0000000..637efeb --- /dev/null +++ b/u_skins/meta/character_35.txt @@ -0,0 +1,3 @@ +war-sloop +ange_black69 +CC BY-NC-SA 3.0 diff --git a/u_skins/meta/character_36.txt b/u_skins/meta/character_36.txt new file mode 100755 index 0000000..f5fae64 --- /dev/null +++ b/u_skins/meta/character_36.txt @@ -0,0 +1,3 @@ +test +addi +CC 0 (1.0) diff --git a/u_skins/meta/character_37.txt b/u_skins/meta/character_37.txt new file mode 100755 index 0000000..198d10c --- /dev/null +++ b/u_skins/meta/character_37.txt @@ -0,0 +1,3 @@ +Tree +Evergreen +CC BY-SA 3.0 diff --git a/u_skins/meta/character_38.txt b/u_skins/meta/character_38.txt new file mode 100755 index 0000000..f64986e --- /dev/null +++ b/u_skins/meta/character_38.txt @@ -0,0 +1,3 @@ +jojoa1997 2 +jojoa1997 +CC BY-SA 3.0 diff --git a/u_skins/meta/character_39.txt b/u_skins/meta/character_39.txt new file mode 100755 index 0000000..f1e054e --- /dev/null +++ b/u_skins/meta/character_39.txt @@ -0,0 +1,3 @@ +RockerLuke skin +RockerLuke +CC BY-SA 3.0 diff --git a/u_skins/meta/character_4.txt b/u_skins/meta/character_4.txt new file mode 100755 index 0000000..0cbedaa --- /dev/null +++ b/u_skins/meta/character_4.txt @@ -0,0 +1,3 @@ +Summer Sam +philipbenr +CC BY-SA 3.0 diff --git a/u_skins/meta/character_40.txt b/u_skins/meta/character_40.txt new file mode 100755 index 0000000..fd42a8a --- /dev/null +++ b/u_skins/meta/character_40.txt @@ -0,0 +1,3 @@ +Tails +Ferdi Napoli +CC BY-NC-SA 3.0 diff --git a/u_skins/meta/character_41.txt b/u_skins/meta/character_41.txt new file mode 100755 index 0000000..5f18fee --- /dev/null +++ b/u_skins/meta/character_41.txt @@ -0,0 +1,3 @@ +Adventer girl +lovehart +CC BY-SA 3.0 diff --git a/u_skins/meta/character_5.txt b/u_skins/meta/character_5.txt new file mode 100755 index 0000000..1b4ad88 --- /dev/null +++ b/u_skins/meta/character_5.txt @@ -0,0 +1,3 @@ +Samantha I +philipbenr +CC BY-SA 3.0 diff --git a/u_skins/meta/character_6.txt b/u_skins/meta/character_6.txt new file mode 100755 index 0000000..4bffff0 --- /dev/null +++ b/u_skins/meta/character_6.txt @@ -0,0 +1,3 @@ +Summer +lizzie +CC BY-NC-SA 3.0 diff --git a/u_skins/meta/character_7.txt b/u_skins/meta/character_7.txt new file mode 100755 index 0000000..35c2c58 --- /dev/null +++ b/u_skins/meta/character_7.txt @@ -0,0 +1,3 @@ +lisa +hansuke123 +CC BY-SA 3.0 diff --git a/u_skins/meta/character_8.txt b/u_skins/meta/character_8.txt new file mode 100755 index 0000000..4299931 --- /dev/null +++ b/u_skins/meta/character_8.txt @@ -0,0 +1,3 @@ +Hobo/Homeless person +Minetestian +CC BY-SA 3.0 diff --git a/u_skins/meta/character_9.txt b/u_skins/meta/character_9.txt new file mode 100755 index 0000000..5a7247a --- /dev/null +++ b/u_skins/meta/character_9.txt @@ -0,0 +1,3 @@ +manoel1500 +manoel1500 +CC BY-NC-SA 3.0 diff --git a/u_skins/meta/mff_character_1.txt b/u_skins/meta/mff_character_1.txt new file mode 100755 index 0000000..ab13d11 --- /dev/null +++ b/u_skins/meta/mff_character_1.txt @@ -0,0 +1,3 @@ +aquaman + +GPL3 diff --git a/u_skins/meta/mff_character_2.txt b/u_skins/meta/mff_character_2.txt new file mode 100755 index 0000000..5b68d96 --- /dev/null +++ b/u_skins/meta/mff_character_2.txt @@ -0,0 +1,3 @@ +Matrix +Obani +GPL3 diff --git a/u_skins/meta/mff_character_3.txt b/u_skins/meta/mff_character_3.txt new file mode 100755 index 0000000..b4a399b --- /dev/null +++ b/u_skins/meta/mff_character_3.txt @@ -0,0 +1,3 @@ +Cyclède + +GPL3 diff --git a/u_skins/meta/mff_character_4.txt b/u_skins/meta/mff_character_4.txt new file mode 100755 index 0000000..17b89af --- /dev/null +++ b/u_skins/meta/mff_character_4.txt @@ -0,0 +1,3 @@ +mystic + +GPL3 diff --git a/u_skins/meta/mff_character_5.txt b/u_skins/meta/mff_character_5.txt new file mode 100755 index 0000000..f667fb3 --- /dev/null +++ b/u_skins/meta/mff_character_5.txt @@ -0,0 +1,3 @@ +Obani +Obani +GPL3 diff --git a/u_skins/meta/mff_character_6.txt b/u_skins/meta/mff_character_6.txt new file mode 100755 index 0000000..56ce88d --- /dev/null +++ b/u_skins/meta/mff_character_6.txt @@ -0,0 +1,3 @@ +strangekiller + +GPL3 diff --git a/u_skins/meta/mff_character_7.txt b/u_skins/meta/mff_character_7.txt new file mode 100755 index 0000000..d296113 --- /dev/null +++ b/u_skins/meta/mff_character_7.txt @@ -0,0 +1,3 @@ +walkingdead + +GPL3 diff --git a/u_skins/meta/mff_character_8.txt b/u_skins/meta/mff_character_8.txt new file mode 100755 index 0000000..fed900a --- /dev/null +++ b/u_skins/meta/mff_character_8.txt @@ -0,0 +1,3 @@ +Cyberpangolin official +Cyberpangolin +?? diff --git a/u_skins/meta/mff_character_9.txt b/u_skins/meta/mff_character_9.txt new file mode 100755 index 0000000..7d4d1ed --- /dev/null +++ b/u_skins/meta/mff_character_9.txt @@ -0,0 +1,3 @@ +Greyscale Anhedonia +Mg +WTFPL diff --git a/u_skins/meta/placeholder.txt b/u_skins/meta/placeholder.txt deleted file mode 100644 index a9e6fce..0000000 --- a/u_skins/meta/placeholder.txt +++ /dev/null @@ -1 +0,0 @@ -Please run the update_from_db.py script to update the skins. diff --git a/u_skins/players.lua b/u_skins/players.lua old mode 100644 new mode 100755 index 3053530..e2a330e --- a/u_skins/players.lua +++ b/u_skins/players.lua @@ -10,15 +10,12 @@ u_skins.load_players = function() end u_skins.load_players() -local ttime = 0 -minetest.register_globalstep(function(t) - ttime = ttime + t - if ttime < 360 then --every 6min' - return - end - ttime = 0 +local function tick() + minetest.after(120, tick) --every 2min' u_skins.save() -end) +end + +minetest.after(120, tick) minetest.register_on_shutdown(function() u_skins.save() end) diff --git a/u_skins/skinlist.lua b/u_skins/skinlist.lua old mode 100644 new mode 100755 index 718646c..7e95ff9 --- a/u_skins/skinlist.lua +++ b/u_skins/skinlist.lua @@ -10,17 +10,41 @@ while fetched_skip < 40 do if file then local data = string.split(file:read("*all"), "\n", 3) file:close() - + u_skins.list[internal_id] = name u_skins.meta[name] = {} u_skins.meta[name].name = data[1] u_skins.meta[name].author = data[2] u_skins.meta[name].license = data[3] u_skins.meta[name].description = "" --what's that?? - + fetched_skip = 0 internal_id = internal_id + 1 end fetched_skip = fetched_skip + 1 id = id + 1 -end \ No newline at end of file +end + + +-- MODIFICATION MADE FOR MFF +id = 1 +fetched_skip = 0 +while fetched_skip < 40 do + local name = "mff_character_"..id + local file = io.open(u_skins.modpath.."/meta/"..name..".txt", "r") + if file then + local data = string.split(file:read("*all"), "\n", 3) + file:close() + u_skins.list[internal_id] = name + u_skins.meta[name] = {} + u_skins.meta[name].name = data[1] + u_skins.meta[name].author = data[2] + u_skins.meta[name].license = data[3] or "" + u_skins.meta[name].description = "" + + fetched_skip = 0 + internal_id = internal_id + 1 + end + fetched_skip = fetched_skip + 1 + id = id + 1 +end diff --git a/u_skins/textures/character_1.png b/u_skins/textures/character_1.png index 8d0dd99..f58a765 100644 Binary files a/u_skins/textures/character_1.png and b/u_skins/textures/character_1.png differ diff --git a/u_skins/textures/character_10.png b/u_skins/textures/character_10.png new file mode 100755 index 0000000..d3a2576 Binary files /dev/null and b/u_skins/textures/character_10.png differ diff --git a/u_skins/textures/character_10_preview.png b/u_skins/textures/character_10_preview.png new file mode 100644 index 0000000..6b3dfdf Binary files /dev/null and b/u_skins/textures/character_10_preview.png differ diff --git a/u_skins/textures/character_11.png b/u_skins/textures/character_11.png new file mode 100755 index 0000000..95276f2 Binary files /dev/null and b/u_skins/textures/character_11.png differ diff --git a/u_skins/textures/character_11_preview.png b/u_skins/textures/character_11_preview.png new file mode 100644 index 0000000..93a6680 Binary files /dev/null and b/u_skins/textures/character_11_preview.png differ diff --git a/u_skins/textures/character_12.png b/u_skins/textures/character_12.png new file mode 100755 index 0000000..7d0f437 Binary files /dev/null and b/u_skins/textures/character_12.png differ diff --git a/u_skins/textures/character_12_preview.png b/u_skins/textures/character_12_preview.png new file mode 100644 index 0000000..9cad7f2 Binary files /dev/null and b/u_skins/textures/character_12_preview.png differ diff --git a/u_skins/textures/character_13.png b/u_skins/textures/character_13.png new file mode 100755 index 0000000..c0708aa Binary files /dev/null and b/u_skins/textures/character_13.png differ diff --git a/u_skins/textures/character_13_preview.png b/u_skins/textures/character_13_preview.png new file mode 100644 index 0000000..a314016 Binary files /dev/null and b/u_skins/textures/character_13_preview.png differ diff --git a/u_skins/textures/character_14.png b/u_skins/textures/character_14.png new file mode 100755 index 0000000..5318ffa Binary files /dev/null and b/u_skins/textures/character_14.png differ diff --git a/u_skins/textures/character_14_preview.png b/u_skins/textures/character_14_preview.png new file mode 100644 index 0000000..faf6a5e Binary files /dev/null and b/u_skins/textures/character_14_preview.png differ diff --git a/u_skins/textures/character_15.png b/u_skins/textures/character_15.png new file mode 100755 index 0000000..0358a72 Binary files /dev/null and b/u_skins/textures/character_15.png differ diff --git a/u_skins/textures/character_15_preview.png b/u_skins/textures/character_15_preview.png new file mode 100644 index 0000000..b74ecb8 Binary files /dev/null and b/u_skins/textures/character_15_preview.png differ diff --git a/u_skins/textures/character_16.png b/u_skins/textures/character_16.png new file mode 100755 index 0000000..bddc959 Binary files /dev/null and b/u_skins/textures/character_16.png differ diff --git a/u_skins/textures/character_16_preview.png b/u_skins/textures/character_16_preview.png new file mode 100644 index 0000000..a8c610c Binary files /dev/null and b/u_skins/textures/character_16_preview.png differ diff --git a/u_skins/textures/character_17.png b/u_skins/textures/character_17.png new file mode 100755 index 0000000..aec6f03 Binary files /dev/null and b/u_skins/textures/character_17.png differ diff --git a/u_skins/textures/character_17_preview.png b/u_skins/textures/character_17_preview.png new file mode 100644 index 0000000..4820fd7 Binary files /dev/null and b/u_skins/textures/character_17_preview.png differ diff --git a/u_skins/textures/character_18.png b/u_skins/textures/character_18.png new file mode 100755 index 0000000..a6efd13 Binary files /dev/null and b/u_skins/textures/character_18.png differ diff --git a/u_skins/textures/character_18_preview.png b/u_skins/textures/character_18_preview.png new file mode 100644 index 0000000..b971955 Binary files /dev/null and b/u_skins/textures/character_18_preview.png differ diff --git a/u_skins/textures/character_19.png b/u_skins/textures/character_19.png new file mode 100755 index 0000000..ffd1974 Binary files /dev/null and b/u_skins/textures/character_19.png differ diff --git a/u_skins/textures/character_19_preview.png b/u_skins/textures/character_19_preview.png new file mode 100644 index 0000000..94895cd Binary files /dev/null and b/u_skins/textures/character_19_preview.png differ diff --git a/u_skins/textures/character_1_preview.png b/u_skins/textures/character_1_preview.png index 62a9ff2..1c0d99e 100644 Binary files a/u_skins/textures/character_1_preview.png and b/u_skins/textures/character_1_preview.png differ diff --git a/u_skins/textures/character_2.png b/u_skins/textures/character_2.png index d794b87..e1ccb61 100644 Binary files a/u_skins/textures/character_2.png and b/u_skins/textures/character_2.png differ diff --git a/u_skins/textures/character_20.png b/u_skins/textures/character_20.png new file mode 100755 index 0000000..94e373c Binary files /dev/null and b/u_skins/textures/character_20.png differ diff --git a/u_skins/textures/character_20_preview.png b/u_skins/textures/character_20_preview.png new file mode 100644 index 0000000..7449e37 Binary files /dev/null and b/u_skins/textures/character_20_preview.png differ diff --git a/u_skins/textures/character_21.png b/u_skins/textures/character_21.png new file mode 100755 index 0000000..ef8ecc9 Binary files /dev/null and b/u_skins/textures/character_21.png differ diff --git a/u_skins/textures/character_21_preview.png b/u_skins/textures/character_21_preview.png new file mode 100644 index 0000000..c8b5791 Binary files /dev/null and b/u_skins/textures/character_21_preview.png differ diff --git a/u_skins/textures/character_22.png b/u_skins/textures/character_22.png new file mode 100755 index 0000000..de0f19a Binary files /dev/null and b/u_skins/textures/character_22.png differ diff --git a/u_skins/textures/character_22_preview.png b/u_skins/textures/character_22_preview.png new file mode 100644 index 0000000..cae21c6 Binary files /dev/null and b/u_skins/textures/character_22_preview.png differ diff --git a/u_skins/textures/character_23.png b/u_skins/textures/character_23.png new file mode 100755 index 0000000..6aa01e3 Binary files /dev/null and b/u_skins/textures/character_23.png differ diff --git a/u_skins/textures/character_23_preview.png b/u_skins/textures/character_23_preview.png new file mode 100644 index 0000000..3d58ea6 Binary files /dev/null and b/u_skins/textures/character_23_preview.png differ diff --git a/u_skins/textures/character_24.png b/u_skins/textures/character_24.png new file mode 100644 index 0000000..ad9737f Binary files /dev/null and b/u_skins/textures/character_24.png differ diff --git a/u_skins/textures/character_24_preview.png b/u_skins/textures/character_24_preview.png new file mode 100644 index 0000000..08e467d Binary files /dev/null and b/u_skins/textures/character_24_preview.png differ diff --git a/u_skins/textures/character_25.png b/u_skins/textures/character_25.png new file mode 100755 index 0000000..4fa5608 Binary files /dev/null and b/u_skins/textures/character_25.png differ diff --git a/u_skins/textures/character_25_preview.png b/u_skins/textures/character_25_preview.png new file mode 100644 index 0000000..2803244 Binary files /dev/null and b/u_skins/textures/character_25_preview.png differ diff --git a/u_skins/textures/character_26.png b/u_skins/textures/character_26.png new file mode 100755 index 0000000..7b4f4f5 Binary files /dev/null and b/u_skins/textures/character_26.png differ diff --git a/u_skins/textures/character_26_preview.png b/u_skins/textures/character_26_preview.png new file mode 100644 index 0000000..b54d456 Binary files /dev/null and b/u_skins/textures/character_26_preview.png differ diff --git a/u_skins/textures/character_27.png b/u_skins/textures/character_27.png new file mode 100755 index 0000000..12c0253 Binary files /dev/null and b/u_skins/textures/character_27.png differ diff --git a/u_skins/textures/character_27_preview.png b/u_skins/textures/character_27_preview.png new file mode 100644 index 0000000..4221cd4 Binary files /dev/null and b/u_skins/textures/character_27_preview.png differ diff --git a/u_skins/textures/character_28.png b/u_skins/textures/character_28.png new file mode 100755 index 0000000..70921bd Binary files /dev/null and b/u_skins/textures/character_28.png differ diff --git a/u_skins/textures/character_28_preview.png b/u_skins/textures/character_28_preview.png new file mode 100644 index 0000000..4f1529c Binary files /dev/null and b/u_skins/textures/character_28_preview.png differ diff --git a/u_skins/textures/character_29.png b/u_skins/textures/character_29.png new file mode 100755 index 0000000..057cc3a Binary files /dev/null and b/u_skins/textures/character_29.png differ diff --git a/u_skins/textures/character_29_preview.png b/u_skins/textures/character_29_preview.png new file mode 100644 index 0000000..6cc35fa Binary files /dev/null and b/u_skins/textures/character_29_preview.png differ diff --git a/u_skins/textures/character_2_preview.png b/u_skins/textures/character_2_preview.png index 0736def..7a6dadf 100644 Binary files a/u_skins/textures/character_2_preview.png and b/u_skins/textures/character_2_preview.png differ diff --git a/u_skins/textures/character_3.png b/u_skins/textures/character_3.png new file mode 100644 index 0000000..a694868 Binary files /dev/null and b/u_skins/textures/character_3.png differ diff --git a/u_skins/textures/character_30.png b/u_skins/textures/character_30.png new file mode 100755 index 0000000..453f9d3 Binary files /dev/null and b/u_skins/textures/character_30.png differ diff --git a/u_skins/textures/character_30_preview.png b/u_skins/textures/character_30_preview.png new file mode 100644 index 0000000..11a95f7 Binary files /dev/null and b/u_skins/textures/character_30_preview.png differ diff --git a/u_skins/textures/character_31.png b/u_skins/textures/character_31.png new file mode 100755 index 0000000..b30c670 Binary files /dev/null and b/u_skins/textures/character_31.png differ diff --git a/u_skins/textures/character_31_preview.png b/u_skins/textures/character_31_preview.png new file mode 100644 index 0000000..16fc496 Binary files /dev/null and b/u_skins/textures/character_31_preview.png differ diff --git a/u_skins/textures/character_32.png b/u_skins/textures/character_32.png new file mode 100755 index 0000000..a01bbfa Binary files /dev/null and b/u_skins/textures/character_32.png differ diff --git a/u_skins/textures/character_32_preview.png b/u_skins/textures/character_32_preview.png new file mode 100644 index 0000000..a134b15 Binary files /dev/null and b/u_skins/textures/character_32_preview.png differ diff --git a/u_skins/textures/character_33.png b/u_skins/textures/character_33.png new file mode 100755 index 0000000..5486bc9 Binary files /dev/null and b/u_skins/textures/character_33.png differ diff --git a/u_skins/textures/character_33_preview.png b/u_skins/textures/character_33_preview.png new file mode 100644 index 0000000..66ae85a Binary files /dev/null and b/u_skins/textures/character_33_preview.png differ diff --git a/u_skins/textures/character_34.png b/u_skins/textures/character_34.png new file mode 100755 index 0000000..587c9fe Binary files /dev/null and b/u_skins/textures/character_34.png differ diff --git a/u_skins/textures/character_34_preview.png b/u_skins/textures/character_34_preview.png new file mode 100644 index 0000000..ba49853 Binary files /dev/null and b/u_skins/textures/character_34_preview.png differ diff --git a/u_skins/textures/character_35.png b/u_skins/textures/character_35.png new file mode 100755 index 0000000..5173d20 Binary files /dev/null and b/u_skins/textures/character_35.png differ diff --git a/u_skins/textures/character_35_preview.png b/u_skins/textures/character_35_preview.png new file mode 100644 index 0000000..4a4f2c8 Binary files /dev/null and b/u_skins/textures/character_35_preview.png differ diff --git a/u_skins/textures/character_36.png b/u_skins/textures/character_36.png new file mode 100755 index 0000000..a570c59 Binary files /dev/null and b/u_skins/textures/character_36.png differ diff --git a/u_skins/textures/character_36_preview.png b/u_skins/textures/character_36_preview.png new file mode 100644 index 0000000..184c847 Binary files /dev/null and b/u_skins/textures/character_36_preview.png differ diff --git a/u_skins/textures/character_37.png b/u_skins/textures/character_37.png new file mode 100755 index 0000000..6197cf3 Binary files /dev/null and b/u_skins/textures/character_37.png differ diff --git a/u_skins/textures/character_37_preview.png b/u_skins/textures/character_37_preview.png new file mode 100644 index 0000000..d2e9374 Binary files /dev/null and b/u_skins/textures/character_37_preview.png differ diff --git a/u_skins/textures/character_38.png b/u_skins/textures/character_38.png new file mode 100755 index 0000000..cdb7785 Binary files /dev/null and b/u_skins/textures/character_38.png differ diff --git a/u_skins/textures/character_38_preview.png b/u_skins/textures/character_38_preview.png new file mode 100644 index 0000000..bf09cfb Binary files /dev/null and b/u_skins/textures/character_38_preview.png differ diff --git a/u_skins/textures/character_39.png b/u_skins/textures/character_39.png new file mode 100755 index 0000000..423737d Binary files /dev/null and b/u_skins/textures/character_39.png differ diff --git a/u_skins/textures/character_39_preview.png b/u_skins/textures/character_39_preview.png new file mode 100644 index 0000000..d43b1e7 Binary files /dev/null and b/u_skins/textures/character_39_preview.png differ diff --git a/u_skins/textures/character_3_preview.png b/u_skins/textures/character_3_preview.png new file mode 100644 index 0000000..2c85254 Binary files /dev/null and b/u_skins/textures/character_3_preview.png differ diff --git a/u_skins/textures/character_4.png b/u_skins/textures/character_4.png new file mode 100644 index 0000000..fb1afd9 Binary files /dev/null and b/u_skins/textures/character_4.png differ diff --git a/u_skins/textures/character_40.png b/u_skins/textures/character_40.png new file mode 100755 index 0000000..e847c3b Binary files /dev/null and b/u_skins/textures/character_40.png differ diff --git a/u_skins/textures/character_40_preview.png b/u_skins/textures/character_40_preview.png new file mode 100644 index 0000000..637bbc7 Binary files /dev/null and b/u_skins/textures/character_40_preview.png differ diff --git a/u_skins/textures/character_41.png b/u_skins/textures/character_41.png new file mode 100755 index 0000000..453f9d3 Binary files /dev/null and b/u_skins/textures/character_41.png differ diff --git a/u_skins/textures/character_41_preview.png b/u_skins/textures/character_41_preview.png new file mode 100644 index 0000000..11a95f7 Binary files /dev/null and b/u_skins/textures/character_41_preview.png differ diff --git a/u_skins/textures/character_4_preview.png b/u_skins/textures/character_4_preview.png new file mode 100644 index 0000000..0b9bc25 Binary files /dev/null and b/u_skins/textures/character_4_preview.png differ diff --git a/u_skins/textures/character_5.png b/u_skins/textures/character_5.png new file mode 100755 index 0000000..7edd0d4 Binary files /dev/null and b/u_skins/textures/character_5.png differ diff --git a/u_skins/textures/character_5_preview.png b/u_skins/textures/character_5_preview.png new file mode 100644 index 0000000..0277e5c Binary files /dev/null and b/u_skins/textures/character_5_preview.png differ diff --git a/u_skins/textures/character_6.png b/u_skins/textures/character_6.png new file mode 100755 index 0000000..fc3fd6f Binary files /dev/null and b/u_skins/textures/character_6.png differ diff --git a/u_skins/textures/character_6_preview.png b/u_skins/textures/character_6_preview.png new file mode 100644 index 0000000..f4ac37f Binary files /dev/null and b/u_skins/textures/character_6_preview.png differ diff --git a/u_skins/textures/character_7.png b/u_skins/textures/character_7.png new file mode 100755 index 0000000..fa71ca9 Binary files /dev/null and b/u_skins/textures/character_7.png differ diff --git a/u_skins/textures/character_7_preview.png b/u_skins/textures/character_7_preview.png new file mode 100644 index 0000000..a242add Binary files /dev/null and b/u_skins/textures/character_7_preview.png differ diff --git a/u_skins/textures/character_8.png b/u_skins/textures/character_8.png new file mode 100755 index 0000000..886e5e3 Binary files /dev/null and b/u_skins/textures/character_8.png differ diff --git a/u_skins/textures/character_8_preview.png b/u_skins/textures/character_8_preview.png new file mode 100644 index 0000000..1560eef Binary files /dev/null and b/u_skins/textures/character_8_preview.png differ diff --git a/u_skins/textures/character_9.png b/u_skins/textures/character_9.png new file mode 100755 index 0000000..07245d9 Binary files /dev/null and b/u_skins/textures/character_9.png differ diff --git a/u_skins/textures/character_9_preview.png b/u_skins/textures/character_9_preview.png new file mode 100644 index 0000000..63250df Binary files /dev/null and b/u_skins/textures/character_9_preview.png differ diff --git a/u_skins/textures/inventory_plus_skins.png b/u_skins/textures/inventory_plus_skins.png old mode 100644 new mode 100755 diff --git a/u_skins/textures/mff_character_1.png b/u_skins/textures/mff_character_1.png new file mode 100644 index 0000000..1160959 Binary files /dev/null and b/u_skins/textures/mff_character_1.png differ diff --git a/u_skins/textures/mff_character_1_preview.png b/u_skins/textures/mff_character_1_preview.png new file mode 100644 index 0000000..4c62552 Binary files /dev/null and b/u_skins/textures/mff_character_1_preview.png differ diff --git a/u_skins/textures/mff_character_2.png b/u_skins/textures/mff_character_2.png new file mode 100644 index 0000000..6e96104 Binary files /dev/null and b/u_skins/textures/mff_character_2.png differ diff --git a/u_skins/textures/mff_character_2_preview.png b/u_skins/textures/mff_character_2_preview.png new file mode 100644 index 0000000..22c7a32 Binary files /dev/null and b/u_skins/textures/mff_character_2_preview.png differ diff --git a/u_skins/textures/mff_character_3.png b/u_skins/textures/mff_character_3.png new file mode 100644 index 0000000..4a9009b Binary files /dev/null and b/u_skins/textures/mff_character_3.png differ diff --git a/u_skins/textures/mff_character_3_preview.png b/u_skins/textures/mff_character_3_preview.png new file mode 100644 index 0000000..9373aba Binary files /dev/null and b/u_skins/textures/mff_character_3_preview.png differ diff --git a/u_skins/textures/mff_character_4.png b/u_skins/textures/mff_character_4.png new file mode 100644 index 0000000..6ca8eb1 Binary files /dev/null and b/u_skins/textures/mff_character_4.png differ diff --git a/u_skins/textures/mff_character_4_preview.png b/u_skins/textures/mff_character_4_preview.png new file mode 100644 index 0000000..403c595 Binary files /dev/null and b/u_skins/textures/mff_character_4_preview.png differ diff --git a/u_skins/textures/mff_character_5.png b/u_skins/textures/mff_character_5.png new file mode 100644 index 0000000..1b31c4e Binary files /dev/null and b/u_skins/textures/mff_character_5.png differ diff --git a/u_skins/textures/mff_character_5_preview.png b/u_skins/textures/mff_character_5_preview.png new file mode 100644 index 0000000..caa18ec Binary files /dev/null and b/u_skins/textures/mff_character_5_preview.png differ diff --git a/u_skins/textures/mff_character_6.png b/u_skins/textures/mff_character_6.png new file mode 100644 index 0000000..e515c9d Binary files /dev/null and b/u_skins/textures/mff_character_6.png differ diff --git a/u_skins/textures/mff_character_6_preview.png b/u_skins/textures/mff_character_6_preview.png new file mode 100644 index 0000000..4f89890 Binary files /dev/null and b/u_skins/textures/mff_character_6_preview.png differ diff --git a/u_skins/textures/mff_character_7.png b/u_skins/textures/mff_character_7.png new file mode 100644 index 0000000..f041b89 Binary files /dev/null and b/u_skins/textures/mff_character_7.png differ diff --git a/u_skins/textures/mff_character_7_preview.png b/u_skins/textures/mff_character_7_preview.png new file mode 100644 index 0000000..38ab616 Binary files /dev/null and b/u_skins/textures/mff_character_7_preview.png differ diff --git a/u_skins/textures/mff_character_8.png b/u_skins/textures/mff_character_8.png new file mode 100755 index 0000000..3b43b0f Binary files /dev/null and b/u_skins/textures/mff_character_8.png differ diff --git a/u_skins/textures/mff_character_8_preview.png b/u_skins/textures/mff_character_8_preview.png new file mode 100644 index 0000000..6bf0fd8 Binary files /dev/null and b/u_skins/textures/mff_character_8_preview.png differ diff --git a/u_skins/textures/mff_character_9.png b/u_skins/textures/mff_character_9.png new file mode 100644 index 0000000..ae0c55b Binary files /dev/null and b/u_skins/textures/mff_character_9.png differ diff --git a/u_skins/textures/mff_character_9_preview.png b/u_skins/textures/mff_character_9_preview.png new file mode 100644 index 0000000..a943f90 Binary files /dev/null and b/u_skins/textures/mff_character_9_preview.png differ diff --git a/u_skins/textures/u_skins_button.png b/u_skins/textures/u_skins_button.png old mode 100644 new mode 100755 index cb49531..472ff33 Binary files a/u_skins/textures/u_skins_button.png and b/u_skins/textures/u_skins_button.png differ diff --git a/u_skins/textures/ui_misc_form.png b/u_skins/textures/ui_misc_form.png old mode 100644 new mode 100755 index d34d326..c6a6057 Binary files a/u_skins/textures/ui_misc_form.png and b/u_skins/textures/ui_misc_form.png differ diff --git a/update_from_db.py b/update_from_db.py deleted file mode 100755 index be6930c..0000000 --- a/update_from_db.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/python3 -from http.client import HTTPConnection -import json -import base64 - -server = "minetest.fensta.bplaced.net" -skinsdir = "u_skins/textures/" -metadir = "u_skins/meta/" -i = 1 -pages = 1 - -c = HTTPConnection(server) -def addpage(page): - global i, pages - print("Page: " + str(page)) - r = 0 - try: - c.request("GET", "/api/get.json.php?getlist&page=" + str(page) + "&outformat=base64") - r = c.getresponse() - except Exception: - if r != 0: - if r.status != 200: - print("Error", r.status) - exit(r.status) - return - - data = r.read().decode() - l = json.loads(data) - if not l["success"]: - print("Success != True") - exit(1) - r = 0 - pages = int(l["pages"]) - for s in l["skins"]: - f = open(skinsdir + "character_" + str(i) + ".png", "wb") - f.write(base64.b64decode(bytes(s["img"], 'utf-8'))) - f.close() - f = open(metadir + "character_" + str(i) + ".txt", "w") - f.write(str(s["name"]) + '\n') - f.write(str(s["author"]) + '\n') - f.write(str(s["license"])) - f.close() - try: - c.request("GET", "/skins/1/" + str(s["id"]) + ".png") - r = c.getresponse() - except Exception: - if r != 0: - if r.status != 200: - print("Error", r.status) - continue - - data = r.read() - f = open(skinsdir + "character_" + str(i) + "_preview.png", "wb") - f.write(data) - f.close() - i = i + 1 -addpage(1) -if pages > 1: - for p in range(pages-1): - addpage(p+2) -print("Skins have been updated!") diff --git a/update_skins_db.sh b/update_skins_db.sh deleted file mode 100644 index 8bf9e1a..0000000 --- a/update_skins_db.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash -#### -# Licenced under Attribution-NonCommercial-ShareAlike 4.0 International -# http://creativecommons.org/licenses/by-nc-sa/4.0/ -#### ATTENTION #### -## This script requires that jq and coreutils are installed on your system ## -## In Debian-based distros, open a terminal and run -## sudo apt-get install jq coreutils -################### - -# == Set variables === -# ==================== -NUMPAGES="1" # Number of pages. Default is 1 page -PERPAGE="2000" # Number of items per page. Default is 2000. -JSONURL="http://minetest.fensta.bplaced.net/api/get.json.php?getlist&page=$NUMPAGES&outformat=base64&per_page=$PERPAGE" # The URL to the database -PREVIEWURL="http://minetest.fensta.bplaced.net/skins/1/" # The url to the location of the previews. -temp=$PWD/tmp # Where the temp folder will be. Default is $PWD/tmp, which means that the tmp folder will be put in the current folder -METADEST=$PWD/u_skins/meta # This is the folder where the meta data will be saved -TEXTUREDEST=$PWD/u_skins/textures # This is the folder where the skins and the previews will be saved - - -# === Make a bunch of folders and download the db === -# =================================================== -if [ -d "$temp" ]; then - rm -r $temp # If the temp dir exists we will remove it and its contents. -fi -mkdir $temp # Make a new temp dir. Redundant? No. We will get rid of it later. - -if [ ! -d "$METADEST" ]; then # Check to see if the meta dir exists, and if not, create it - mkdir $METADEST -fi - -if [ ! -d "$TEXTUREDEST" ]; then # Check to see if the textures dir exists, and if not, create it - mkdir $TEXTUREDEST -fi - -wget $JSONURL -O $temp/rawdb.txt # Download the entire database - - -# === Do the JSON thing === -# ========================= -i="0" # This will be the counter. -while [ "$ID" != "null" ] # Repeat for as long as there is data to process - do - ID=$(cat $temp/rawdb.txt | jq ".skins[$i].id") - - # The next lines are kinda complex. sed is being used to strip the quotes from the variables. I had help... - meta_name=$(echo $(cat $temp/rawdb.txt | jq ".skins[$i].name") | sed -e 's/^"//' -e 's/"$//') - meta_author=$(echo $(cat $temp/rawdb.txt | jq ".skins[$i].author") | sed -e 's/^"//' -e 's/"$//') - meta_license=$(echo $(cat $temp/rawdb.txt | jq ".skins[$i].license") | sed -e 's/^"//' -e 's/"$//') - - if [[ "$ID" != "null" ]]; then # Check to see if ID has a value - echo "#"$ID "name:" $meta_name "author:" $meta_author "license:" $meta_license # Verbosity to show that the script is working. - - echo $meta_name > $METADEST/character_$ID.txt # Save the meta data to files, this line overwrites the data inside the file - echo $meta_author >> $METADEST/character_$ID.txt # Save the meta data to files, this line is added to the file - echo $meta_license >> $METADEST/character_$ID.txt # Save the meta data to files, and this line is added to the file as well. - - - # === Extract and save the image from the JSON file === - # ====================================================== - skin=$(echo $(cat $temp/rawdb.txt | jq ".skins[$i].img") | sed -e 's/^"//' -e 's/"$//') # Strip the quotes from the base64 encoded string - echo $skin | base64 --decode > $TEXTUREDEST"/character_"$ID".png" # Decode the string, and save it as a .png file - - - # === Download a preview image whilst we're at it === - # ==================================================== - wget -nv $PREVIEWURL/$ID".png" -O $TEXTUREDEST"/character_"$ID"_preview.png" # Downloads a preview of the skin that we just saved. - - fi - i=$[$i+1] # Increase the counter by one. - done - -# === Now we'll clean up the mess === -# =================================== -rm -r $temp # Remove the temp dir and its contents. - -exit # Not strictly needed, but i like to use it to wrap things up.