Tips and option to disable them

Adds a more general way to handle gameplay tips, and adds
a boolean option "tips", which can be used to disable all
tips.  Adds a helpful longer message when the game goes
into the "farlook" mode.

Also adds a lua binding to easily show multi-line text
in a menu window.

Breaks save compat.
This commit is contained in:
Pasi Kallinen
2023-02-19 15:44:29 +02:00
parent 80842979aa
commit 5d659cf1f6
16 changed files with 131 additions and 16 deletions

View File

@@ -65,6 +65,19 @@ function mk_dgl_extrainfo()
end
end
-- Show a helpful tip when player first uses getpos()
function show_getpos_tip()
nh.text([[
Tip: Farlooking or selecting a map location
You are now in a "farlook" mode - the movement keys move the cursor,
not your character. Game time does not advance. This mode is used
to look around the map, or to select a location on it.
When in this mode, you can press ESC to return to normal game mode,
and pressing ? will show the key help.
]]);
end
-- Callback functions
nhcore = {
@@ -81,5 +94,8 @@ nhcore = {
-- game_exit is called when the game exits (quit, saved, ...)
-- game_exit = function() end,
-- getpos_tip is called the first time the code enters getpos()
getpos_tip = show_getpos_tip,
};