From 8df7a679080c7d0e7724fe0456c8d8c59ef378b6 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 27 Nov 2024 12:57:41 +0100 Subject: [PATCH] Write out list of all area names --- mods/tutorial_areas/areas_list.lua | 29 +++++++++++++++++++++++++++++ mods/tutorial_areas/internal.lua | 17 +++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 mods/tutorial_areas/areas_list.lua diff --git a/mods/tutorial_areas/areas_list.lua b/mods/tutorial_areas/areas_list.lua new file mode 100644 index 0000000..2ee8fbe --- /dev/null +++ b/mods/tutorial_areas/areas_list.lua @@ -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 --- diff --git a/mods/tutorial_areas/internal.lua b/mods/tutorial_areas/internal.lua index fad89e9..46aa80d 100644 --- a/mods/tutorial_areas/internal.lua +++ b/mods/tutorial_areas/internal.lua @@ -1,3 +1,5 @@ +local PRINT_AREAS = true + -- Load the areas table from the save file function areas:load() 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 self.areas = {} 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() end