Compare commits

..

10 Commits

Author SHA1 Message Date
tenplus1
55c0cd1dae 5.x update 2024-11-10 16:56:30 +00:00
tenplus1
125ed4fd75 remove intllib, 5.x only 2023-08-08 14:44:44 +01:00
tenplus1
1ea79b2794 update readme 2022-11-23 18:19:22 +00:00
tenplus1
49c0f167c3 updated screenshot 2022-11-23 18:07:45 +00:00
tenplus1
12d6673e0f all skin textures replaced thanks to isaiah658 2022-11-23 18:04:13 +00:00
tenplus1
fa87199da0 add skin info 2022-11-19 08:15:59 +00:00
tenplus1
7b84fe011d add new screenshot 2022-10-27 12:50:07 +01:00
tenplus1
945047d059 detect player_api 2022-03-24 07:55:18 +00:00
tenplus1
f286737812 detect how to set skin 2022-02-10 18:24:04 +00:00
tenplus1
35fcd870cf fix translation support 2022-02-10 14:57:25 +00:00
79 changed files with 112 additions and 279 deletions

View File

@ -1,6 +0,0 @@
default
player_api?
sfinv?
inventory_plus?
intllib?
unified_inventory?

View File

@ -1 +0,0 @@
Mod that allows players to set their individual skins.

View File

@ -1,12 +1,13 @@
-- Simple Skins mod for minetest
-- Adds a simple skin selector to the inventory by using
-- the default sfinv or inventory_plus when running.
-- Adds a simple skin selector to the inventory.
-- Released by TenPlus1 and based on Zeg9's code under MIT license
-- Load support for intllib.
local S = minetest.get_translator and minetest.get_translator("simple_skins") or
dofile(skins.modpath .. "/intllib.lua")
-- Load support for translation.
local S = minetest.get_translator("simple_skins")
-- global and settings
skins = {
skins = {}, list = {}, meta = {}, formspec = {},
@ -19,12 +20,11 @@ skins = {
id = 1,
file = minetest.get_worldpath() .. "/simple_skins.mt",
preview = minetest.settings:get_bool("simple_skins_preview"),
translate = S,
skin_limit = tonumber(minetest.settings:get("simple_skins_limit")) or 300
}
-- check and use specific inventory
if skins.unified_inventory then
skins.transparant_list = true
dofile(skins.modpath .. "/unified_inventory.lua")
@ -38,8 +38,8 @@ elseif skins.sfinv then
dofile(skins.modpath .. "/sfinv.lua")
end
-- load skin list and metadata
local f, data, skin = 1
while skins.id <= skins.skin_limit do
@ -77,8 +77,8 @@ while skins.id <= skins.skin_limit do
skins.id = skins.id + 1
end
-- load player skins file for backwards compatibility
local input = io.open(skins.file, "r")
local data = nil
@ -97,13 +97,12 @@ if data and data ~= "" then
end
end
-- check for minetest 5.4 compatibility
-- check for minetest 5.x compatibility
local is_54 = minetest.has_feature("direct_velocity_on_players")
local is_50 = minetest.has_feature("object_use_texture_alpha")
-- create formspec for skin selection page
skins.formspec.main = function(name)
local formspec = "label[.5,2;" .. S("Select Player Skin:") .. "]"
@ -153,8 +152,8 @@ skins.formspec.main = function(name)
return formspec
end
-- Read the image size from a PNG file. (returns width, height)
local PNG_HDR = string.char(0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A)
local function read_image_size(filename)
@ -177,8 +176,8 @@ local function read_image_size(filename)
return ws:byte(), hs:byte()
end
-- update player skin
skins.update_player_skin = function(player)
if not player then
@ -187,10 +186,14 @@ skins.update_player_skin = function(player)
local name = player:get_player_name()
default.player_set_textures(player, {skins.skins[name] .. ".png"})
-- player_api.set_textures(player, {skins.skins[name] .. ".png"})
if minetest.get_modpath("player_api") then
player_api.set_textures(player, {skins.skins[name] .. ".png"})
else
default.player_set_textures(player, {skins.skins[name] .. ".png"})
end
end
-- selection event
skins.event_CHG = function(event, player)
@ -205,31 +208,18 @@ skins.event_CHG = function(event, player)
skins.update_player_skin(player)
if is_50 then
local meta = player:get_meta()
local meta = player:get_meta()
meta:set_string("simple_skins:skin", skins.skins[name])
else
player:set_attribute("simple_skins:skin", skins.skins[name])
end
meta:set_string("simple_skins:skin", skins.skins[name])
end
-- load player skin on join
minetest.register_on_joinplayer(function(player)
local name = player:get_player_name() ; if not name then return end
local skin
if is_50 then
local meta = player:get_meta()
skin = meta:get_string("simple_skins:skin")
else
skin = player:get_attribute("simple_skins:skins")
end
local meta = player:get_meta()
local skin = meta:get_string("simple_skins:skin")
-- do we already have a skin in player attributes?
if skin and skin ~= "" then
@ -243,8 +233,8 @@ minetest.register_on_joinplayer(function(player)
skins.update_player_skin(player)
end)
-- admin command to set player skin (usually for custom skins)
minetest.register_chatcommand("setskin", {
params = "<player> <skin number>",
description = S("Admin command to set player skin"),
@ -272,14 +262,9 @@ minetest.register_chatcommand("setskin", {
skins.update_player_skin(player)
if is_50 then
local meta = player:get_meta()
local meta = player:get_meta()
meta:set_string("simple_skins:skin", skins.skins[playername])
else
player:set_attribute("simple_skins:skin", skins.skins[playername])
end
meta:set_string("simple_skins:skin", skins.skins[playername])
minetest.chat_send_player(playername,
S("Your skin has been set to") .. " character_" .. skin)

View File

@ -1,3 +0,0 @@
-- Support for the old multi-load method
dofile(minetest.get_modpath("intllib").."/init.lua")

View File

@ -1,5 +1,5 @@
local S = skins.translate
local S = minetest.get_translator("simple_skins")
minetest.register_on_joinplayer(function(player)

View File

@ -1,3 +1,18 @@
License of Media:
-----------------
Title: Minetest Skins Pack 1
Title URL: https://opengameart.org/content/minetest-skins-pack-1
Author: isaiah658
License(s): License(s): CC0 ( http://creativecommons.org/publicdomain/zero/1.0/legalcode )
Original file names: Skin_1.png to Skin_32.png and Icon.png
Simple Skins file names: character_1.png to character_31.png, character_900.png, and inventory_plus_skins.png
Modifications: None
License of Code:
----------------
The MIT License (MIT)
Copyright (c) 2016 TenPlus1

View File

@ -1,51 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-29 07:11+0200\n"
"PO-Revision-Date: 2017-07-29 07:17+0200\n"
"Last-Translator: fat115 <fat115@framasoft.org>\n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.12\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: init.lua
msgid "Select Player Skin:"
msgstr "Sélectionner l'apparence du joueur :"
#: init.lua
msgid "Name: "
msgstr "Nom : "
#: init.lua
msgid "Author: "
msgstr "Auteur : "
#: init.lua
msgid "Admin command to set player skin"
msgstr "Commande admin pour définir l'apparence du joueur"
#: init.lua
msgid "'s skin set to"
msgstr ", apparence définie pour"
#: init.lua
msgid "Set player skin"
msgstr "Définir l'apparence du joueur"
#: init.lua
msgid "Close"
msgstr "Fermer"
#: init.lua
msgid "[MOD] Simple Skins loaded"
msgstr "[MOD] Simple Skins chargé"

View File

@ -1,52 +0,0 @@
# simple_skin <italian translate>.
# Copyright (C) 2018
# This file is distributed under the same license as the PACKAGE package.
# Stefano Peris <xenon77.dev@gmail.com>, 2018.
# Github: <https://github.com/XenonCoder>
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-21 07:29+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Stefano Peris <xenon77.dev@gmail.com>\n"
"Language-Team: \n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.12\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: init.lua
msgid "Select Player Skin:"
msgstr "Seleziona la skin del giocatore"
#: init.lua
msgid "Name: "
msgstr "Nome"
#: init.lua
msgid "Author: "
msgstr "Autore"
#: init.lua
msgid "Admin command to set player skin"
msgstr "Comando di admin per impostare la skin del giocatore"
#: init.lua
msgid "'s skin set to"
msgstr ", la skin è impostata su"
#: init.lua
msgid "Set player skin"
msgstr "Imposta la skin del giocatore"
#: init.lua
msgid "Close"
msgstr "Chiudi"
#: init.lua
msgid "[MOD] Simple Skins loaded"
msgstr "[MOD] Skins semplici caricate"

View File

@ -1,51 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-29 07:11+0200\n"
"PO-Revision-Date: 2018-02-14 01:23+0800\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.6\n"
"Last-Translator: MuhdNurHidayat (MNH48) <mnh48mail@gmail.com>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"Language: ms\n"
#: init.lua
msgid "Select Player Skin:"
msgstr "Pilih Kulit Pemain:"
#: init.lua
msgid "Name: "
msgstr "Nama: "
#: init.lua
msgid "Author: "
msgstr "Pencipta: "
#: init.lua
msgid "Admin command to set player skin"
msgstr "Perintah pentadbir untuk menetapkan kulit pemain"
#: init.lua
msgid "'s skin set to"
msgstr " telah ditukarkan kulitnya kepada"
#: init.lua
msgid "Set player skin"
msgstr "Tetapkan kulit pemain"
#: init.lua
msgid "Close"
msgstr "Tutup"
#: init.lua
msgid "[MOD] Simple Skins loaded"
msgstr "[MODS] Simple Skins telah dimuatkan"

View File

@ -1,4 +1,2 @@
name = "Sam",
author = "Jordach",
description = "The default skin.",
comment = "Sam Ain't Minecraft",
name = "Farmer",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Assassin",
author = "jmf",
name = "Farm Girl",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Harry",
author = "jmf",
name = "Jerry",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Bob",
author = "Chinchow",
name = "Scary",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Jannette",
author = "Chinchow",
name = "Cool Dude",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Sheriff",
author = "Chinchow",
name = "Knight",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Sepia Sam",
author = "Hybrid Dog",
name = "Derp Dirt",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Hybrid Sam",
author = "Hybrid Dog",
name = "Ice",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Original Sam",
author = "Jordach",
name = "Robot",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Unnamed",
author = "Hybrid Dog",
name = "King",
author = "isaiah658",

View File

@ -1,3 +1,2 @@
name = "VanessaE",
author = "Jordach",
comment = "Actually based from an old picture",
name = "Diced",
author = "isaiah658",

View File

@ -1,3 +1,2 @@
name = "Zeg9",
author = "Zeg9",
description = "My own skin.",
name = "Waffles",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Female Sam",
author = "Jordach",
name = "Glitch",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Battlefield 3 Soldier",
author = "Jordach",
name = "Pink Camouflage",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Smooth Sam",
author = "Jordach",
name = "Biker",
author = "isaiah658",

View File

@ -1,3 +1,2 @@
name = "Celeron55",
author = "Jordach",
comment = "Based on a picture from the wiki.",
name = "Jade",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Tuxedo Sam",
author = "Jordach",
name = "Split",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Iron Man MK. 7",
author = "Jordach",
name = "Camouflage",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Jordach",
author = "Jordach",
name = "Earth",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Max",
author = "Stuart Jones",
name = "Stone",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Slenderman",
author = "prof_turbo",
name = "Lab Coat",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Strange Killer",
author = "prof_turbo",
name = "Skeleton",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Alien",
author = "jmf",
name = "Autumn",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "jojoa1997",
author = "jojoa1997",
name = "Winter Boy",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "DrakeOfDuty",
author = "jmfApprentice Prince",
name = "Winter Girl",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Soldier",
author = "jmf",
name = "Cubed",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "John",
author = "jmf",
name = "Tux",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Ninja",
author = "jmf",
name = "Cool Guy",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Oerkki",
author = "jmf",
name = "Cool Girl",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Tux",
author = "jmf",
name = "Retro",
author = "isaiah658",

View File

@ -1,2 +1,2 @@
name = "Black belt",
author = "jmf",
name = "Jim",
author = "isaiah658",

View File

@ -1,4 +1,5 @@
name = simple_skins
description = Adds a simple list of available skins for players to use.
depends = default
optional_depends = player_api, sfinv, inventory_plus, intllib, unified_inventory
description = Mod that allows players to set their individual skins.
optional_depends = player_api, sfinv, inventory_plus, unified_inventory
min_minetest_version = 5.0

View File

@ -13,7 +13,7 @@ Must be named `simple_skins` and uses SfInv or Inventory Plus mods,
and Unified Inventory if you use lasted original (master branch)
version when available to allow players to select a skin/texture from the list.
![screenshot.png](screenshot.png)
![screenshot.jpg](screenshot.jpg)
Original forum https://forum.minetest.net/viewtopic.php?id=9100
@ -76,6 +76,7 @@ Change log:
Change log:
- 1.01- Replace all unlicensed skins with CC0 one's (many thanks isaiah658)
- 1.0 - Added skin_limit setting to limit skins loaded, sanitized skin description
- 0.9 - Added Unified Inventory support (thanks Opvolger)
- 0.8 - Added player model preview when viewing formspec (Minetest 5.4 dev only)

BIN
screenshot.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -1,5 +1,5 @@
local S = skins.translate
local S = minetest.get_translator("simple_skins")
if skins.default_skin_tab then

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 B

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 415 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 967 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 837 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 951 B

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 925 B

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 903 B

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 964 B

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 687 B

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 555 B

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 B

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 271 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 922 B

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 459 B

After

Width:  |  Height:  |  Size: 518 B

View File

@ -1,5 +1,5 @@
local S = skins.translate
local S = minetest.get_translator("simple_skins")
unified_inventory.register_button("skins", {