Skip to content

Commit e817518

Browse files
authored
Merge pull request #5264 from TymurGubayev/patch-10
spectate.lua: implement unit banners and mouse tooltips
2 parents f0eeba6 + 2c87cf8 commit e817518

File tree

2 files changed

+508
-25
lines changed

2 files changed

+508
-25
lines changed

docs/plugins/spectate.rst

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ Examples
6363
Show informative tooltips that follow each unit on the map. Note that this
6464
can be enabled independently of `spectate` itself.
6565

66+
``spectate set tooltip-follow-job-shortenings "Store item in stockpile" "Store"``
67+
Abbreviate the names of "Store item in stockpile" jobs to just "Store" when the
68+
job is displayed in the `spectate` tooltips. See the
69+
``tooltip-follow-job-shortenings`` setting below for details.
70+
6671
Settings
6772
--------
6873

@@ -103,10 +108,24 @@ Settings
103108
Toggle whether to prefer following (non-siege) units that have newly
104109
arrived on the map.
105110

111+
``tooltip-follow`` (default: enabled)
112+
If the ``spectate.tooltip`` overlay is enabled, toggle whether to show the
113+
tooltips that follow onscreen dwarves around the map.
114+
115+
``tooltip-follow-blink-milliseconds`` (default: 3000)
116+
If the ``spectate.tooltip`` overlay is enabled, set the tooltip's blink
117+
duration in milliseconds. Set to 0 to always show.
118+
106119
``tooltip-follow-job`` (default: enabled)
107120
If the ``spectate.tooltip`` overlay is enabled, toggle whether to show the
108121
job of the dwarf in the tooltip.
109122

123+
``tooltip-follow-job-shortenings`` (default: "Store item in stockpile" -> "Store item")
124+
If the ``spectate.tooltip`` overlay is enabled, this dictionary is used to
125+
shorten some job names, f.e. "Store item in stockpile" becomes "Store item".
126+
You can pass two parameters to ``spectate set tooltip-follow-job-shortenings`` to
127+
add or change elements in the dictionary. See the Examples section for an example.
128+
110129
``tooltip-follow-name`` (default: enabled)
111130
If the ``spectate.tooltip`` overlay is enabled, toggle whether to show the
112131
name of the dwarf in the tooltip.
@@ -115,6 +134,16 @@ Settings
115134
If the ``spectate.tooltip`` overlay is enabled, toggle whether to show the
116135
happiness level (stress) of the dwarf in the tooltip.
117136

137+
``tooltip-follow-stress-levels`` (default: Displeased, Content, Pleased are disabled)
138+
If the ``spectate.tooltip`` overlay is enabled, toggle whether to show the
139+
specific happiness level (stress) of the dwarf in the tooltip. F.e.
140+
``tooltip-follow-stress-levels 2 true`` would show the Displeased emoticon.
141+
See ``tooltip-stress-levels`` below for details.
142+
143+
``tooltip-hover`` (default: enabled)
144+
If the ``spectate.tooltip`` overlay is enabled, toggle whether to show the
145+
hover popup panel when your mouse cursor is over a unit.
146+
118147
``tooltip-hover-job`` (default: enabled)
119148
If the ``spectate.tooltip`` overlay is enabled, toggle whether to show the
120149
job of the dwarf in the hover panel.
@@ -127,6 +156,57 @@ Settings
127156
If the ``spectate.tooltip`` overlay is enabled, toggle whether to show the
128157
happiness level (stress) of the dwarf in the hover panel.
129158

159+
``tooltip-hover-stress-levels`` (default: Displeased, Content, Pleased are disabled)
160+
If the ``spectate.tooltip`` overlay is enabled, toggle whether to show the
161+
specific happiness level (stress) of the dwarf in the hover panel. F.e.
162+
``tooltip-hover-stress-levels 2 true`` would show the Displeased emoticon.
163+
See ``tooltip-stress-levels`` below for details.
164+
165+
``tooltip-stress-levels``
166+
Controls how happiness levels (stress) are displayed (emoticon and color).
167+
F.e. ``tooltip-stress-levels 6 text XD`` will change the emoticon for
168+
Ecstatic dwarves to ``XD``.
169+
Default values are:
170+
171+
.. list-table::
172+
:widths: 25 25 25 25
173+
:header-rows: 1
174+
175+
* - Level
176+
- name
177+
- text
178+
- pen
179+
* - 0
180+
- Miserable
181+
- =C
182+
- COLOR_RED
183+
* - 1
184+
- Unhappy
185+
- :C
186+
- COLOR_LIGHTRED
187+
* - 2
188+
- Displeased
189+
- :(
190+
- COLOR_YELLOW
191+
* - 3
192+
- Content
193+
- :]
194+
- COLOR_GREY
195+
* - 4
196+
- Pleased
197+
- :)
198+
- COLOR_GREEN
199+
* - 5
200+
- Happy
201+
- :D
202+
- COLOR_LIGHTGREEN
203+
* - 6
204+
- Ecstatic
205+
- =D
206+
- COLOR_LIGHTCYAN
207+
208+
Keep in mind that the text may look different when rendered in the game's font.
209+
130210
Overlays
131211
--------
132212

0 commit comments

Comments
 (0)