This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Notes: | |
Times returned from "minetest.get_timeofday()" | |
Numbers have been trimmed to 2 significant figures. | |
0 is 12:00 AM | |
0.23 is 5:30 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Beds Flowchart: | |
|- 1) on_rightclick() (beds:bed_name or any node:here) (function call beds.bed_rightclick(pos, player)) | |
| | |
| | |
|--- i) Is it night time and a player? (Gone 6pm in local clock?) | |
| | | |
| | | |
|------ I) else, return, end | |
| | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- how to add your own textures to the wardrobe; | |
--[[ | |
Make sure your textures are in greyscale, eg, from black to white in 0-255 steps | |
The engine prefers this colour as it is easier to look right once a player has | |
set their colour preferences for a specific piece of clothing. | |
The only non-colourable texture is the mouth, as that either lightly shades the mouth area or |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You guessed: 65 | |
Too Small! | |
Please input your guess. | |
66 | |
You guessed: 66 | |
Too Big! | |
Please input your guess. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You guessed: 65 | |
Too Small! | |
Please input your guess. | |
66 | |
You guessed: 66 | |
Too Big! | |
Please input your guess. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wardrobe.load_user_data(player) | |
local pname = player:get_player_name() | |
-- load non-RGB choices | |
if player:get_attribute("wardrobe_choices") == nil then | |
wardrobe.formspec_selections[pname] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} | |
print ("[Wardrobe] Failed Loading Texture Data for Player: " .. pname) | |
player:set_attribute("wardrobe_choices", minetest.serialize(wardrobe.formspec_selections[pname])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wardrobe.formspec_selections_rgb[pname][22] = wardrobe.is_save_hex(fields.acc6) | |
if wardrobe.is_hex(fields.acc6) then | |
wardrobe.formspec_selections_rgb[pname][22] = fields.acc6 | |
else | |
wardrobe.formspec_selections_rgb[pname][22] = "ffffff" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wardrobe.load_user_data(player) | |
local pname = player:get_player_name() | |
-- load non-RGB choices | |
if minetest.deserialize(player:get_attribute("wardrobe_choices")) == nil then | |
wardrobe.formspec_selections[pname] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entity[1]:set_properties({ | |
textures = { | |
"ptextures_transparent.png", | |
"(wardrobe_skin.png^[multiply:#"..fields.skintone..")^".. | |
"(wardrobe_eyes_white_"..wardrobe.formspec_selections[pname][1]..".png^[multiply:#"..fields.ewhite..")^".. | |
"(wardrobe_eyes_pupil_"..wardrobe.formspec_selections[pname][2]..".png^[multiply:#"..fields.pcolour..")^".. | |
"(wardrobe_hair_"..wardrobe.formspec_selections[pname][3]..".png^[multiply:#"..fields.hairdye..")^".. | |
"(wardrobe_under_shirt_"..wardrobe.formspec_selections[pname][5]..".png^[multiply:#"..fields.undshirt..")^".. | |
"(wardrobe_under_shirt_"..wardrobe.formspec_selections[pname][6]..".png^[multiply:#"..fields.undshirt2..")^".. | |
"(wardrobe_socks_2.png^[multiply:#"..fields.socks..")^".. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wardrobe.is_save_hex(textfield) | |
if string.match(textfield, "^[0-9a-fA-F]+$") and #textfield == 6 then | |
return textfield | |
else | |
return "ffffff" | |
end | |
end |