Package list minetest-mod-character-creator / fresh-snapshots/upstream
Import upstream version 1.1+git20200824.1.f8d6f90 Debian Janitor a month ago
17 changed file(s) with 55 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
33 unified_inventory?
44 skinsdb?
55 sfinv_buttons?
6 sfinv?
210210 }
211211 })
212212
213 local name = player:get_player_name()
214
215213 if minetest.get_modpath("multiskin") then
216 multiskin.layers[name].skin = texture
217 armor:set_player_armor(player)
218 multiskin:set_player_textures(player, {textures = {texture}})
214 local name = player:get_player_name()
215 minetest.after(0, function(name)
216 local player = minetest.get_player_by_name(name)
217 if player then
218 multiskin.layers[player_name].skin = texture
219 armor:set_player_armor(player)
220 multiskin:set_player_textures(player, {textures = {texture}})
221 end
222 end, name)
223
219224 elseif minetest.get_modpath("3d_armor") then
220 armor.textures[name].skin = texture
221 armor:set_player_armor(player)
225 local name = player:get_player_name()
226 minetest.after(0, function(name)
227 local player = minetest.get_player_by_name(name)
228 if player then
229 armor.textures[name].skin = texture
230 armor:set_player_armor(player)
231 end
232 end, name)
233
222234 else
223235 player:set_properties({textures = {texture}})
224236 end
236248 skin_obj:set_meta("format", "1.0")
237249 skin_obj:set_meta("visual_size_x", player_meta:get_float("character_creator:width"))
238250 skin_obj:set_meta("visual_size_y", player_meta:get_float("character_creator:height"))
239 skin_obj:apply_skin_to_player(player)
240 skinsdb.assign_player_skin(player, "character_creator:"..playername)
251 skinsdb.assign_player_skin(player, skinname)
252 skinsdb.update_player_skin(player)
241253 save_skin(player)
242254 end
243255 end
261273 end
262274
263275 -- set data
264 skin_obj:set_preview("inventory_plus_character_creator.png")
265276 skin_obj:set_meta("name","Character Creator")
266277 --skin_obj:set_meta("author", "???")
267278 skin_obj:set_meta("license", "MIT / CC-BY-SA 3.0 Unported")
429440 title = "Character Creator",
430441 action = show_formspec,
431442 })
432 end
443
444 elseif not skinsdb and not minetest.get_modpath("sfinv_buttons")
445 and minetest.global_exists("sfinv") and sfinv.enabled then
446
447 local old_func = sfinv.pages["sfinv:crafting"].get
448 sfinv.override_page("sfinv:crafting", {
449 get = function(self, player, context)
450 local fs = old_func(self, player, context)
451 return fs .. "image_button[0,0;1,1;inventory_plus_character_creator.png;character_creator;]"
452 end
453 })
454
455 minetest.register_on_player_receive_fields(function(player, formname, fields)
456 if fields.character_creator then
457 show_formspec(player)
458 return true
459 end
460 end)
461 end
00 name = character_creator
11 description = Allows the creation of customized character skins inside the game.
22 license = MIT
3 optional_depends = 3d_armor, multiskin, inventory_plus, unified_inventory, skinsdb, sfinv_buttons
3 optional_depends = 3d_armor, multiskin, inventory_plus, unified_inventory, skinsdb, sfinv_buttons, sfinv
248248 ["Yellow T-Shirt"] = "cc_tshirt_yellow.png",
249249 ["Black T-Shirt"] = "cc_tshirt_black.png",
250250 ["Blue T-Shirt"] = "cc_tshirt_blue.png",
251 ["Brown Vest"] = "cc_vest_brown.png",
252 ["Green Vest"] = "cc_vest_green.png",
253 ["Blue Vest"] = "cc_vest_blue.png",
254 ["Brown Shirt"] = "cc_shirt_canvas_brown.png",
255 ["Green Shirt"] = "cc_shirt_canvas_green.png",
256 ["Blue Shirt"] = "cc_shirt_canvas_blue.png",
251257 },
252258
253259 pants = {
259265 ["White Pants"] = "cc_pants_white.png",
260266 ["Yellow Pants"] = "cc_pants_yellow.png",
261267 ["Black Pants"] = "cc_pants_black.png",
268 ["Brown Canvas Pants"] = "cc_pants_canvas_brown.png",
269 ["Green Canvas Pants"] = "cc_pants_canvas_green.png",
270 ["Blue Canvas Pants"] = "cc_pants_canvas_blue.png",
262271 },
263272
264273 shoes = {
265274 ["Leather Shoes"] = "cc_shoes_leather.png",
266275 ["Canvas Shoes"] = "cc_shoes_canvas.png",
267276 ["Fur Shoes"] = "cc_shoes_fur.png",
277 ["Brown Shoes"] = "cc_shoes_brown.png",
278 ["Green Shoes"] = "cc_shoes_green.png",
279 ["Blue Shoes"] = "cc_shoes_blue.png",
280 ["Black Shoes"] = "cc_shoes_black.png",
268281 }
269282 }
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown