Aaron Suen 05d985c635 Expand hint system a bit
- Add reset command
- Reset alerts on resetting state
- Add option to hide hints
- Add option to add custom hint attrs
- Add option to pass in an already-fully-formed
  hint object and skip construction helpers
- Tidy up terrain hints a bit
2020-09-05 16:08:17 -04:00

26 lines
849 B
Lua

-- LUALOCALS < ---------------------------------------------------------
local minetest, next, nodecore, pairs
= minetest, next, nodecore, pairs
-- LUALOCALS > ---------------------------------------------------------
minetest.register_chatcommand("tabula", {
desciption = "Reset NodeCore hints",
params = "rasa",
func = function(name, param)
if param ~= "rasa" then
return false, "If you're sure you want to erase all hint"
.. "progress, use the command \"/tabula rasa\""
end
local db, player, pname, save = nodecore.get_player_discovered(name)
if not db then
return false, "Must be online to use this command"
end
while next(db) do db[next(db)] = nil end
for _, cb in pairs(nodecore.registered_on_discovers) do
cb(player, nil, pname, db)
end
save()
return true, "All hints reset"
end
})