More docs on MCI/views/theming

This commit is contained in:
Bryan Ashby
2020-11-22 15:35:04 -07:00
parent 8e8016d0fd
commit e7cb804ada
3 changed files with 90 additions and 34 deletions

View File

@@ -2,16 +2,26 @@
layout: page
title: MCI Codes
---
ENiGMA½ supports a variety of MCI codes. Some **predefined** codes produce information about the current user, system,
or other statistics while others are used to instantiate a **View**. MCI codes are two characters in length and are
prefixed with a percent (%) symbol. Some MCI codes have additional options that may be set directly from the code itself
while others -- and more advanced options -- are controlled via the current theme. Standard (non-focus) and focus colors
are set by placing duplicate codes back to back in art files.
## MCI Codes
ENiGMA½ supports a variety of MCI codes. Some **predefined** codes produce information about the current user, system, or other statistics while others are used to instantiate a **View**.
## Predefined MCI Codes
There are many predefined MCI codes that can be used anywhere on the system (placed in any art file). More are added all
the time so also check out [core/predefined_mci.js](https://github.com/NuSkooler/enigma-bbs/blob/master/core/mci_view_factory.js)
for a full listing. Many codes attempt to pay homage to Oblivion/2, iNiQUiTY, etc.
## General Information
MCI codes are composed of two characters and are prefixed with a percent (%) symbol.
:information_source: To explicitly tie a MCI to a specific View ID, suffix the MCI code with a number. For example: `%BN1`.
:information_source: Standard (non-focus) and focus colors are set by placing duplicate codes back to back in art files:
<font color="red">%BN1</font><font color="bright red">%BN1</font>
Some MCI codes have additional options that may be set directly from the code itself while others -- and more advanced options -- are controlled via the current theme.
## Relationship with Menus, Art, and Themes
A MCI code that appears in a `menu.hjson` entry corresponds to that found in it's associated art file. This same MCI code can be referenced in the `theme.hjson` in order to apply a theme.
See [Menus](../docs/configuration/menu-hjson.md) and [Themes](themes.md) for more information.
## Predefined Codes
There are many predefined MCI codes that can be used anywhere on the system (placed in any art file).
| Code | Description |
|------|--------------|
@@ -92,6 +102,13 @@ Some additional special case codes also exist:
| `XY` | A special code that may be utilized for placement identification when creating menus or to extend an otherwise empty space in an art file down the screen. |
:information_source: More are added all
the time so also check out [core/predefined_mci.js](https://github.com/NuSkooler/enigma-bbs/blob/master/core/mci_view_factory.js)
for a full listing.
:note: Many codes attempt to pay homage to Oblivion/2, iNiQUiTY, etc.
## Views
A **View** is a control placed on a **form** that can display variable data or collect input. One example of a View is
a Vertical Menu (`%VM`): Old-school BBSers may recognize this as a lightbar menu.
@@ -109,10 +126,11 @@ a Vertical Menu (`%VM`): Old-school BBSers may recognize this as a lightbar menu
| `TM` | Toggle Menu | A toggle menu commonly used for Yes/No style input |
| `KE` | Key Entry | A *single* key input control |
Peek at [/core/mci_view_factory.js](https://github.com/NuSkooler/enigma-bbs/blob/master/core/mci_view_factory.js) to
:information_source: Peek at [/core/mci_view_factory.js](https://github.com/NuSkooler/enigma-bbs/blob/master/core/mci_view_factory.js) to
see additional information.
### View Identifiers
As mentioned above, MCI codes can (and often should) be explicitly tied to a *View Identifier*. Simply speaking this is a number representing the particular view. These can be useful to reference in code, apply themes, etc.
## Properties & Theming
Predefined MCI codes and other Views can have properties set via `menu.hjson` and further *themed* via `theme.hjson`. See [Themes](themes.md) for more information on this subject.
@@ -132,8 +150,7 @@ Predefined MCI codes and other Views can have properties set via `menu.hjson` an
| `itemFormat` | Sets the format for a list entry. See **Entry Formatting** below |
| `focusItemFormat` | Sets the format for a focused list entry. See **Entry Formatting** below |
These are just a few of the properties set on various views. *Use the source Luke*, as well as taking a look at the default
`menu.hjson` and `theme.hjson` files!
These are just a few of the properties set on various views. *Use the source Luke*, as well as taking a look at the default `menu.hjson` and `theme.hjson` files!
### Custom Properties
Often a module will provide custom properties that receive format objects (See **Entry Formatting** below). Custom property formatting can be declared in the `config` block. For example, `browseInfoFormat10`..._N_ (where _N_ is up to 99) in the `file_area_list` module received a fairly extensive format object that contains `{fileName}`, `{estReleaseYear}`, etc.