Write out list of all area names

This commit is contained in:
Wuzzy 2024-11-27 12:57:41 +01:00
parent dd3a05bbff
commit 8df7a67908
2 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,29 @@
-- This file is not actually executed, it's just there
-- to provide the area names for the translation string collector.
-- To update this list, set PRINT_NAMES to true in internal.lua,
-- launch the tutorial and copy the list from the Luanti console
-- to here
local NS = function(s) return s end
--- LIST OF AREAS ---
NS("Start room")
NS("Jumping section")
NS("Pointing section")
NS("Using section")
NS("Inventory and Chests section")
NS("Comestibles section")
NS("Crafting and Tools section")
NS("Smelting section")
NS("Swimming section")
NS("Diving section")
NS("Waterfall section")
NS("Viscosity section")
NS("Health and Damage section")
NS("Climbing section")
NS("Mining section")
NS("Special Blocks section")
NS("Tutorial Mine")
NS("Building section")
NS("Sneaking section")
NS("Good-Bye room")
--- END OF LIST OF AREAS ---

View File

@ -1,3 +1,5 @@
local PRINT_AREAS = true
-- Load the areas table from the save file -- Load the areas table from the save file
function areas:load() function areas:load()
local file, err = io.open(minetest.get_modpath("tutorial_areas") .. "/areas.dat", "r") local file, err = io.open(minetest.get_modpath("tutorial_areas") .. "/areas.dat", "r")
@ -9,5 +11,20 @@ function areas:load()
if type(self.areas) ~= "table" then if type(self.areas) ~= "table" then
self.areas = {} self.areas = {}
end end
if PRINT_AREAS then
print('--- LIST OF AREAS: ---')
for a=1, #self.areas do
local area = self.areas[a]
if not area.hidden then
local name = area.name
if not area.name then
minetest.log("error", "[tutorial_areas] Area no. "..a.." doesn't have a name!")
break
end
print('NS("'..tostring(name)..'")')
end
end
print('--- END OF LIST OF AREAS ---')
end
file:close() file:close()
end end