Skip to content

Code Entry Primary Flow Control

Damon Getsman edited this page Mar 11, 2015 · 6 revisions

ddoc.js

Notes

At first it was just the primary menu hooks and general flow loop that existed in this file, along with a couple of nasty globals. I'm starting to put the BBS navigation code (primarily for 'J'ump functionality, at this point) into here, we'll see what else might end up here in the future.

Layout

This one isn't too ate up, from the simplicity of what's been here so far. I'm doing my best to try to keep it clean as I go.

Current OO Structure of docIface

Properties

  • menu - for help access from the main menu
  • sprompt - prompt for saving messages

Methods

  • dDocException() - takes name, message, and errno parameters to be used with custom exception throwing
  • getChoice() - just a wrapper for console.getkey() at the moment
  • log_str_n_char() - nice little function to log a string explaining something (such as that we are at a 'read level' menu instead of primary, and then log the keystroke, as well
  • doMainMenu() - displays the main menu
Sub-Objects
  • nav - navigation functionality
  • util - general utility
nav Methods
  • setSub() - switches the different bbs and user properties/methods correctly to enable a room switch/jump
  • findNew() - scans through unzapped rooms and checks for new messages
  • jump() - switching to a new sub-board/room
  • skip() - disregards anything unread in the current room (no pointer modification), pulls a room list, moves to the next room in the list in a linear fashion
  • chk4Room() - searches to see if the substring passed exists in any room/sub-board description
util Methods
  • getRoomList() - passed true or false for whether confined, returns list of sub objects available
  • initDdoc() - passed true or false for whether confined, saves settings for restoration upon shell exit; this will be modified more based on user settings in upcoming versions
  • turnOffSynchronetDefaults() - simply turns off all of the 'garish' bitwise defaults leading one to a less DOC-ish experience
  • quitDdoc() - restores settings set in initDdoc()