]> git.lizzy.rs Git - dragonfireclient.git/blob - builtin/client/init.lua
[CSM] Add local formspecs. (#5094)
[dragonfireclient.git] / builtin / client / init.lua
1 -- Minetest: builtin/client/init.lua
2 local scriptpath = core.get_builtin_path()..DIR_DELIM
3 local clientpath = scriptpath.."client"..DIR_DELIM
4 local commonpath = scriptpath.."common"..DIR_DELIM
5
6 dofile(clientpath .. "register.lua")
7 dofile(commonpath .. "after.lua")
8 dofile(commonpath .. "chatcommands.lua")
9 dofile(clientpath .. "chatcommands.lua")
10 dofile(clientpath .. "preview.lua")
11
12 core.register_on_death(function()
13         core.display_chat_message("You died.")
14         local formspec = "size[11,5.5]bgcolor[#320000b4;true]" ..
15         "label[4.85,1.35;" .. fgettext("You died.") .. "]button_exit[4,3;3,0.5;btn_respawn;".. fgettext("Respawn") .."]"
16         core.show_formspec("bultin:death", formspec)
17 end)
18
19 core.register_on_formspec_input(function(formname, fields)
20         if formname == "bultin:death" then
21                 core.send_respawn()
22         end
23 end)