Skip to content

Commit efba244

Browse files
authored
main_start/end support for multiboxes (#1246)
* `main_start`/`end` support for multiboxes * this is why im making a pr and not merging without looking
1 parent 365e8f7 commit efba244

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

lovely/multi_box_descriptions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ local multi_boxes = {}
7373
if AUT.multi_box then
7474
for i, box in ipairs(AUT.multi_box) do
7575
box.background_colour = box.background_colour or AUT.box_colours and AUT.box_colours[i+1] or nil
76+
if AUT.box_starts and AUT.box_starts[i] then table.insert(box, 1, AUT.box_starts[i]) end
77+
if AUT.box_ends and AUT.box_ends[i] then table.insert(box, AUT.box_ends[i]) end
7678
multi_boxes[#multi_boxes+1] = desc_from_rows(box)
7779
end
7880
end

src/game_object.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,10 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj.
12221222
target.set = res.set or target.set
12231223
target.scale = res.scale
12241224
target.text_colour = res.text_colour
1225+
if desc_nodes == full_UI_table.main then
1226+
full_UI_table.box_starts = res.box_starts
1227+
full_UI_table.box_ends = res.box_ends
1228+
end
12251229
end
12261230

12271231
if desc_nodes == full_UI_table.main and not full_UI_table.name then
@@ -3000,6 +3004,10 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj.
30003004
target.set = res.set or target.set
30013005
target.scale = res.scale
30023006
target.text_colour = res.text_colour
3007+
if desc_nodes == full_UI_table.main then
3008+
full_UI_table.box_starts = res.box_starts
3009+
full_UI_table.box_ends = res.box_ends
3010+
end
30033011
end
30043012
if desc_nodes == full_UI_table.main and not full_UI_table.name then
30053013
full_UI_table.name = localize { type = 'name', set = target.set, key = res.name_key or target.key, nodes = full_UI_table.name, vars = res.name_vars or res.vars or {} }

0 commit comments

Comments
 (0)