Remove newline converter in tutorial mod
This commit is contained in:
parent
2581923fbd
commit
7b103e1f25
@ -58,20 +58,6 @@ if(read==false) then
|
|||||||
tutorial.state.last_diamond = false
|
tutorial.state.last_diamond = false
|
||||||
end
|
end
|
||||||
|
|
||||||
function tutorial.convert_newlines(str)
|
|
||||||
if(type(str)~="string") then
|
|
||||||
return "ERROR: No string found!"
|
|
||||||
end
|
|
||||||
|
|
||||||
local function convert(s)
|
|
||||||
return s:gsub("\n", function(slash, what)
|
|
||||||
return ","
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
return convert(str)
|
|
||||||
end
|
|
||||||
|
|
||||||
function tutorial.register_infosign(itemstringpart, caption, fulltext)
|
function tutorial.register_infosign(itemstringpart, caption, fulltext)
|
||||||
tutorial.captions[itemstringpart] = caption
|
tutorial.captions[itemstringpart] = caption
|
||||||
minetest.register_node("tutorial:sign_"..itemstringpart, {
|
minetest.register_node("tutorial:sign_"..itemstringpart, {
|
||||||
@ -97,7 +83,7 @@ function tutorial.register_infosign(itemstringpart, caption, fulltext)
|
|||||||
"tablecolumns[text]"..
|
"tablecolumns[text]"..
|
||||||
"tableoptions[background=#000000;highlight=#000000;border=false]"..
|
"tableoptions[background=#000000;highlight=#000000;border=false]"..
|
||||||
"table[0,0.25;12,5.2;infosign_text;"..
|
"table[0,0.25;12,5.2;infosign_text;"..
|
||||||
tutorial.convert_newlines(minetest.formspec_escape(S(fulltext)))..
|
minetest.formspec_escape(S(fulltext))..
|
||||||
"]"..
|
"]"..
|
||||||
"button_exit[4.5,5.5;3,1;close;"..minetest.formspec_escape(S("Close")).."]"
|
"button_exit[4.5,5.5;3,1;close;"..minetest.formspec_escape(S("Close")).."]"
|
||||||
meta:set_string("formspec", formspec)
|
meta:set_string("formspec", formspec)
|
||||||
@ -125,7 +111,7 @@ minetest.register_abm( {
|
|||||||
"tablecolumns[text]"..
|
"tablecolumns[text]"..
|
||||||
"tableoptions[background=#000000;highlight=#000000;border=false]"..
|
"tableoptions[background=#000000;highlight=#000000;border=false]"..
|
||||||
"table[0,0.25;12,5.2;infosign_text;"..
|
"table[0,0.25;12,5.2;infosign_text;"..
|
||||||
tutorial.convert_newlines(minetest.formspec_escape(S(tutorial.texts[id])))..
|
minetest.formspec_escape(S(tutorial.texts[id]))..
|
||||||
"]"..
|
"]"..
|
||||||
"button_exit[4.5,5.5;3,1;close;"..minetest.formspec_escape(S("Close")).."]"
|
"button_exit[4.5,5.5;3,1;close;"..minetest.formspec_escape(S("Close")).."]"
|
||||||
meta:set_string("formspec", formspec)
|
meta:set_string("formspec", formspec)
|
||||||
@ -1347,7 +1333,7 @@ function tutorial.show_default_dialog(name, caption, text)
|
|||||||
"tablecolumns[text]"..
|
"tablecolumns[text]"..
|
||||||
"tableoptions[background=#000000;highlight=#000000;border=false]"..
|
"tableoptions[background=#000000;highlight=#000000;border=false]"..
|
||||||
"table[0,0.25;12,5.2;text_table;"..
|
"table[0,0.25;12,5.2;text_table;"..
|
||||||
tutorial.convert_newlines(minetest.formspec_escape(S(text)))..
|
minetest.formspec_escape(S(text))..
|
||||||
"]"..
|
"]"..
|
||||||
"button_exit[4.5,5.5;3,1;close;"..S("Close").."]"
|
"button_exit[4.5,5.5;3,1;close;"..S("Close").."]"
|
||||||
minetest.show_formspec(name, "tutorial_dialog", formspec)
|
minetest.show_formspec(name, "tutorial_dialog", formspec)
|
||||||
@ -1361,7 +1347,7 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
"tablecolumns[text]"..
|
"tablecolumns[text]"..
|
||||||
"tableoptions[background=#000000;highlight=#000000;border=false]"..
|
"tableoptions[background=#000000;highlight=#000000;border=false]"..
|
||||||
"table[0,0.25;12,5.2;creative_text;"..
|
"table[0,0.25;12,5.2;creative_text;"..
|
||||||
tutorial.convert_newlines(minetest.formspec_escape(S(tutorial.texts.notsingleplayer)))..
|
minetest.formspec_escape(S(tutorial.texts.notsingleplayer))..
|
||||||
"]"..
|
"]"..
|
||||||
"button_exit[2.5,5.5;3,1;close;"..minetest.formspec_escape(S("Continue anyways")).."]"..
|
"button_exit[2.5,5.5;3,1;close;"..minetest.formspec_escape(S("Continue anyways")).."]"..
|
||||||
"button_exit[6.5,5.5;3,1;leave;"..minetest.formspec_escape(S("Leave tutorial")).."]"
|
"button_exit[6.5,5.5;3,1;leave;"..minetest.formspec_escape(S("Leave tutorial")).."]"
|
||||||
@ -1371,7 +1357,7 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
"tablecolumns[text]"..
|
"tablecolumns[text]"..
|
||||||
"tableoptions[background=#000000;highlight=#000000;border=false]"..
|
"tableoptions[background=#000000;highlight=#000000;border=false]"..
|
||||||
"table[0,0.25;12,5.2;creative_text;"..
|
"table[0,0.25;12,5.2;creative_text;"..
|
||||||
tutorial.convert_newlines(minetest.formspec_escape(S(tutorial.texts.creative)))..
|
minetest.formspec_escape(S(tutorial.texts.creative))..
|
||||||
"]"..
|
"]"..
|
||||||
"button_exit[2.5,5.5;3,1;close;"..minetest.formspec_escape(S("Continue anyways")).."]"..
|
"button_exit[2.5,5.5;3,1;close;"..minetest.formspec_escape(S("Continue anyways")).."]"..
|
||||||
"button_exit[6.5,5.5;3,1;leave;"..minetest.formspec_escape(S("Leave tutorial")).."]"
|
"button_exit[6.5,5.5;3,1;leave;"..minetest.formspec_escape(S("Leave tutorial")).."]"
|
||||||
@ -1382,7 +1368,7 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
"tablecolumns[text]"..
|
"tablecolumns[text]"..
|
||||||
"tableoptions[background=#000000;highlight=#000000;border=false]"..
|
"tableoptions[background=#000000;highlight=#000000;border=false]"..
|
||||||
"table[0,0.25;12,5.2;intro_text;"..
|
"table[0,0.25;12,5.2;intro_text;"..
|
||||||
tutorial.convert_newlines(minetest.formspec_escape(S(tutorial.texts.intro)))..
|
minetest.formspec_escape(S(tutorial.texts.intro))..
|
||||||
"]"..
|
"]"..
|
||||||
"button_exit[4.5,5.5;3,1;close;"..minetest.formspec_escape(S("Close")).."]"
|
"button_exit[4.5,5.5;3,1;close;"..minetest.formspec_escape(S("Close")).."]"
|
||||||
tutorial.state.intro_text = true
|
tutorial.state.intro_text = true
|
||||||
@ -1483,7 +1469,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
"tablecolumns[text]"..
|
"tablecolumns[text]"..
|
||||||
"tableoptions[background=#000000;highlight=#000000;border=false]"..
|
"tableoptions[background=#000000;highlight=#000000;border=false]"..
|
||||||
"table[0,0.25;12,5.2;creative_text;"..
|
"table[0,0.25;12,5.2;creative_text;"..
|
||||||
tutorial.convert_newlines(minetest.formspec_escape(S(tutorial.texts.last_gold)))..
|
minetest.formspec_escape(S(tutorial.texts.last_gold))..
|
||||||
"]"..
|
"]"..
|
||||||
"button_exit[0.5,5.5;3,1;close;"..minetest.formspec_escape(S("Continue")).."]"..
|
"button_exit[0.5,5.5;3,1;close;"..minetest.formspec_escape(S("Continue")).."]"..
|
||||||
"button_exit[4.5,5.5;3,1;leave;"..minetest.formspec_escape(S("Leave tutorial")).."]"..
|
"button_exit[4.5,5.5;3,1;leave;"..minetest.formspec_escape(S("Leave tutorial")).."]"..
|
||||||
@ -1517,7 +1503,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
"tablecolumns[text]"..
|
"tablecolumns[text]"..
|
||||||
"tableoptions[background=#000000;highlight=#000000;border=false]"..
|
"tableoptions[background=#000000;highlight=#000000;border=false]"..
|
||||||
"table[0,0.25;12,5.2;last_diamond_text;"..
|
"table[0,0.25;12,5.2;last_diamond_text;"..
|
||||||
tutorial.convert_newlines(minetest.formspec_escape(S(tutorial.texts.last_diamond)))..
|
minetest.formspec_escape(S(tutorial.texts.last_diamond))..
|
||||||
"]"..
|
"]"..
|
||||||
"button_exit[2.5,5.5;3,1;close;"..minetest.formspec_escape(S("Continue")).."]"..
|
"button_exit[2.5,5.5;3,1;close;"..minetest.formspec_escape(S("Continue")).."]"..
|
||||||
"button_exit[6.5,5.5;3,1;gotoend;"..minetest.formspec_escape(S("Go to Good-Bye room")).."]"
|
"button_exit[6.5,5.5;3,1;gotoend;"..minetest.formspec_escape(S("Go to Good-Bye room")).."]"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user