You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lsp_def/ui.lua
+61-1Lines changed: 61 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -328,4 +328,64 @@ function create_UIBox_your_collection_stickers() end
328
328
329
329
---@returnUINode
330
330
---@paramargsScoreContainerArgs
331
-
functionSMODS.GUI.score_container(args) end
331
+
functionSMODS.GUI.score_container(args) end
332
+
333
+
---@classScrollbarArgs
334
+
---@fieldwnumber? The width of the scrollbar. Is optional if scrollbar is horizontal or knob_w is specified.
335
+
---@fieldhnumber? The height of the scrollbar. Is optional if scrollbar is vertical or knob_h is specified.
336
+
---@fieldbg_colour? table The background colour of the scrollbar.
337
+
---@fieldcolour? table The colour of the scrollbar's progress.
338
+
---@fieldknob_colour? table The colour of the scrollbar's knob.
339
+
---@fieldknob_h? number The height of the scrollbar's knob. Takes precedence over `h` if scrollbar is horizontal.
340
+
---@fieldknob_w? number The width of the scrollbar's knob. Takes precedence over `w` if scrollbar is vertical.
341
+
---@fieldref_table? table The table whose `ref_value` should be updated based on this scrollbar's progress.
342
+
---@fieldref_value? string `ref_table[ref_value]` is set to a value between `min` and `max`.
343
+
---@fieldscroll_collision_obj? SMODS.UIScrollBox The object to scroll based on this scrollbar's progress. This scrollbox will only update automatically if `ref_table` or `ref_value` are omitted.
344
+
---@fieldui_type? G.UIT Which type of UI node this should be.
345
+
---@fieldhorizontal? boolean Whether or not this scrollbar is horizontal. Default orientation is vertical.
346
+
---@fieldmin? number Minimum value of `ref_value`. Defaults to 0.
347
+
---@fieldmax? number Maximum value of `ref_value` Defaults to 1.
348
+
---@fieldscroll_mult? number Multiplies the scrolling speed of this scrollbar when scrolled with mouse wheel or something similar.
349
+
350
+
---Returns an UI node that has the functionality of a scrollbar.
351
+
---@paramargsScrollbarArgs
352
+
---@returntable
353
+
functionSMODS.GUI.scrollbar(args) end
354
+
355
+
--- Handles SMODS.GUI.scrollbar functionality
356
+
---@parametable
357
+
functionG.FUNCS.scrollbar(e) end
358
+
359
+
---@classDropdownSelectArgs
360
+
---@fieldoptionsstring[] A list of all possible options that this dropdown button can have.
361
+
---@fieldref_tabletable The table whose `ref_value` should be updated to this dropdown's current value.
362
+
---@fieldref_valuestring `ref_table[ref_value]` is set to this dropdown's current value.
363
+
---@fielddefault? string The default value of this dropdown selection if no value is selected. If not specified, defaults to the first item of `options`.
364
+
---@fieldscale? number The scale of the dropdown button's text. Defaults to 0.4.
365
+
---@fielddropdown_scale? number The scale of the text of the dropdown options. Defaults to 0.4.
366
+
---@fieldminw? number Specifies the minimum width of the box that contains the text displayed as the current option.
367
+
---@fielddropdown_bg_colour? table The colour of the background of the dropdown menu. Defaults to lighten(G.C.BLACK, 0.2)
368
+
---@fieldborder_colour? table The colour of the border of the dropdown menu. Defaults to lighten(G.C.JOKER_GREY, 0.5).
369
+
---@fielddropdown_text_colour? table The colour of the text of the dropdown options. Defaults to G.C.UI.TEXT_LIGHT.
370
+
---@fieldselected_colour? table The colour of the background of the currently selected option. Defaults to G.C.BLACK.
371
+
---@fieldcolour? table The colour of the dropdown button. Defaults to G.C.RED.
372
+
---@fieldtext_colour? table The colour of the dropdown button's text. Defaults to G.C.UI.TEXT_LIGHT.
373
+
---@fielddropdown_element_def? fun(option: string, args: DropdownSelectArgs): table If defined, each option will be displayed according to the UI nodes returned by this function. Note that the result of this function is passed into a row node.
374
+
---@fieldmax_menu_h? number The maximum height that the dropdown options should take up. If set, the dropdown's contents will be scrollable and a scrollbar will automatically appear.
375
+
---@fielddisabled_colour? table The colour of the background disabled options. Defaults to G.C.CLEAR.
376
+
---@fieldcallback? string If set, dropdown options when clicked will call G.FUNCS[callback](e), with `e` being the specific option button pressed. `e.config.value` gets the value of the clicked option. Will not be called if the option is clicked on while disabled.
377
+
---@fieldis_option_disabled? fun(option: string): boolean? If defined, an option will be disabled if this function returns a truthy value. This is called for every option.
378
+
---@fieldno_unselect? boolean If set to `true`, prevents an option from being unselected.
379
+
---@fieldalign? string Aligns the text of the dropdown button. Works just like aligning regular UI nodes. Default is "cm".
380
+
---@fieldid? string Assigns the given id to the config table of the root of the button UIBox if set.
381
+
---@fieldoption_align? string Aligns the text of the dropdown options. Works just like aligning regular UI nodes. Default is "cl".
382
+
---@fieldclose_on_select? boolean If true, the dropdown menu will automatically close when an option is selected or unselected.
383
+
384
+
---Returns a button that creates a dropdown selection menu when clicked on.
385
+
---@paramargsDropdownSelectArgs
386
+
functionSMODS.GUI.dropdown_select(args) end
387
+
388
+
---Handles creating the dropdown menu. Don't call this manually.
389
+
---@paramargsDropdownSelectArgs
390
+
---@paramparent_widthnumber
391
+
functionSMODS.GUI.create_UIBox_dropdown_menu(args, parent_width) end
0 commit comments