Import upstream version 1.1+git20200824.1.f8d6f90
Debian Janitor
1 year, 9 months ago
210 | 210 | } |
211 | 211 | }) |
212 | 212 | |
213 | local name = player:get_player_name() | |
214 | ||
215 | 213 | 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 | ||
219 | 224 | 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 | ||
222 | 234 | else |
223 | 235 | player:set_properties({textures = {texture}}) |
224 | 236 | end |
236 | 248 | skin_obj:set_meta("format", "1.0") |
237 | 249 | skin_obj:set_meta("visual_size_x", player_meta:get_float("character_creator:width")) |
238 | 250 | 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) | |
241 | 253 | save_skin(player) |
242 | 254 | end |
243 | 255 | end |
261 | 273 | end |
262 | 274 | |
263 | 275 | -- set data |
264 | skin_obj:set_preview("inventory_plus_character_creator.png") | |
265 | 276 | skin_obj:set_meta("name","Character Creator") |
266 | 277 | --skin_obj:set_meta("author", "???") |
267 | 278 | skin_obj:set_meta("license", "MIT / CC-BY-SA 3.0 Unported") |
429 | 440 | title = "Character Creator", |
430 | 441 | action = show_formspec, |
431 | 442 | }) |
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 |
0 | 0 | name = character_creator |
1 | 1 | description = Allows the creation of customized character skins inside the game. |
2 | 2 | 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 |
248 | 248 | ["Yellow T-Shirt"] = "cc_tshirt_yellow.png", |
249 | 249 | ["Black T-Shirt"] = "cc_tshirt_black.png", |
250 | 250 | ["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", | |
251 | 257 | }, |
252 | 258 | |
253 | 259 | pants = { |
259 | 265 | ["White Pants"] = "cc_pants_white.png", |
260 | 266 | ["Yellow Pants"] = "cc_pants_yellow.png", |
261 | 267 | ["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", | |
262 | 271 | }, |
263 | 272 | |
264 | 273 | shoes = { |
265 | 274 | ["Leather Shoes"] = "cc_shoes_leather.png", |
266 | 275 | ["Canvas Shoes"] = "cc_shoes_canvas.png", |
267 | 276 | ["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", | |
268 | 281 | } |
269 | 282 | } |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown