Each page is now a self-contained module with a configure(tui) class method. Shared helpers live in TUIHelpers. bbs.rb is reduced to constants, chrome, and wiring. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
844 B
Ruby
31 lines
844 B
Ruby
# frozen_string_literal: true
|
|
|
|
module IdlePage
|
|
def self.configure(tui)
|
|
tui.page :idle do
|
|
enter { @page_title = 'TELETYPE BBS' }
|
|
|
|
render do
|
|
text 'Navigate the menu with ↑↓, select with Enter.',
|
|
x: CONT_X, y: CONT_Y + cont_h / 2, style: THEME[:normal]
|
|
end
|
|
|
|
nav :menu, size: MENU_ITEMS.size
|
|
key(:enter) do
|
|
case MENU_ITEMS[@menu_sel]
|
|
when 'Messages' then go :messages
|
|
when 'Post Message' then go :new_msg
|
|
when 'Blog Posts' then go :blog
|
|
when 'HowTo Guides' then go :howto
|
|
when 'Game Catalog' then go :games
|
|
when 'Online Users' then go :online
|
|
when 'System Info' then go :sysinfo
|
|
when 'Exit' then :halt
|
|
end
|
|
end
|
|
key('q') { :halt }
|
|
key(:escape) { :halt }
|
|
end
|
|
end
|
|
end
|