dfhack/docs/plugins/overlay.rst

69 lines
2.8 KiB
ReStructuredText

2022-09-16 15:01:29 -06:00
overlay
=======
.. dfhack-tool::
:summary: Manage on-screen overlay widgets.
2022-09-16 15:01:29 -06:00
:tags: dfhack interface
The overlay framework manages the on-screen widgets that other tools (including
3rd party plugins and scripts) can register for display. For a graphical
2022-11-29 16:14:22 -07:00
configuration interface, please see `gui/overlay`. If you are a developer who
wants to write an overlay widget, please see the `overlay-dev-guide`.
2022-09-16 15:01:29 -06:00
Usage
-----
``enable overlay``
Display enabled widgets.
``overlay enable|disable all|<name or list number> [<name or list number> ...]``
Enable/disable all or specified widgets. Widgets can be specified by either
their name or their number, as returned by ``overlay list``.
2022-11-11 11:36:58 -07:00
``overlay list [<filter>]``
Show a list of all the widgets that are registered with the overlay
2022-11-11 11:36:58 -07:00
framework, optionally filtered by the given filter string.
``overlay position <name or list number> [default|<x> <y>]``
Display configuration information for the given widget or change the
position where it is rendered. See the `Widget position`_ section below for
details.
``overlay trigger <name or list number>``
Intended to be used by keybindings for manually triggering a widget. For
example, you could use an ``overlay trigger`` keybinding to show a menu that
normally appears when you hover the mouse over a screen hotspot.
Examples
--------
``overlay enable all``
Enable all widgets. Note that they will only be displayed on the screens
that they are associated with. You can see which screens a widget will be
displayed on, along with whether the widget is a hotspot, by calling
``overlay position``.
``overlay position hotkeys.menu``
Show the current configuration of the `hotkeys` menu widget.
``overlay position dwarfmonitor.cursor -2 -3``
Display the `dwarfmonitor` cursor position reporting widget in the lower
right corner of the screen, 2 tiles from the left and 3 tiles from the
bottom.
``overlay position dwarfmonitor.cursor default``
Reset the `dwarfmonitor` cursor position to its default.
``overlay trigger hotkeys.menu``
Trigger the `hotkeys` menu widget so that it shows its popup menu. This is
what is run when you hit :kbd:`Ctrl`:kbd:`Shift`:kbd:`C`.
Widget position
---------------
Widgets can be positioned at any (``x``, ``y``) position on the screen, and can
be specified relative to any edge. Coordinates are 1-based, which means that
``1`` is the far left column (for ``x``) or the top row (for ``y``). Negative
numbers are measured from the right of the screen to the right edge of the
widget or from the bottom of the screen to the bottom of the widget,
respectively.
For easy reference, the corners can be found at the following coordinates:
2022-09-16 15:01:29 -06:00
:(1, 1): top left corner
:(-1, 1): top right corner
:(1, -1): lower left corner
:(-1, -1): lower right corner