diff --git a/debian/changelog b/debian/changelog index dff910a..f9692bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +minetest-mod-character-creator (1.1+git20200824.1.f8d6f90-1) UNRELEASED; urgency=low + + * New upstream snapshot. + + -- Debian Janitor Wed, 25 Aug 2021 10:17:26 -0000 + minetest-mod-character-creator (1.1-1) unstable; urgency=medium * New upstream release. diff --git a/depends.txt b/depends.txt index 22a723e..cd3886b 100644 --- a/depends.txt +++ b/depends.txt @@ -4,3 +4,4 @@ unified_inventory? skinsdb? sfinv_buttons? +sfinv? diff --git a/init.lua b/init.lua index 8adab29..e23842f 100644 --- a/init.lua +++ b/init.lua @@ -211,15 +211,27 @@ } }) - local name = player:get_player_name() - if minetest.get_modpath("multiskin") then - multiskin.layers[name].skin = texture - armor:set_player_armor(player) - multiskin:set_player_textures(player, {textures = {texture}}) + local name = player:get_player_name() + minetest.after(0, function(name) + local player = minetest.get_player_by_name(name) + if player then + multiskin.layers[player_name].skin = texture + armor:set_player_armor(player) + multiskin:set_player_textures(player, {textures = {texture}}) + end + end, name) + elseif minetest.get_modpath("3d_armor") then - armor.textures[name].skin = texture - armor:set_player_armor(player) + local name = player:get_player_name() + minetest.after(0, function(name) + local player = minetest.get_player_by_name(name) + if player then + armor.textures[name].skin = texture + armor:set_player_armor(player) + end + end, name) + else player:set_properties({textures = {texture}}) end @@ -237,8 +249,8 @@ skin_obj:set_meta("format", "1.0") skin_obj:set_meta("visual_size_x", player_meta:get_float("character_creator:width")) skin_obj:set_meta("visual_size_y", player_meta:get_float("character_creator:height")) - skin_obj:apply_skin_to_player(player) - skinsdb.assign_player_skin(player, "character_creator:"..playername) + skinsdb.assign_player_skin(player, skinname) + skinsdb.update_player_skin(player) save_skin(player) end end @@ -262,7 +274,6 @@ end -- set data - skin_obj:set_preview("inventory_plus_character_creator.png") skin_obj:set_meta("name","Character Creator") --skin_obj:set_meta("author", "???") skin_obj:set_meta("license", "MIT / CC-BY-SA 3.0 Unported") @@ -430,4 +441,22 @@ title = "Character Creator", action = show_formspec, }) -end + +elseif not skinsdb and not minetest.get_modpath("sfinv_buttons") + and minetest.global_exists("sfinv") and sfinv.enabled then + + local old_func = sfinv.pages["sfinv:crafting"].get + sfinv.override_page("sfinv:crafting", { + get = function(self, player, context) + local fs = old_func(self, player, context) + return fs .. "image_button[0,0;1,1;inventory_plus_character_creator.png;character_creator;]" + end + }) + + minetest.register_on_player_receive_fields(function(player, formname, fields) + if fields.character_creator then + show_formspec(player) + return true + end + end) +end diff --git a/mod.conf b/mod.conf index 92ca239..e27f874 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ name = character_creator description = Allows the creation of customized character skins inside the game. license = MIT -optional_depends = 3d_armor, multiskin, inventory_plus, unified_inventory, skinsdb, sfinv_buttons +optional_depends = 3d_armor, multiskin, inventory_plus, unified_inventory, skinsdb, sfinv_buttons, sfinv diff --git a/skins.lua b/skins.lua index ec422c2..82d7752 100644 --- a/skins.lua +++ b/skins.lua @@ -249,6 +249,12 @@ ["Yellow T-Shirt"] = "cc_tshirt_yellow.png", ["Black T-Shirt"] = "cc_tshirt_black.png", ["Blue T-Shirt"] = "cc_tshirt_blue.png", + ["Brown Vest"] = "cc_vest_brown.png", + ["Green Vest"] = "cc_vest_green.png", + ["Blue Vest"] = "cc_vest_blue.png", + ["Brown Shirt"] = "cc_shirt_canvas_brown.png", + ["Green Shirt"] = "cc_shirt_canvas_green.png", + ["Blue Shirt"] = "cc_shirt_canvas_blue.png", }, pants = { @@ -260,11 +266,18 @@ ["White Pants"] = "cc_pants_white.png", ["Yellow Pants"] = "cc_pants_yellow.png", ["Black Pants"] = "cc_pants_black.png", + ["Brown Canvas Pants"] = "cc_pants_canvas_brown.png", + ["Green Canvas Pants"] = "cc_pants_canvas_green.png", + ["Blue Canvas Pants"] = "cc_pants_canvas_blue.png", }, shoes = { ["Leather Shoes"] = "cc_shoes_leather.png", ["Canvas Shoes"] = "cc_shoes_canvas.png", ["Fur Shoes"] = "cc_shoes_fur.png", + ["Brown Shoes"] = "cc_shoes_brown.png", + ["Green Shoes"] = "cc_shoes_green.png", + ["Blue Shoes"] = "cc_shoes_blue.png", + ["Black Shoes"] = "cc_shoes_black.png", } } diff --git a/textures/cc_pants_canvas_blue.png b/textures/cc_pants_canvas_blue.png new file mode 100644 index 0000000..7517d3a Binary files /dev/null and b/textures/cc_pants_canvas_blue.png differ diff --git a/textures/cc_pants_canvas_brown.png b/textures/cc_pants_canvas_brown.png new file mode 100644 index 0000000..e672fc9 Binary files /dev/null and b/textures/cc_pants_canvas_brown.png differ diff --git a/textures/cc_pants_canvas_green.png b/textures/cc_pants_canvas_green.png new file mode 100644 index 0000000..43d2232 Binary files /dev/null and b/textures/cc_pants_canvas_green.png differ diff --git a/textures/cc_shirt_canvas_blue.png b/textures/cc_shirt_canvas_blue.png new file mode 100644 index 0000000..ff677fa Binary files /dev/null and b/textures/cc_shirt_canvas_blue.png differ diff --git a/textures/cc_shirt_canvas_brown.png b/textures/cc_shirt_canvas_brown.png new file mode 100644 index 0000000..aed604e Binary files /dev/null and b/textures/cc_shirt_canvas_brown.png differ diff --git a/textures/cc_shirt_canvas_green.png b/textures/cc_shirt_canvas_green.png new file mode 100644 index 0000000..6bb4bdf Binary files /dev/null and b/textures/cc_shirt_canvas_green.png differ diff --git a/textures/cc_shoes_black.png b/textures/cc_shoes_black.png new file mode 100644 index 0000000..b4e4912 Binary files /dev/null and b/textures/cc_shoes_black.png differ diff --git a/textures/cc_shoes_blue.png b/textures/cc_shoes_blue.png new file mode 100644 index 0000000..00d3c39 Binary files /dev/null and b/textures/cc_shoes_blue.png differ diff --git a/textures/cc_shoes_brown.png b/textures/cc_shoes_brown.png new file mode 100644 index 0000000..4a31a27 Binary files /dev/null and b/textures/cc_shoes_brown.png differ diff --git a/textures/cc_shoes_green.png b/textures/cc_shoes_green.png new file mode 100644 index 0000000..45b7d61 Binary files /dev/null and b/textures/cc_shoes_green.png differ diff --git a/textures/cc_vest_blue.png b/textures/cc_vest_blue.png new file mode 100644 index 0000000..a9bf072 Binary files /dev/null and b/textures/cc_vest_blue.png differ diff --git a/textures/cc_vest_brown.png b/textures/cc_vest_brown.png new file mode 100644 index 0000000..f6bf426 Binary files /dev/null and b/textures/cc_vest_brown.png differ diff --git a/textures/cc_vest_green.png b/textures/cc_vest_green.png new file mode 100644 index 0000000..b2c9971 Binary files /dev/null and b/textures/cc_vest_green.png differ