Skip to content
Permalink
Browse files

Add textures to default formspecs

  • Loading branch information
CSPS-HaydenWoods committed Feb 26, 2013
1 parent 230747c commit 32a552cae18067b805d47643ac619604304b16a3
@@ -89,6 +89,11 @@ MirceaKitsune (WTFPL):
Jordach (CC BY-SA 3.0):
character.png

PilzAdam (WTFPL):
default_inventory.png
default_inventory_furnace.png
default_inventory_chest.png

Glass breaking sounds (CC BY 3.0):
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
2: http://www.freesound.org/people/Tomlija/sounds/97669/
@@ -1233,6 +1233,7 @@ minetest.register_node("default:chest", {
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
"size[8,9]"..
"background[-0.19,-0.25;8.41,9.75;default_inventory_chest.png]"..
"list[current_name;main;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]")
meta:set_string("infotext", "Chest")
@@ -1342,19 +1343,21 @@ minetest.register_node("default:chest_locked", {
local pos = pos.x .. "," .. pos.y .. "," ..pos.z
minetest.show_formspec(clicker:get_player_name(), "default:chest_locked",
"size[8,9]"..
"background[-0.19,-0.25;8.41,9.75;default_inventory_chest.png]"..
"list[nodemeta:".. pos .. ";main;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]")
end
end,
})

default.furnace_inactive_formspec =
"size[8,9]"..
"image[2,2;1,1;default_furnace_fire_bg.png]"..
"list[current_name;fuel;2,3;1,1;]"..
"list[current_name;src;2,1;1,1;]"..
"list[current_name;dst;5,1;2,2;]"..
"list[current_player;main;0,5;8,4;]"
"size[8,7.5]"..
"background[-0.19,-0.25;8.41,8.25;default_inventory_furnace.png]"..
"image[2,1;1,1;default_furnace_fire_bg.png]"..
"list[current_name;fuel;2,2;1,1;]"..
"list[current_name;src;2,0;1,1;]"..
"list[current_name;dst;5,0;2,2;]"..
"list[current_player;main;0,3.5;8,4;]"

minetest.register_node("default:furnace", {
description = "Furnace",
@@ -1488,13 +1491,14 @@ minetest.register_abm({
meta:set_string("infotext","Furnace active: "..percent.."%")
hacky_swap_node(pos,"default:furnace_active")
meta:set_string("formspec",
"size[8,9]"..
"image[2,2;1,1;default_furnace_fire_bg.png^[lowpart:"..
"size[8,7.5]"..
"background[-0.19,-0.25;8.41,8.25;default_inventory_furnace.png]"..
"image[2,1;1,1;default_furnace_fire_bg.png^[lowpart:"..
(100-percent)..":default_furnace_fire_fg.png]"..
"list[current_name;fuel;2,3;1,1;]"..
"list[current_name;src;2,1;1,1;]"..
"list[current_name;dst;5,1;2,2;]"..
"list[current_player;main;0,5;8,4;]")
"list[current_name;fuel;2,2;1,1;]"..
"list[current_name;src;2,0;1,1;]"..
"list[current_name;dst;5,0;2,2;]"..
"list[current_player;main;0,3.5;8,4;]")
return
end

@@ -67,8 +67,21 @@ function player_update_visuals(pl)
pl:set_properties(prop)
end

-- Update appearance when the player joins
minetest.register_on_joinplayer(player_update_visuals)
function default.set_player_inventory(player)
player:set_inventory_formspec(
"size[8,7.5]"..
"background[-0.19,-0.25;8.41,8.25;default_inventory.png]"..
"list[current_player;main;0,3.5;8,4;]"..
"list[current_player;craft;3,0;3,3;]"..
"list[current_player;craftpreview;7,1;1,1;]"
)
end

-- Set model and formspec of player
minetest.register_on_joinplayer(function(player)
player_update_visuals(player)
default.set_player_inventory(player)
end)

-- Check each player and apply animations
function player_step(dtime)
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 32a552c

Please sign in to comment.
You can’t perform that action at this time.