diff --git a/docs/dev/overlay-dev-guide.rst b/docs/dev/overlay-dev-guide.rst index b5b6cf0e3..2ef07ec04 100644 --- a/docs/dev/overlay-dev-guide.rst +++ b/docs/dev/overlay-dev-guide.rst @@ -89,11 +89,14 @@ The ``overlay.OverlayWidget`` superclass defines the following class attributes: - ``name`` This will be filled in with the display name of your widget, in case you have multiple widgets with the same implementation but different - configurations. + configurations. You should not set this property yourself. - ``version`` You can set this to any string. If the version string of a loaded widget does not match the saved settings for that widget, then the configuration for the widget (position, enabled status) will be reset to defaults. +- ``desc`` + A short (<100 character) description of what the overlay does. This text + will be displayed in `gui/control-panel` on the "Overlays" tab. - ``default_pos`` (default: ``{x=-2, y=-2}``) Override this attribute with your desired default widget position. See the `overlay` docs for information on what positive and negative numbers diff --git a/plugins/lua/overlay.lua b/plugins/lua/overlay.lua index d8b3c4f81..9084e50b2 100644 --- a/plugins/lua/overlay.lua +++ b/plugins/lua/overlay.lua @@ -553,6 +553,7 @@ end OverlayWidget = defclass(OverlayWidget, widgets.Panel) OverlayWidget.ATTRS{ name=DEFAULT_NIL, -- this is set by the framework to the widget name + desc=DEFAULT_NIL, -- add a short description (<100 chars); displays in control panel default_pos={x=DEFAULT_X_POS, y=DEFAULT_Y_POS}, -- 1-based widget screen pos default_enabled=false, -- initial enabled state if not in config overlay_only=false, -- true if there is no widget to reposition @@ -581,6 +582,7 @@ end TitleVersionOverlay = defclass(TitleVersionOverlay, OverlayWidget) TitleVersionOverlay.ATTRS{ + desc='Show DFHack version number and quick links on the DF title page.', default_pos={x=11, y=1}, version=2, default_enabled=true,