Implement listrings
[minetest_tutorial_subgame.git] / mods / default / init.lua
blob947f1922eee136cb770a83b4ec012fc1c5423de5
1 -- Minetest 0.4 mod: default
2 -- See README.txt for licensing and other information.
4 -- The API documentation in here was moved into doc/lua_api.txt
6 -- intllib support
7 local S
8 if (minetest.get_modpath("intllib")) then
9 dofile(minetest.get_modpath("intllib").."/intllib.lua")
10 S = intllib.Getter(minetest.get_current_modname())
11 else
12 S = function ( s ) return s end
13 end
15 WATER_ALPHA = 160
16 WATER_VISC = 1
17 LAVA_VISC = 7
18 LIGHT_MAX = 14
20 -- Definitions made by this mod that other mods can use too
21 default = {}
23 -- GUI related stuff
24 default.gui_bg = "bgcolor[#080808BB;true]"
25 default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]"
26 default.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]"
27 default.gui_controls = minetest.formspec_escape(S("[left click]: take/drop stack; [right click]: take half / drop 1; [middle click]: take 10 / drop 10; [Esc] or [I]: Close"))
29 function default.get_hotbar_bg(x,y)
30 local out = ""
31 for i=0,7,1 do
32 out = out .."image["..x+i..","..y..";1,1;gui_hb_bg.png]"
33 end
34 return out
35 end
37 default.gui_suvival_form = "size[8,8.5]"..
38 default.gui_bg..
39 default.gui_bg_img..
40 default.gui_slots..
41 "button_exit[-0.1,-0.3;2,1;gotostart;"..minetest.formspec_escape(S("Back to start")).."]"..
42 "label[0,3.75;"..minetest.formspec_escape(S("Player inventory:")).."]"..
43 "list[current_player;main;0,4.25;8,1;]"..
44 "list[current_player;main;0,5.5;8,3;8]"..
45 "label[0,8.4;"..default.gui_controls.."]"..
46 "label[2.75,-0.1;"..minetest.formspec_escape(S("Crafting grid:")).."]"..
47 "list[current_player;craft;2.75,0.5;3,3;]"..
48 "label[6.75,0.9;"..minetest.formspec_escape(S("Output slot:")).."]"..
49 "list[current_player;craftpreview;6.75,1.5;1,1;]"..
50 "image[5.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
51 "listring[current_player;main]"..
52 "listring[current_player;craft]"..
53 default.get_hotbar_bg(0,4.25)
55 -- Load files
56 dofile(minetest.get_modpath("default").."/functions.lua")
57 dofile(minetest.get_modpath("default").."/nodes.lua")
58 dofile(minetest.get_modpath("default").."/tools.lua")
59 dofile(minetest.get_modpath("default").."/craftitems.lua")
60 dofile(minetest.get_modpath("default").."/crafting.lua")
61 dofile(minetest.get_modpath("default").."/mapgen.lua")
62 dofile(minetest.get_modpath("default").."/player.lua")
63 dofile(minetest.get_modpath("default").."/trees.lua")