state_reset_menu=klass() function state_reset_menu:init(prior_menu) self.prior_menu=prior_menu self.options="⬅️➡️⬆️⬇️🅾️" self.code={} self.code_i=1 for i=1,5 do local i=flr(rnd(#self.options)) add(self.code,i) end end function state_reset_menu:enter() end function state_reset_menu:exit(new_top) end function state_reset_menu:reenter() end function state_reset_menu:suspend() end function state_reset_menu:update() for o=0,5 do if btnp(o) then if self.code_i>#self.code then run() end if self.code[self.code_i]==o then sounds:dire() self.code_i+=1 if (self.code_i>#self.code) completion_tracker:reset() else self.done=true end return end end end function state_reset_menu:caption() if (self.code_i > #self.code) return "savedata reset!" local caption="to reset your\nsavedata, type\nthis code\n\n" local code="\f7" for i=1,#self.code do local o=self.code[i]+1 local c=sub(self.options,o,o) if (i-1=self.code_i) code..="\ff" if (i!=1) code..=" " code..=c end return caption..code end function state_reset_menu:draw() self.prior_menu:draw() local caption=self:caption() local w,h=measure_text(caption) h-=1 local x=64-w\2 local y=64-h\2 rect(x-2,y-2,x+w+1,y+h+1,15) rectfill(x-1,y-1,x+w,y+h,4) print(caption,x,y,15) end