Add a tips page

This commit is contained in:
Pyrex 2024-02-14 17:51:57 -08:00
parent 184ce112bd
commit 55eb61825e
3 changed files with 34 additions and 14 deletions

View File

@ -1,5 +1,6 @@
state_archaeology=klass()
function state_archaeology:init()
function state_archaeology:init(tips_mode)
self.tips_mode=tips_mode
self.n_holy_books=#liturgy.holy_book
self:select_book(1)
end
@ -11,6 +12,7 @@ function state_archaeology:suspend() end
function state_archaeology:select_book(n)
self.selection=n
if (self.tips_mode) self.title="tips" self.full_text=archaeology_tips return
local lines={}
local hb=liturgy.holy_book[self.selection]
self.title=hb[1]
@ -68,7 +70,25 @@ function state_archaeology:draw()
line(tx,y,tx+tw-1,y,15)
y+=2
if not self.tips_mode then
print("⬅️",tx,y)
print("➡️",tx+tw-7,y)
end
print("❎ go back",1,122,15)
end
archaeology_tips=[[
wise archaeologists know these
secrets:
- hold to get a new board.
- hold 🅾 to pick up more than
one card.
- updates and other games by
pyrex and nyeo are
available at nyeogmi.itch.io
and lexaloffle.
only diligent research can
uncover sacred mysteries!
- p & n]]

View File

@ -2,13 +2,14 @@ state_menu=klass()
function state_menu:init()
self.selection=1
self.frame=0
local function plain_opt(n,s,a)
return menu_option:new(function() return n end,function()
main.state_manager:push(s:new(a))
end)
end
self.options={
menu_option:new(function() return "excavate" end,function()
main.state_manager:push(state_excavate_menu:new(self))
end),
menu_option:new(function() return "archaeology" end,function()
main.state_manager:push(state_archaeology:new())
end),
plain_opt("excavate",state_excavate_menu,self),
plain_opt("archaeology",state_archaeology),
menu_option:new(),
menu_option:new(function()
local pref=completion_tracker:get_music_preference()
@ -17,9 +18,8 @@ function state_menu:init()
end,function()
completion_tracker:set_music_preference(not completion_tracker:get_music_preference())
end),
menu_option:new(function() return "reset data" end,function()
main.state_manager:push(state_reset_menu:new(self))
end)
plain_opt("reset data",state_reset_menu,self),
plain_opt("tips",state_archaeology,true)
}
end
function state_menu:enter() end

View File

@ -12,7 +12,7 @@ function state_wonround:enter()
sounds:win()
completion_tracker:mark_seen(self.verse_id)
completion_tracker:advance_completion_level(self.board:get_completion_level())
if (self.board.watcher:allow_tips()) self.tip=deli(_won_round_tips,1)
if (self.board.watcher:allow_tips()) self.tip=deli(_won_round_tips,1) add(_won_round_tips,self.tip)
end
function state_wonround:exit(new_top) end