3636
3737--- @param widths NamedWidth[] single-name entries only !
3838--- @return Toolbar
39- local function button_widths_to_offsets (widths )
39+ local function button_widths_to_toolbar (widths )
4040 local offsets = {}
4141 local offset = 0
4242 for _ , ww in ipairs (widths ) do
6363
6464--- @param buttons string[]
6565--- @return Toolbar
66- local function buttons_to_offsets (buttons )
67- return button_widths_to_offsets (buttons_to_widths (buttons ))
66+ local function buttons_to_toolbar (buttons )
67+ return button_widths_to_toolbar (buttons_to_widths (buttons ))
6868end
6969
7070-- Fortress mode toolbar definitions
7171fort = {}
7272
7373--- @class LeftToolbar : Toolbar
74- fort .left = buttons_to_offsets {
74+ fort .left = buttons_to_toolbar {
7575 ' citizens' , ' tasks' , ' places' , ' labor' ,
7676 ' orders' , ' nobles' , ' objects' , ' justice' ,
7777}
9393fort .left_center_gap_minimum = 7
9494
9595--- @class CenterToolbar : Toolbar
96- fort .center = button_widths_to_offsets {
96+ fort .center = button_widths_to_toolbar {
9797 { _left_border = 1 },
9898 { dig = 4 }, { chop = 4 }, { gather = 4 }, { smooth = 4 }, { erase = 4 },
9999 { _divider = 1 },
@@ -174,53 +174,53 @@ function fort.center:secondary_toolbar_frame(interface_rect, toolbar_name)
174174 }
175175end
176176
177- --- @type table<CenterToolbarSecondaryToolbarNames,NamedOffsets >
177+ --- @type table<CenterToolbarSecondaryToolbarNames,Toolbar >
178178fort .center .secondary_toolbars = {
179- dig = buttons_to_offsets {
179+ dig = buttons_to_toolbar {
180180 ' dig' , ' stairs' , ' ramp' , ' channel' , ' remove_construction' , ' _gap' ,
181181 ' rectangle' , ' draw' , ' _gap' ,
182182 ' advanced_toggle' , ' _gap' ,
183183 ' all' , ' auto' , ' ore_gem' , ' gem' , ' _gap' ,
184184 ' p1' , ' p2' , ' p3' , ' p4' , ' p5' , ' p6' , ' p7' , ' _gap' ,
185185 ' blueprint' , ' blueprint_to_standard' , ' standard_to_blueprint' ,
186186 },
187- chop = buttons_to_offsets {
187+ chop = buttons_to_toolbar {
188188 ' chop' , ' _gap' ,
189189 ' rectangle' , ' draw' , ' _gap' ,
190190 ' advanced_toggle' , ' _gap' ,
191191 ' p1' , ' p2' , ' p3' , ' p4' , ' p5' , ' p6' , ' p7' , ' _gap' ,
192192 ' blueprint' , ' blueprint_to_standard' , ' standard_to_blueprint' ,
193193 },
194- gather = buttons_to_offsets {
194+ gather = buttons_to_toolbar {
195195 ' gather' , ' _gap' ,
196196 ' rectangle' , ' draw' , ' _gap' ,
197197 ' advanced_toggle' , ' _gap' ,
198198 ' p1' , ' p2' , ' p3' , ' p4' , ' p5' , ' p6' , ' p7' , ' _gap' ,
199199 ' blueprint' , ' blueprint_to_standard' , ' standard_to_blueprint' ,
200200 },
201- smooth = buttons_to_offsets {
201+ smooth = buttons_to_toolbar {
202202 ' smooth' , ' engrave' , ' carve_track' , ' carve_fortification' , ' _gap' ,
203203 ' rectangle' , ' draw' , ' _gap' ,
204204 ' advanced_toggle' , ' _gap' ,
205205 ' p1' , ' p2' , ' p3' , ' p4' , ' p5' , ' p6' , ' p7' , ' _gap' ,
206206 ' blueprint' , ' blueprint_to_standard' , ' standard_to_blueprint' ,
207207 },
208- erase = buttons_to_offsets {
208+ erase = buttons_to_toolbar {
209209 ' rectangle' ,
210210 ' draw' ,
211211 },
212212 -- build -- completely different and quite variable
213- stockpile = buttons_to_offsets { ' add_stockpile' },
214- stockpile_paint = buttons_to_offsets {
213+ stockpile = buttons_to_toolbar { ' add_stockpile' },
214+ stockpile_paint = buttons_to_toolbar {
215215 ' rectangle' , ' draw' , ' erase_toggle' , ' remove' ,
216216 },
217217 -- zone -- no secondary toolbar
218218 -- burrow -- no direct secondary toolbar
219- burrow_paint = buttons_to_offsets {
219+ burrow_paint = buttons_to_toolbar {
220220 ' rectangle' , ' draw' , ' erase_toggle' , ' remove' ,
221221 },
222222 -- cart -- no secondary toolbar
223- traffic = button_widths_to_offsets (
223+ traffic = button_widths_to_toolbar (
224224 concat_sequences { buttons_to_widths {
225225 ' high' , ' normal' , ' low' , ' restricted' , ' _gap' ,
226226 ' rectangle' , ' draw' , ' _gap' ,
@@ -231,14 +231,14 @@ fort.center.secondary_toolbars = {
231231 { weight_input = 6 },
232232 } }
233233 ),
234- mass_designation = buttons_to_offsets {
234+ mass_designation = buttons_to_toolbar {
235235 ' claim' , ' forbid' , ' dump' , ' no_dump' , ' melt' , ' no_melt' , ' hidden' , ' visible' , ' _gap' ,
236236 ' rectangle' , ' draw' ,
237237 },
238238}
239239
240240--- @class RightToolbar : Toolbar
241- fort .right = buttons_to_offsets {
241+ fort .right = buttons_to_toolbar {
242242 ' squads' , ' world' ,
243243}
244244
0 commit comments