LokiChaos / Materiamagica-on-tintin

A collection of tintin++ scripts for playing MateriaMagica
8 stars 1 forks source link

Prompt Revisions #10

Open LokiChaos opened 9 years ago

LokiChaos commented 9 years ago

The current system to generate the actual displayed string for the prompt/status area is too hard-coded. I would like to change the system generate the lines from a list of units. For example to display this:

[    ][N                      ]                  [100%][ 732x,1257y][g F][17:10]

It would be:

{left}{
    {1}{room_short}{2}{exits}
}
{right}{
    {1}{regen}{2}{coordinates}{3}{moon_phase}{4}{time}
}

Basically each possibly string for inclusion would be generated by event handlers on prompt_pre and then they would be combined by name into the complete string and displayed. Each line would be a list, indexed by the showme/echo line value then divided into left and right halves which would be justified to the left and right. Left would over-write the right should they be longer than the width.

The primary upside is to make it easy for modules to add or alter the prompt and not require hacking at the prompt's code.