Corrige l'affichage du guide

This commit is contained in:
Sys Quatre 2020-03-21 18:18:56 +01:00
parent 3b01f2b9b7
commit 871a66fe4c
1 changed files with 102 additions and 142 deletions

244
guide.lua
View File

@ -4,112 +4,101 @@ local cube = minetest.inventorycube
local guide_infos = { local guide_infos = {
{ {
description = "Mushrooms", description = "Mushrooms",
{"text", "Hell mushrooms can be found on the hell's ground and\n".. {"text", "Hell mushrooms can be found on the hell's ground and on hellrack soil, it can be dug by hand."},
"on hellrack soil, it can be dug by hand."},
{"image", {1, 1, "riesenpilz_nether_shroom_side.png"}}, {"image", {1, 1, "riesenpilz_nether_shroom_side.png"}},
{"y", 0.2}, {"y", 0.5},
{"text", "If you drop it without holding the fast key, you can split it into its stem and head:"}, {"text", "If you drop it without holding the fast key, you can split it into its stem and head:"},
{"image", {1, 1, "hell_shroom_top.png", 1}}, {"image", {1, 1, "hell_shroom_top.png", 1}},
{"image", {1, 1, "hell_shroom_stem.png"}}, {"image", {1, 1, "hell_shroom_stem.png"}},
{"y", 0.1}, {"y", 0.5},
{"text", "You can get more mushrooms by using a hellrack soil:\n".. {"text", "You can get more mushrooms by using a hellrack soil:"},
"1. search a dark place and, if necessary, place hellrack with air about it\n".. {"text", " 1. search a dark place and, if necessary, place hellrack with air about it,"},
"2. right click with cooked blood onto the hellrack to make it soiled\n".. {"text", " 2. right click with cooked blood onto the hellrack to make it soiled,"},
"3. right click onto the hellrack soil with a hell mushroom head to add some spores\n".. {"text", " 3. right click onto the hellrack soil with a hell mushroom head to add some spores,"},
"4. dig the mushroom which grew after some time to make place for another one"}, {"text", " 4. dig the mushroom which grew after some time to make place for another one."},
{"image", {1, 1, "riesenpilz_nether_shroom_side.png", 6, 0.12}}, {"image", {1, 1, "riesenpilz_nether_shroom_side.png", 5.4}},
{"y", 1}, {"y", 1},
{"image", {1, 1, "hell_hellrack.png^hell_hellrack_soil.png", 1.8}}, {"image", {1, 1, "hell_hellrack.png^hell_hellrack_soil.png", 1.8}},
{"image", {1, 1, "hell_hotbed.png", 1.3, -0.4}}, {"image", {1, 1, "hell_hotbed.png", 1.3, -0.832}},
{"image", {1, 1, "hell_hellrack.png^hell_hellrack_soil.png", 3.6}}, {"image", {1, 1, "hell_hellrack.png^hell_hellrack_soil.png", 3.6}},
{"image", {1, 1, "hell_shroom_top.png", 3.1, -0.5}}, {"image", {1, 1, "hell_shroom_top.png", 3.1, -0.664}},
{"image", {1, 1, "hell_hellrack.png^hell_hellrack_soil.png", 6}}, {"image", {1, 1, "hell_hellrack.png^hell_hellrack_soil.png", 5.4}},
{"image", {1, 1, "hell_hellrack.png"}}, {"image", {1, 1, "hell_hellrack.png"}},
{"y", 0.5},
}, },
{ {
description = "Tools", description = "Tools",
{"text", "You can craft 5 kinds of tools in the hell,\n".. {"text", "You can craft 5 kinds of tools in the hell, which (except the mushroom pick) require sticks to be crafted:"},
"which (except the mushroom pick) require sticks to be crafted:"},
{"image", {1, 1, "hell_pick_mushroom.png"}}, {"image", {1, 1, "hell_pick_mushroom.png"}},
{"y", 0.1}, {"y", 0.1},
{"text", "strength : 1\n".. {"text", "strength : 1"},
"The mushroom pick needs mushroom stems and heads to be crafted."}, {"text", "The mushroom pick needs mushroom stems and heads to be crafted."},
{"image", {1, 1, "hell_pick_wood.png"}}, {"image", {1, 1, "hell_pick_wood.png"}},
{"y", 0.1}, {"y", 0.1},
{"text", "strength : 2\n".. {"text", "strength : 2"},
"The hell wood pick can be crafted with cooked hell blood wood."}, {"text", "The hell wood pick can be crafted with cooked hell blood wood."},
{"image", {1, 1, "hell_axe_hellrack.png", 1.5}}, {"image", {1, 1, "hell_axe_hellrack.png", 1.5}},
{"image", {1, 1, "hell_shovel_hellrack.png", 3}}, {"image", {1, 1, "hell_shovel_hellrack.png", 3}},
{"image", {1, 1, "hell_sword_hellrack.png", 4.5}}, {"image", {1, 1, "hell_sword_hellrack.png", 4.5}},
{"image", {1, 1, "hell_pick_hellrack.png"}}, {"image", {1, 1, "hell_pick_hellrack.png"}},
{"y", 0.1}, {"y", 0.1},
{"text", "strength : 3\n".. {"text", "strength : 3"},
"The red hellrack tools can be crafted with usual hellrack."}, {"text", "The red hellrack tools can be crafted with usual hellrack."},
{"image", {1, 1, "hell_axe_hellrack_blue.png", 1.5}}, {"image", {1, 1, "hell_axe_hellrack_blue.png", 1.5}},
{"image", {1, 1, "hell_shovel_hellrack_blue.png", 3}}, {"image", {1, 1, "hell_shovel_hellrack_blue.png", 3}},
{"image", {1, 1, "hell_sword_hellrack_blue.png", 4.5}}, {"image", {1, 1, "hell_sword_hellrack_blue.png", 4.5}},
{"image", {1, 1, "hell_pick_hellrack_blue.png"}}, {"image", {1, 1, "hell_pick_hellrack_blue.png"}},
{"y", 0.1}, {"y", 0.1},
{"text", "strength : 3\n".. {"text", "strength : 3"},
"The blue hellrack tools can be crafted with blue hellrack."}, {"text", "The blue hellrack tools can be crafted with blue hellrack."},
{"image", {1, 1, "hell_axe_white.png", 1.5}}, {"image", {1, 1, "hell_axe_white.png", 1.5}},
{"image", {1, 1, "hell_shovel_white.png", 3}}, {"image", {1, 1, "hell_shovel_white.png", 3}},
{"image", {1, 1, "hell_sword_white.png", 4.5}}, {"image", {1, 1, "hell_sword_white.png", 4.5}},
{"image", {1, 1, "hell_pick_white.png"}}, {"image", {1, 1, "hell_pick_white.png"}},
{"y", 0.1}, {"y", 0.1},
{"text", "strength : 3\n".. {"text", "strength : 3"},
"The siwtonic tools can be crafted with the siwtonic ore."}, {"text", "The siwtonic tools can be crafted with the siwtonic ore."},
{"y", 0.5},
}, },
{ {
description = "Blood structures", description = "Blood structures",
{"text", "You can find blood structures on the ground and\n".. {"text", "You can find blood structures on the ground and dig their nodes even with the bare hand."},
"dig their nodes even with the bare hand."}, {"text", "One contains 4 kinds of blocks:"},
{"y", 0.5},
{"text", "One contains 4 kinds of blocks :"},
{"image", {1, 1, cube("hell_blood.png"), 1}}, {"image", {1, 1, cube("hell_blood.png"), 1}},
{"image", {1, 1, {"image", {1, 1,
cube("hell_blood_top.png", "hell_blood.png^hell_blood_side.png", "hell_blood.png^hell_blood_side.png"), cube("hell_blood_top.png", "hell_blood.png^hell_blood_side.png", "hell_blood.png^hell_blood_side.png"),
2}}, 2}},
{"image", {1, 1, "hell_fruit.png", 3}}, {"image", {1, 1, "hell_fruit.png", 3}},
{"image", {1, 1, cube("hell_blood_stem_top.png", "hell_blood_stem.png", "hell_blood_stem.png")}}, {"image", {1, 1, cube("hell_blood_stem_top.png", "hell_blood_stem.png", "hell_blood_stem.png")}},
{"y", 0.1}, {"y", 0.168},
{"text", "Blood stem, blood, blood head and hell fruit"}, {"text", "Blood stem, blood, blood head and hell fruit."},
{"y", 0.1}, {"text", "You can craft 4 blood wood with the stem:"},
{"text", "You can craft 4 blood wood with the stem :"},
{"image", {1, 1, cube("hell_wood.png")}}, {"image", {1, 1, cube("hell_wood.png")}},
{"y", 0.1}, {"y", 0.168},
{"text", "The 4 blood nodes can be cooked and, except\n".. {"text", "The 4 blood nodes can be cooked and, except blood wood, their blood can be extracted."},
"blood wood, their blood can be extracted."}, {"y", 0.5},
}, },
{ {
description = "Fruits", description = "Fruits",
{"text", "You can find the hell fruits on blood structures\n".. {"text", "You can find the hell fruits on blood structures and dig them even with the bare hand."},
"and dig them even with the bare hand."},
{"image", {1, 1, "hell_fruit.png"}}, {"image", {1, 1, "hell_fruit.png"}},
{"text", "Eating it will make you lose life but\n".. {"text", "Eating it will make you lose life but it might feed you and give you blood:"},
"it might feed you and give you blood :"},
{"image", {1, 1, "hell_blood_extracted.png"}}, {"image", {1, 1, "hell_blood_extracted.png"}},
{"y", 0.2}, {"y", 0.168},
{"text", "If you eat it at the right place inside a portal,\n".. {"text", "If you eat it at the right place inside a portal, you will teleport instead of getting blood."},
"you will teleport instead of getting blood."}, {"y", 0.168},
{"y", 0.2}, {"text", "If you drop it without holding the fast key, you can split it into its fruit and leaf:"},
{"text", "If you drop it without holding the fast key,\n"..
"you can split it into its fruit and leaf:"},
{"image", {1, 1, "hell_fruit_leaf.png", 1}}, {"image", {1, 1, "hell_fruit_leaf.png", 1}},
{"image", {1, 1, "hell_fruit_no_leaf.png"}}, {"image", {1, 1, "hell_fruit_no_leaf.png"}},
{"y", 0.2}, {"y", 0.168},
{"text", "Craft a fruit leave block out of 9 fruit leaves\n".. {"text", "Craft a fruit leave block out of 9 fruit leaves and the fruit can be used to craft a hell pearl."},
"The fruit can be used to craft a hell pearl."},
{"image", {1, 1, cube("hell_fruit_leaves.png")}}, {"image", {1, 1, cube("hell_fruit_leaves.png")}},
{"y", 0.2}, {"y", 0.168},
{"text", "A fruit leaves block"}, {"text", "A fruit leaves block."},
}, },
{ {
description = "Cooking", description = "Cooking",
{"text", "To get a furnace you need to dig at least 8 hellrack bricks.\n".. {"text", "To get a furnace you need to dig at least 8 hellrack bricks. They can be found at pyramid like constructions and require at least a strength 1 hell pick to be dug. To craft the furnace, use the hellrack bricks like cobble:"},
"They can be found at pyramid like constructions and require at least\n"..
"a strength 1 hell pick to be dug.\n"..
"To craft the furnace, use the hellrack bricks like cobble:"},
{"image", {0.5, 0.5, cube("hell_hellrack_brick.png"), 0.5}}, {"image", {0.5, 0.5, cube("hell_hellrack_brick.png"), 0.5}},
{"image", {0.5, 0.5, cube("hell_hellrack_brick.png"), 1}}, {"image", {0.5, 0.5, cube("hell_hellrack_brick.png"), 1}},
{"image", {0.5, 0.5, cube("hell_hellrack_brick.png")}}, {"image", {0.5, 0.5, cube("hell_hellrack_brick.png")}},
@ -118,10 +107,8 @@ local guide_infos = {
{"image", {0.5, 0.5, cube("hell_hellrack_brick.png"), 0.5}}, {"image", {0.5, 0.5, cube("hell_hellrack_brick.png"), 0.5}},
{"image", {0.5, 0.5, cube("hell_hellrack_brick.png"), 1}}, {"image", {0.5, 0.5, cube("hell_hellrack_brick.png"), 1}},
{"image", {0.5, 0.5, cube("hell_hellrack_brick.png")}}, {"image", {0.5, 0.5, cube("hell_hellrack_brick.png")}},
{"y", 0.2}, {"y", 0.168},
{"text", "To begin cooking stuff, you can use a mushroom or fruit.\n".. {"text", "To begin cooking stuff, you can use a mushroom or fruit. After that it's recommended to use cooked blood nodes."},
"After that it's recommended to use cooked blood nodes."},
{"y", 0.1},
{"text", "Some hell items can be cooked:"}, {"text", "Some hell items can be cooked:"},
{"image", {1, 1, cube("hell_blood_stem_top_cooked.png", "hell_blood_stem_cooked.png", "hell_blood_stem_cooked.png"), 0.35}}, {"image", {1, 1, cube("hell_blood_stem_top_cooked.png", "hell_blood_stem_cooked.png", "hell_blood_stem_cooked.png"), 0.35}},
{"image", {1, 1, cube("hell_blood_cooked.png"), 1.6}}, {"image", {1, 1, cube("hell_blood_cooked.png"), 1.6}},
@ -130,17 +117,16 @@ local guide_infos = {
2.9}}, 2.9}},
{"image", {1, 1, cube("hell_wood_cooked.png"), 4.3}}, {"image", {1, 1, cube("hell_wood_cooked.png"), 4.3}},
{"y", 1.2}, {"y", 1.2},
{"text", "Some cooked blood stem, cooked blood,\n".. {"text", "Some cooked blood stem, cooked blood, cooked blood head and cooked blood wood."},
"cooked blood head and cooked blood wood,"},
{"image", {1, 1, "hell_hotbed.png", 0.3}}, {"image", {1, 1, "hell_hotbed.png", 0.3}},
{"image", {1, 1, "hell_pearl.png", 2}}, {"image", {1, 1, "hell_pearl.png", 2}},
{"y", 1.2}, {"y", 1.168},
{"text", "Some cooked extracted blood and a hell pearl"}, {"text", "Some cooked extracted blood and a hell pearl."},
{"y", 0.5},
}, },
{ {
description = "Extractors", description = "Extractors",
{"text", "Here you can find out information about the hell extractor."}, {"text", "Here you can find out information about the hell extractor."},
{"y", 0.2},
{"text", "Here you can see its craft recipe:"}, {"text", "Here you can see its craft recipe:"},
{"image", {0.5, 0.5, cube("hell_blood_top_cooked.png", "hell_blood_cooked.png^hell_blood_side_cooked.png", "hell_blood_cooked.png^hell_blood_side_cooked.png"), 0.5}}, {"image", {0.5, 0.5, cube("hell_blood_top_cooked.png", "hell_blood_cooked.png^hell_blood_side_cooked.png", "hell_blood_cooked.png^hell_blood_side_cooked.png"), 0.5}},
{"image", {0.5, 0.5, cube("hell_hellrack_brick.png"), 1}}, {"image", {0.5, 0.5, cube("hell_hellrack_brick.png"), 1}},
@ -153,15 +139,12 @@ local guide_infos = {
{"image", {0.5, 0.5, cube("hell_hellrack_brick.png"), 1}}, {"image", {0.5, 0.5, cube("hell_hellrack_brick.png"), 1}},
{"image", {0.5, 0.5, cube("hell_hellrack_brick.png")}}, {"image", {0.5, 0.5, cube("hell_hellrack_brick.png")}},
{"y", 0.2}, {"y", 0.2},
{"text", "Extract blood from the blood nodes you get from the blood structures.\n".. {"text", "Extract blood from the blood nodes you get from the blood structures. You can also get blood with a hell fruit."},
"You can also get blood with a hell fruit."}, {"text", "So you can use it:"},
{"y", 0.2}, {"text", " 1. place it somewhere,"},
{"text", "So you can use it:\n".. {"text", " 2. place blood blocks next to it (4 or less),"},
"1. place it somewhere\n".. {"text", " 3. right click with extracted blood onto it to power it,"},
"2. place blood blocks next to it (4 or less)\n".. {"text", " 4. take the new extracted blood and dig the extracted nodes."},
"3. right click with extracted blood onto it to power it\n"..
"4. take the new extracted blood and dig the extracted nodes"},
{"y", 0.2},
{"text", "Example (view from the top):"}, {"text", "Example (view from the top):"},
{"y", 0.88}, {"y", 0.88},
{"image", {1, 1, "hell_blood_stem_top.png", 0.82, -0.88}}, {"image", {1, 1, "hell_blood_stem_top.png", 0.82, -0.88}},
@ -174,133 +157,110 @@ local guide_infos = {
{"image", {1, 1, "hell_blood.png"}}, {"image", {1, 1, "hell_blood.png"}},
{"image", {1, 1, "hell_blood.png", 0.82, -0.12}}, {"image", {1, 1, "hell_blood.png", 0.82, -0.12}},
{"image", {1, 1, "hell_blood_empty.png", 3.82, -0.12}}, {"image", {1, 1, "hell_blood_empty.png", 3.82, -0.12}},
{"y", 1.2}, {"y", 1.168},
{"text", "The empty blood stem can be crafted into empty hell wood,\n".. {"text", "The empty blood stem can be crafted into empty hell wood, which can be crafted into hell sticks."},
"which can be crafted into hell sticks."}, {"y", 0.5},
}, },
{ {
description = "Ores", description = "Ores",
{"text", "You can find 5 types of ores:"}, {"text", "You can find 5 types of ores:"},
{"image", {1, 1, cube("hell_hellrack_black.png"), 4}}, {"image", {1, 1, cube("hell_hellrack_black.png"), 4}},
{"image", {1, 1, cube("hell_hellrack.png")}}, {"image", {1, 1, cube("hell_hellrack.png")}},
{"y", 0.2}, {"y", 0.168},
{"text", "The red hellrack is generated like stone.\n".. {"text", "The red hellrack is generated like stone. The black hellrack is generated like gravel. Both require at least a strength 2 hell pick to be dug."},
"The black hellrack is generated like gravel.\n"..
"Both require at least a strength 2 hell pick to be dug."},
{"image", {1, 1, cube("hell_white.png"), 4}}, {"image", {1, 1, cube("hell_white.png"), 4}},
{"image", {1, 1, cube("hell_hellrack_blue.png")}}, {"image", {1, 1, cube("hell_hellrack_blue.png")}},
{"y", 0.2}, {"y", 0.168},
{"text", "The blue hellrack is generated like diamond ore.\n".. {"text", "The blue hellrack is generated like diamond ore. The siwtonic ore is generated like mese blocks. Both require at least a strength 3 hell pick to be dug."},
"The siwtonic ore is generated like mese blocks.\n"..
"Both require at least a strength 3 hell pick to be dug."},
{"image", {1, 1, cube("hell_hellrack_tiled.png"), 4}}, {"image", {1, 1, cube("hell_hellrack_tiled.png"), 4}},
{"image", {1, 1, cube("glow_stone.png")}}, {"image", {1, 1, cube("glow_stone.png")}},
{"y", 0.2}, {"y", 0.168},
{"text", "Glow stone can be used for lighting.\n".. {"text", "Glow stone can be used for lighting. Tiled hellrack is generated like coal ore. Glow stone requires at least a strength 1 pick to be dug. Dig tiled hellrack with at least a level 2 pickaxe."},
"Tiled hellrack is generated like coal ore.\n".. {"y", 0.5},
"Glow stone requires at least a strength 1 pick to be dug.\n"..
"Dig tiled hellrack with at least a level 2 pickaxe."},
}, },
{ {
description = "Vines", description = "Vines",
{"text", "Feed hell vines with blood.\n".. {"text", "Feed hell vines with blood. Dig them with anything."},
"Dig them with anything."},
{"image", {1, 1, "hell_vine.png"}}, {"image", {1, 1, "hell_vine.png"}},
{"y", 0.2}, {"text", "Grow hell child by placing it to a dark place onto a blood structure head node."},
{"text", "Grow hell child by placing\n"..
"placing it to a dark place onto a\n"..
"blood structure head node."},
{"image", {1, 1, "hell_sapling.png"}}, {"image", {1, 1, "hell_sapling.png"}},
{"y", -0.10}, {"y", -0.10},
{"image", {1, 1, "hell_blood.png^hell_blood_side.png"}}, {"image", {1, 1, "hell_blood.png^hell_blood_side.png"}},
}, },
{ {
description = "Pearls", description = "Pearls",
{"text", "The hell pearl can be used to teleport by throwing it.\n".. {"text", "The hell pearl can be used to teleport by throwing it. Here is how to get one:"},
"Here is how to get one :"}, {"text", "First of all craft 2 mushroom heads and 1 hell fruit without leaf together:"},
{"y", 0.2},
{"text", "First of all craft 2 mushroom heads and 1 hell fruit\n"..
"without leaf together :"},
{"image", {1, 1, "hell_shroom_top.png"}}, {"image", {1, 1, "hell_shroom_top.png"}},
{"image", {1, 1, "hell_fim.png", 3}}, {"image", {1, 1, "hell_fim.png", 3}},
{"image", {1, 1, "hell_fruit_no_leaf.png"}}, {"image", {1, 1, "hell_fruit_no_leaf.png"}},
{"image", {1, 1, "hell_shroom_top.png"}}, {"image", {1, 1, "hell_shroom_top.png"}},
{"y", 0.2}, {"y", 0.168},
{"text", "Put the result into the furnace\n".. {"text", "Put the result into the furnace to cook it into a hell pearl:"},
"to cook it into a hell pearl :"},
{"image", {1, 1, "hell_pearl.png"}}, {"image", {1, 1, "hell_pearl.png"}},
}, },
{ {
description = "Bricks", description = "Bricks",
{"text", "Craft bricks out of red,\n".. {"text", "Craft bricks out of red, black and blue hellrack."},
"black and blue hellrack."},
{"image", {1, 1, cube("hell_hellrack_brick_black.png"), 1}}, {"image", {1, 1, cube("hell_hellrack_brick_black.png"), 1}},
{"image", {1, 1, cube("hell_hellrack_brick_blue.png"), 2}}, {"image", {1, 1, cube("hell_hellrack_brick_blue.png"), 2}},
{"image", {1, 1, cube("hell_hellrack_brick.png")}}, {"image", {1, 1, cube("hell_hellrack_brick.png")}},
{"y", 0.4}, {"y", 0.168},
{"text", "Dig them with at least a level 1 pickaxe."}, {"text", "Dig them with at least a level 1 pickaxe."},
{"y", 0.2}, {"y", 0.5},
}, },
{ {
description = "Portals", description = "Portals",
{"text", "Here you can find out how to built the hell portal."}, {"text", "Here you can find out how to build the hell portal."},
{"y", 0.3},
{"text", "A hell portal requires following nodes:"}, {"text", "A hell portal requires following nodes:"},
{"y", 0.05}, {"text", " - 25 empty hell wooden planks,"},
{"text", "25 empty hell wooden planks\n".. {"text", " - 16 black hellrack,"},
"16 black hellrack\n".. {"text", " - 12 blue hellrack bricks,"},
"12 blue hellrack bricks\n".. {"text", " - 8 red hellrack,"},
"8 red hellrack\n".. {"text", " - 8 cooked hell blood,"},
"8 cooked hell blood\n".. {"text", " - 4 hell fruits,"},
"4 hell fruits\n".. {"text", " - 2 siwtonic blocks."},
"2 siwtonic blocks"},
{"y", 0.2},
{"text", "It should look approximately like this one:"}, {"text", "It should look approximately like this one:"},
{"image", {5.625, 6, "hell_teleporter.png", 0, -1.5}}, {"image", {5.625, 6, "hell_teleporter.png", 5, -0.5}},
{"y", 5.5}, {"y", 6},
{"text", "Activate it by standing in the middle,\n".. {"text", "Activate it by standing in the middle, on the siwtonic block and eating a hell fruit. Take enough stuff with you to build a portal when you'll come back."},
"on the siwtonic block and eating a hell fruit.\n".. {"y", 0.5},
"Take enough stuff with you to build a portal when you'll come back."},
}, },
{ {
description = "Forests", description = "Forests",
{"text", "The hell forest is generated in caves,\n".. {"text", "The hell forest is generated in caves, above the usual hell."},
"above the usual hell."},
{"y", 0.2},
{"text", "There you can find some plants:"}, {"text", "There you can find some plants:"},
{"image", {1, 1, "hell_grass_middle.png", 1}}, {"image", {1, 1, "hell_grass_middle.png", 1}},
{"image", {1, 1, "hell_grass_big.png", 2}}, {"image", {1, 1, "hell_grass_big.png", 2}},
{"image", {1, 1, "hell_grass_small.png"}}, {"image", {1, 1, "hell_grass_small.png"}},
{"y", 0.2}, {"y", 0.168},
{"text", "Use the hell forest grass to get paper.\n".. {"text", "Use the hell forest grass to get paper. Craft paper out of the dried grass."},
"Craft paper out of the dried grass."},
{"image", {1, 1, cube("hell_tree_top.png", "hell_tree.png", "hell_tree.png")}}, {"image", {1, 1, cube("hell_tree_top.png", "hell_tree.png", "hell_tree.png")}},
{"y", 0.2}, {"y", 0.168},
{"text", "Hell trunks can be found at hell trees.\n".. {"text", "Hell trunks can be found at hell trees. Craft hell wood out of hell trunk."},
"Craft hell wood out of hell trunk."},
{"image", {1, 1, "hell_glowflower.png"}}, {"image", {1, 1, "hell_glowflower.png"}},
{"y", 0.2}, {"y", 0.168},
{"text", "Use it for lighting and decoration."}, {"text", "Use it for lighting and decoration."},
}, },
} }
-- the size of guide pages -- the size of guide pages
local guide_size = {x=40, y=10, cx=0.2, cy=0.2} local guide_size = {x=12, y=3, cx=0.2, cy=0.25}
-- informations about settings and ... -- informations about settings and ...
local formspec_offset = {x=0.25, y=0.50} local formspec_offset = {x=0.375, y=0.375}
local font_size local font_size
if minetest.is_singleplayer() then if minetest.is_singleplayer() then
font_size = tonumber(minetest.settings:get("font_size")) or 13 font_size = tonumber(minetest.settings:get("font_size")) or 13
else else
font_size = 13 font_size = 13
end end
guide_size.fx = math.floor((40*(guide_size.cx+formspec_offset.x))*font_size) guide_size.fx = math.floor(((guide_size.x-1) * (guide_size.cx+formspec_offset.x)) * font_size)
guide_size.fy = font_size/40 guide_size.fy = font_size/40
-- the default guide formspecs -- the default guide formspecs
local guide_forms = { local guide_forms = {
contents = "size[3.6,"..(#guide_infos)-2 ..";]label["..guide_size.cx+0.7 ..","..guide_size.cy+0.2 ..";Contents:]", contents = "size[3.6,"..(#guide_infos)-2 ..";]label["..guide_size.cx+0.7 ..","..guide_size.cy ..";Contents:]",
} }
-- change the infos to formspecs -- change the infos to formspecs
@ -318,7 +278,7 @@ for n,data in ipairs(guide_infos) do
local tab = minetest.wrap_text(content, guide_size.fx, true) local tab = minetest.wrap_text(content, guide_size.fx, true)
local l = guide_size.cx local l = guide_size.cx
for _,str in ipairs(tab) do for _,str in ipairs(tab) do
form = form.."label["..guide_size.cx ..","..guide_size.cy+y..";"..str.."]" form = form.."label["..formspec_offset.x ..","..formspec_offset.y+y..";"..str.."]"
y = y+guide_size.fy y = y+guide_size.fy
l = math.max(l, #str) l = math.max(l, #str)
end end
@ -326,18 +286,18 @@ for n,data in ipairs(guide_infos) do
elseif typ == "image" then elseif typ == "image" then
local w, h, texture_name, px, py = unpack(content) local w, h, texture_name, px, py = unpack(content)
if not px then if not px then
form = form.."image["..guide_size.cx..","..guide_size.cy+y+h*0.3 ..";"..w..","..h..";"..texture_name.."]" form = form.."image["..formspec_offset.x..","..formspec_offset.y+y ..";"..w..","..h..";"..texture_name.."]"
y = y+h y = y+h
else else
px = guide_size.cx+px px = formspec_offset.x+px
py = py or 0 py = py or 0
form = form.."image["..px..",".. form = form.."image["..px..","..
guide_size.cy+y+h*0.3+py ..";"..w..","..h..";"..texture_name.."]" formspec_offset.y+y+py ..";"..w..","..h..";"..texture_name.."]"
x = math.max(x, px+w) x = math.max(x, px+w)
end end
end end
end end
form = "size["..x*1.8 ..","..y+1 ..";]"..form.."button["..x/2-0.5 ..","..y ..";1,2;quit;Back]" form = "size["..guide_size.x..","..y+1 ..";]real_coordinates[true]"..form.."button["..guide_size.x/2-0.6 ..","..y ..";1.2,0.8;quit;Back]"
guide_forms[n] = {data.description, form} guide_forms[n] = {data.description, form}
end end