Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wardrobe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
wardrobe
Compare revisions
8636079b5d6b8a24c7b025db9122adabb9ea3a2c to 369c088067b35ee28c268ee390095db2dcf40dca
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
Illuna-Minetest/wardrobe
Select target project
No results found
369c088067b35ee28c268ee390095db2dcf40dca
Select Git revision
Swap
Target
Illuna-Minetest/wardrobe
Select target project
Illuna-Minetest/wardrobe
1 result
8636079b5d6b8a24c7b025db9122adabb9ea3a2c
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
Allow character creator, homedecor and wardrobe mods to work together. – by auouymous
· 369c0880
Milan
authored
3 years ago
369c0880
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
skinMethods.lua
+17
-2
17 additions, 2 deletions
skinMethods.lua
wardrobe.lua
+5
-1
5 additions, 1 deletion
wardrobe.lua
with
22 additions
and
3 deletions
skinMethods.lua
View file @
369c0880
...
@@ -42,6 +42,9 @@ local function changeWardrobeSkin(playerName, skin)
...
@@ -42,6 +42,9 @@ local function changeWardrobeSkin(playerName, skin)
error
(
"unknown skin '"
..
skin
..
"'"
);
error
(
"unknown skin '"
..
skin
..
"'"
);
end
;
end
;
-- clear homedecor wardrobe skin
player
:
set_attribute
(
"homedecor:player_skin"
,
""
)
wardrobe
.
playerSkins
[
playerName
]
=
skin
;
wardrobe
.
playerSkins
[
playerName
]
=
skin
;
wardrobe
.
storage
.
savePlayerSkins
();
wardrobe
.
storage
.
savePlayerSkins
();
end
;
end
;
...
@@ -80,11 +83,23 @@ local SKIN_CHANGE_METHODS =
...
@@ -80,11 +83,23 @@ local SKIN_CHANGE_METHODS =
{
{
required_mods
=
{
'3d_armor'
},
required_mods
=
{
'3d_armor'
},
initSkin
=
nil
,
initSkin
=
function
(
player
)
local
playerName
=
player
:
get_player_name
()
if
not
playerName
or
playerName
==
""
then
return
end
local
skin
=
wardrobe
.
playerSkins
[
playerName
]
if
not
skin
or
not
wardrobe
.
skinNames
[
skin
]
then
return
end
armor
.
textures
[
playerName
].
skin
=
skin
armor
:
update_player_visuals
(
player
)
end
,
changeSkin
=
function
(
playerName
,
skin
)
changeSkin
=
function
(
playerName
,
skin
)
changeWardrobeSkin
(
playerName
,
skin
);
changeWardrobeSkin
(
playerName
,
skin
);
armor
.
textures
[
playerName
].
skin
=
skin
;
if
skin
==
nil
then
-- character creator skin will restore at next login, or now by pressing 'Done' in character creator
armor
.
textures
[
playerName
].
skin
=
armor
.
default_skin
..
".png"
else
armor
.
textures
[
playerName
].
skin
=
skin
end
end
,
end
,
updateSkin
=
function
(
player
)
updateSkin
=
function
(
player
)
...
...
This diff is collapsed.
Click to expand it.
wardrobe.lua
View file @
369c0880
...
@@ -14,7 +14,7 @@ local function showForm(player, page)
...
@@ -14,7 +14,7 @@ local function showForm(player, page)
local
s
=
1
+
SKINS_PER_PAGE
*
(
page
-
1
);
local
s
=
1
+
SKINS_PER_PAGE
*
(
page
-
1
);
local
e
=
math.min
(
s
+
SKINS_PER_PAGE
-
1
,
n
);
local
e
=
math.min
(
s
+
SKINS_PER_PAGE
-
1
,
n
);
local
fs
=
"size[5,1
0
]"
;
local
fs
=
"size[5,1
1
]"
;
fs
=
fs
..
"label[0,0;Change Into:]"
;
fs
=
fs
..
"label[0,0;Change Into:]"
;
for
i
=
s
,
e
do
for
i
=
s
,
e
do
local
slot
=
i
-
s
+
1
;
local
slot
=
i
-
s
+
1
;
...
@@ -29,6 +29,7 @@ local function showForm(player, page)
...
@@ -29,6 +29,7 @@ local function showForm(player, page)
if
page
<
nPages
then
if
page
<
nPages
then
fs
=
fs
..
"button_exit[4,9;1,1;n:p"
..
(
page
+
1
)
..
";next]"
;
fs
=
fs
..
"button_exit[4,9;1,1;n:p"
..
(
page
+
1
)
..
";next]"
;
end
end
fs
=
fs
..
"button_exit[0,10;5,1;c:c;clear]"
;
minetest
.
show_formspec
(
playerName
,
FORM_NAME
,
fs
);
minetest
.
show_formspec
(
playerName
,
FORM_NAME
,
fs
);
end
end
...
@@ -52,6 +53,9 @@ minetest.register_on_player_receive_fields(
...
@@ -52,6 +53,9 @@ minetest.register_on_player_receive_fields(
elseif
action
==
"s"
then
elseif
action
==
"s"
then
wardrobe
.
changePlayerSkin
(
playerName
,
value
);
wardrobe
.
changePlayerSkin
(
playerName
,
value
);
return
;
return
;
elseif
action
==
"c"
then
wardrobe
.
changePlayerSkin
(
playerName
,
nil
);
return
;
end
end
end
end
end
end
...
...
This diff is collapsed.
Click to expand it.