MiniDoom

src/console_ui.ml

Owns console animation, history, input capture, scrolling, and drawing while delegating command execution.

Package
(global)
Reachable
Yes

Imports

Declarations

_CUI_Abs

inline function _CUI_Abs(v)

Returns a non-negative animation distance.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

_cui_anim_duration

_cui_anim_duration

Tracks the mutable cui anim duration value used by the console ui subsystem.

View source

_cui_anim_start_height

_cui_anim_start_height

Tracks the mutable cui anim start height value used by the console ui subsystem.

View source

_cui_anim_started

_cui_anim_started

Tracks the mutable cui anim started value used by the console ui subsystem.

View source

_cui_anim_target_height

_cui_anim_target_height

Tracks the mutable cui anim target height value used by the console ui subsystem.

View source

_CUI_DrawFPS

function _CUI_DrawFPS(y)

Reuses one text widget until the sampled FPS changes, keeping the closed-console overlay inexpensive.

ParameterTypeDefaultDescription
ydynamic—Vertical map- or screen-space coordinate.

View source

_CUI_DrawText

function _CUI_DrawText(x, y, text, cursor)

Draws one clipped STCFN text line at logical coordinates with an optional underscore cursor.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.
textdynamic—Text to process.
cursordynamic—Cursor value supplied to `_CUI_DrawText`.

View source

_cui_font

_cui_font

Stores the cui font collection used by the console ui subsystem.

View source

_cui_font_start

_cui_font_start

Tracks the mutable cui font start value used by the console ui subsystem.

View source

_cui_fps_line

_cui_fps_line

Holds the optional cui fps line resource used by the console ui subsystem.

View source

_cui_fps_value

_cui_fps_value

Tracks the mutable cui fps value value used by the console ui subsystem.

View source

_cui_height

_cui_height

Tracks the mutable cui height value used by the console ui subsystem.

View source

_cui_history

_cui_history

Stores the cui history collection used by the console ui subsystem.

View source

_cui_history_pos

_cui_history_pos

Tracks the mutable cui history pos value used by the console ui subsystem.

View source

_CUI_HistoryDown

function _CUI_HistoryDown()

Loads the following submitted command or returns to a blank newest entry.

View source

_CUI_HistoryUp

function _CUI_HistoryUp()

Loads the preceding submitted command into the editable line.

View source

_CUI_IDiv

inline function _CUI_IDiv(a, b)

Divides animation integers with truncation toward zero and a safe zero-divisor fallback.

ParameterTypeDefaultDescription
adynamic—First input operand.
bdynamic—Second input operand.

View source

_cui_initialized

_cui_initialized

Tracks whether cui initialized is active in the console ui subsystem.

View source

_cui_input

_cui_input

Stores the mutable cui input text used by the console ui subsystem.

View source

_cui_log

_cui_log

Stores the cui log collection used by the console ui subsystem.

View source

_CUI_MaxScroll

inline function _CUI_MaxScroll()

Computes the oldest valid viewport offset for the fixed visible line count.

View source

_cui_pause_owned

_cui_pause_owned

Tracks whether cui pause owned is active in the console ui subsystem.

View source

_cui_pause_restore

_cui_pause_restore

Tracks whether cui pause restore is active in the console ui subsystem.

View source

_CUI_RecordHistory

function _CUI_RecordHistory(command)

Adds one submitted command to bounded navigation history, avoiding adjacent duplicates.

ParameterTypeDefaultDescription
commanddynamic—Command value supplied to `_CUI_RecordHistory`.

View source

_CUI_ReleasePause

function _CUI_ReleasePause()

Restores the pause state that existed before the console began capturing input.

View source

_cui_scroll

_cui_scroll

Tracks the mutable cui scroll value used by the console ui subsystem.

View source

_CUI_SetInput

function _CUI_SetInput(text)

Replaces the editable command text with a bounded history entry.

ParameterTypeDefaultDescription
textdynamic—Text to process.

View source

_cui_shift_down

_cui_shift_down

Tracks whether cui shift down is active in the console ui subsystem.

View source

_CUI_Submit

function _CUI_Submit()

Sends the current line across the parser boundary and applies only the returned UI requests.

View source

_CUI_UpdateAnimation

function _CUI_UpdateAnimation()

Advances the time-based slide and releases the owned pause only after the closing panel fully exits.

View source

_cui_wanted_open

_cui_wanted_open

Tracks whether cui wanted open is active in the console ui subsystem.

View source

CUI_ANIMATION_MS

const CUI_ANIMATION_MS = 200

Defines cui animation ms for the console ui subsystem.

View source

CUI_BACKGROUND_COLOR

const CUI_BACKGROUND_COLOR = 0

Defines the Doom palette selection for cui background color.

View source

CUI_BORDER_COLOR

const CUI_BORDER_COLOR = 176

Defines the Doom palette selection for cui border color.

View source

CUI_ClearLog

function CUI_ClearLog()

Clears console scrollback without altering command history or current input.

View source

CUI_Drawer

function CUI_Drawer()

Renders the animated translucent panel, scrollback, separator, input line, and optional FPS counter.

View source

CUI_Init

function CUI_Init()

Initializes bounded console collections and seeds the first informational log line exactly once.

View source

CUI_IsCapturing

function CUI_IsCapturing()

Reports whether visible or animating console UI must consume all gameplay input.

View source

CUI_LINE_STEP

const CUI_LINE_STEP = 9

Defines cui line step for the console ui subsystem.

View source

CUI_Log

function CUI_Log(message)

Splits and appends chronological system, error, chat, or command text to bounded scrollback.

ParameterTypeDefaultDescription
messagedynamic—Message text or payload to process.

View source

CUI_MAX_HISTORY

const CUI_MAX_HISTORY = 32

Defines the maximum cui max history accepted by the console ui subsystem.

View source

CUI_MAX_INPUT

const CUI_MAX_INPUT = 60

Defines the maximum cui max input accepted by the console ui subsystem.

View source

CUI_MAX_LOG_LINES

const CUI_MAX_LOG_LINES = 256

Defines the maximum cui max log lines accepted by the console ui subsystem.

View source

CUI_PANEL_HEIGHT

const CUI_PANEL_HEIGHT = 68

Defines cui panel height for the console ui subsystem.

View source

CUI_Responder

function CUI_Responder(ev)

Toggles on tilde/O-umlaut, edits commands, scrolls output, and consumes every event while captured.

ParameterTypeDefaultDescription
evdynamic—Input event to process.

View source

CUI_SetFont

function CUI_SetFont(font, startchar)

Receives the already cached STCFN HUD font so console text exactly matches one-line game messages.

ParameterTypeDefaultDescription
fontdynamic—Font value supplied to `CUI_SetFont`.
startchardynamic—Startchar value supplied to `CUI_SetFont`.

View source

CUI_SetOpen

function CUI_SetOpen(openConsole)

Starts a reversible constant-speed slide and acquires or eventually restores the gameplay pause.

ParameterTypeDefaultDescription
openConsoledynamic—Open console value supplied to `CUI_SetOpen`.

View source

CUI_Toggle

function CUI_Toggle()

Reverses the current console target while preserving in-flight animation continuity.

View source

CUI_VISIBLE_LINES

const CUI_VISIBLE_LINES = 5

Defines cui visible lines for the console ui subsystem.

View source