forked from minetest/minetest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CSM: Don't create the client script environment if CSM is disabled (m…
…inetest#7874) Use the CSM death formspec when CSM is enabled and use the engine death formspec when CSM is disabled. Move the CSM death formspec code to a dedicated file.
- Loading branch information
Showing
7 changed files
with
87 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- CSM death formspec. Only used when clientside modding is enabled, otherwise | ||
-- handled by the engine. | ||
|
||
core.register_on_death(function() | ||
core.display_chat_message("You died.") | ||
local formspec = "size[11,5.5]bgcolor[#320000b4;true]" .. | ||
"label[4.85,1.35;" .. fgettext("You died") .. | ||
"]button_exit[4,3;3,0.5;btn_respawn;".. fgettext("Respawn") .."]" | ||
core.show_formspec("bultin:death", formspec) | ||
end) | ||
|
||
core.register_on_formspec_input(function(formname, fields) | ||
if formname == "bultin:death" then | ||
core.send_respawn() | ||
end | ||
end) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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