Show intro after continuing to play

This commit is contained in:
Wuzzy 2024-11-27 17:19:43 +01:00
parent 63c3b37602
commit 5d10163f56

View File

@ -1358,7 +1358,7 @@ minetest.register_on_joinplayer(function(player)
elseif(not map_editing and playerinfo.touch_controls == true) then
formspec = "size[12,6]"..
text_box(NS("Keyboard and mouse recommended"), tutorial.texts.mobile)..
"button_exit[2.5,5.5;3,1;close;"..minetest.formspec_escape(S("Continue anyways")).."]"..
"button_exit[2.5,5.5;3,1;showintro;"..minetest.formspec_escape(S("Continue anyways")).."]"..
"button_exit[6.5,5.5;3,1;leave;"..minetest.formspec_escape(S("Leave tutorial")).."]"
elseif(not map_editing and tutorial.state.intro_text == false) then
@ -1420,6 +1420,15 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
elseif(fields.gotoend) then
tutorial.go_to_end(player)
return
elseif(fields.showintro) then
if not tutorial.state.intro_text then
local formspec = "size[12,6]"..
text_box(NS("Introduction"), tutorial.texts.intro)..
"button_exit[4.5,5.5;3,1;close;"..minetest.formspec_escape(S("Close")).."]"
tutorial.state.intro_text = true
tutorial.save_state()
minetest.show_formspec(player:get_player_name(), "intro", formspec)
end
end
if formname == "tutorial_teleport" then
for id, data in pairs(tutorial.locations) do