Skip to content

Commit d0daba0

Browse files
authored
spectate.lua: fix individual stress levels
* set a stress level instead of the whole table * place the list widget deeper than toggle buttons
1 parent bbf75a7 commit d0daba0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gui/spectate.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ local function create_toggle_button(frame, cfg_elem, hotkey, label, cfg_elem_key
5353
return ToggleLabel{
5454
frame=frame,
5555
initial_option=spectate.get_config_elem(cfg_elem, cfg_elem_key),
56-
on_change=function(val) dfhack.run_command('spectate', 'set', cfg_elem, tostring(val)) end,
56+
on_change=function(val) dfhack.run_command('spectate', 'set', cfg_elem, cfg_elem_key, tostring(val)) end,
5757
key=hotkey,
5858
label=label,
5959
}
@@ -151,7 +151,7 @@ local function create_stress_list(frame, colFollow, colHover)
151151
table.insert(choices, make_choice({{text=elem.text, pen=elem.pen}, ' ', elem.name}, tlFollow, tlHover))
152152
end
153153

154-
table.insert(subviews, widgets.List{
154+
table.insert(subviews, 1, widgets.List{
155155
frame={l=2},
156156
on_submit=function(_, choice) choice.data.tlFollow:cycle() end,
157157
on_submit2=function(_, choice) choice.data.tlHover:cycle() end,

0 commit comments

Comments
 (0)