diff --git a/BasaltLS.lua b/BasaltLS.lua index bb5cc43..1e0f3f1 100644 --- a/BasaltLS.lua +++ b/BasaltLS.lua @@ -1,61 +1,1172 @@ ---@meta +---@class DropDown : List +---@field dropdownHeight number Maximum height of the DropDown menu when open +---@field dropSymbol string The symbol to show for DropDown indication +---@field isOpen boolean Whether the DropDown menu is currently open +---@field selectedText string The text to show when no item is selected +local DropDown = {} + +---Gets the value of the DropSymbol property. +---@param self DropDown self +---@return string "\31" The symbol to show for DropDown indication +function DropDown:getDropSymbol(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function DropDown:mouse_click(button, x, y) end + +---Gets the value of the SelectedText property. +---@param self DropDown self +---@return string "" The text to show when no item is selected +function DropDown:getSelectedText(self) end + +---Sets the value of the IsOpen property. +---@param self DropDown self +---@param IsOpen boolean Whether the DropDown menu is currently open +function DropDown:setIsOpen(self, IsOpen) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function DropDown:render() end + +---Gets the value of the DropdownHeight property. +---@param self DropDown self +---@return number 5 Maximum height of the DropDown menu when open +function DropDown:getDropdownHeight(self) end + +---Gets the value of the IsOpen property. +---@param self DropDown self +---@return boolean false Whether the DropDown menu is currently open +function DropDown:getIsOpen(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return DropDown self The initialized instance +---@protected +function DropDown:init(props, basalt) end + +---Sets the value of the DropdownHeight property. +---@param self DropDown self +---@param DropdownHeight number Maximum height of the DropDown menu when open +function DropDown:setDropdownHeight(self, DropdownHeight) end + +---Sets the value of the DropSymbol property. +---@param self DropDown self +---@param DropSymbol string The symbol to show for DropDown indication +function DropDown:setDropSymbol(self, DropSymbol) end + +---Sets the value of the SelectedText property. +---@param self DropDown self +---@param SelectedText string The text to show when no item is selected +function DropDown:setSelectedText(self, SelectedText) end + +---@class BaseFrame : Container +---@field term term term.current() The terminal or (monitor) peripheral object to render to +local BaseFrame = {} + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param key number The key that was pressed +---@protected +function BaseFrame:key(key) end + +---Sets the value of the Term property. +---@param self BaseFrame self +---@param Term term term.current() The terminal or (monitor) peripheral object to render to +function BaseFrame:setTerm(self, Term) end + +function BaseFrame.setup() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function BaseFrame:term_resize() end + +---Toggles the debug log frame +---@param self BaseFrame The frame to toggle debug log for +function BaseFrame.toggleConsole(self) end + +function BaseFrame:drawFg() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function BaseFrame:render() end + +---Sets the cursor position +---@param x number The x position to set the cursor to +---@param y number The y position to set the cursor to +---@param blink boolean Whether the cursor should blink +function BaseFrame:setCursor(x, y, blink) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param name string The name of the monitor that was touched +---@param x number The x position of the mouse +---@param y number The y position of the mouse +---@protected +function BaseFrame:monitor_touch(name, x, y) end + +---Gets the value of the Term property. +---@param self BaseFrame self +---@return term |peripheral term.current() The terminal or (monitor) peripheral object to render to +function BaseFrame:getTerm(self) end + +---Initializes a new state for this element +---@param self BaseFrame The element to initialize state for +---@param name string The name of the state +---@param default any The default value of the state +---@return BaseFrame self The element instance +function BaseFrame:initializeState(self, name, default) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return table self The initialized instance +---@protected +function BaseFrame:init(props, basalt) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was released +---@param x number The x position of the mouse +---@param y number The y position of the mouse +---@protected +function BaseFrame:mouse_up(button, x, y) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to render to +---@param y number The y position to render to +---@param text string The text to render +---@param bg colors The background color +---@protected +function BaseFrame:drawText(x, y, text, bg) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to render to +---@param y number The y position to render to +---@param text string The text to render +---@param fg colors The foreground color +---@protected +function BaseFrame:textFg(x, y, text, fg) end + +---Hides the debug log frame +---@param self BaseFrame The frame to hide debug log for +function BaseFrame.closeConsole(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to render to +---@param y number The y position to render to +---@param text string The text to render +---@param fg string The foreground color +---@param bg string The background color +---@protected +function BaseFrame:blit(x, y, text, fg, bg) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to render to +---@param y number The y position to render to +---@param text string The text to render +---@param bg colors The background color +---@protected +function BaseFrame:textBg(x, y, text, bg) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the mouse +---@param y number The y position of the mouse +---@protected +function BaseFrame:mouse_click(button, x, y) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param char string The character that was pressed +---@protected +function BaseFrame:char(char) end + +function BaseFrame:drawBg() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param key number The key that was released +---@protected +function BaseFrame:key_up(key) end + +---Shows the debug log frame +---@param self BaseFrame The frame to show debug log in +function BaseFrame.openConsole(self) end + +function BaseFrame:dispatchEvent() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to render to +---@param y number The y position to render to +---@param width number The width of the text +---@param height number The height of the text +---@param text string The text to render +---@param fg string The foreground color +---@param bg string The background color +---@protected +function BaseFrame:multiBlit(x, y, width, height, text, fg, bg) end + +---@class Table : VisualElement +---@field columns table List of column definitions with {name, width} properties +---@field gridColor color Color of grid lines +---@field headerColor color Color of the column headers +---@field selectedRow number nil Currently selected row index +---@field customSortFunction table Custom sort functions for columns +---@field selectedColor color Background color of selected row +---@field scrollOffset number Current scroll position +---@field sortDirection string Sort direction ("asc" or "desc") +---@field data table The table data as array of row arrays +---@field sortColumn number nil Currently sorted column index +local Table = {} + +---Sets the value of the ScrollOffset property. +---@param self Table self +---@param ScrollOffset number Current scroll position +function Table:setScrollOffset(self, ScrollOffset) end + +---Sets the value of the SelectedRow property. +---@param self Table self +---@param SelectedRow number nil Currently selected row index +function Table:setSelectedRow(self, SelectedRow) end + +---Set data with automatic formatting +---@param rawData table The raw data array +---@param formatters table Optional formatter functions for columns {[2] = function(value) return value end} +---@return Table self The Table instance +function Table:setData(rawData, formatters) end + +---Sets the value of the HeaderColor property. +---@param self Table self +---@param HeaderColor color Color of the column headers +function Table:setHeaderColor(self, HeaderColor) end + +---Sets the value of the SortColumn property. +---@param self Table self +---@param SortColumn number nil Currently sorted column index +function Table:setSortColumn(self, SortColumn) end + +---Sets the value of the GridColor property. +---@param self Table self +---@param GridColor color Color of grid lines +function Table:setGridColor(self, GridColor) end + +---Gets the value of the HeaderColor property. +---@param self Table self +---@return color blue Color of the column headers +function Table:getHeaderColor(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Table:render() end + +---Sets the value of the Columns property. +---@param self Table self +---@param Columns table List of column definitions with {name, width} properties +function Table:setColumns(self, Columns) end + +---Adds data with both display and sort values +---@param displayData table The formatted data for display +---@param sortData table The raw data for sorting (optional) +---@return Table self The Table instance +function Table:setFormattedData(displayData, sortData) end + +---Sets a custom sort function for a specific column +---@param columnIndex number The index of the column +---@param sortFn function Function that takes (rowA, rowB) and returns comparison result +---@return Table self The Table instance +function Table:setColumnSortFunction(columnIndex, sortFn) end + +---Sorts the table data by column +---@param columnIndex number The index of the column to sort by +---@param fn function ? Optional custom sorting function +---@return Table self The Table instance +function Table:sortData(columnIndex, fn) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param direction number The scroll direction (-1 up, 1 down) +---@param x number The x position of the scroll +---@param y number The y position of the scroll +---@return boolean handled Whether the event was handled +---@protected +function Table:mouse_scroll(direction, x, y) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Table:mouse_click(button, x, y) end + +---Gets the value of the ScrollOffset property. +---@param self Table self +---@return number 0 Current scroll position +function Table:getScrollOffset(self) end + +---Adds a new row of data to the table +---@return Table self The Table instance +function Table:addData() end + +---Adds a new column to the table +---@param name string The name of the column +---@param width number The width of the column +---@return Table self The Table instance +function Table:addColumn(name, width) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Table self The initialized instance +---@protected +function Table:init(props, basalt) end + +---Gets the value of the SortDirection property. +---@param self Table self +---@return string "asc" Sort direction ("asc" or "desc") +function Table:getSortDirection(self) end + +---Gets the value of the SelectedColor property. +---@param self Table self +---@return color lightBlue Background color of selected row +function Table:getSelectedColor(self) end + +---Gets the value of the SelectedRow property. +---@param self Table self +---@return number ? nil Currently selected row index +function Table:getSelectedRow(self) end + +---Gets the value of the Columns property. +---@param self Table self +---@return table {} List of column definitions with {name, width} properties +function Table:getColumns(self) end + +---Sets the value of the SortDirection property. +---@param self Table self +---@param SortDirection string Sort direction ("asc" or "desc") +function Table:setSortDirection(self, SortDirection) end + +---Sets the value of the CustomSortFunction property. +---@param self Table self +---@param CustomSortFunction table Custom sort functions for columns +function Table:setCustomSortFunction(self, CustomSortFunction) end + +---Gets the value of the GridColor property. +---@param self Table self +---@return color gray Color of grid lines +function Table:getGridColor(self) end + +---Sets the value of the SelectedColor property. +---@param self Table self +---@param SelectedColor color Background color of selected row +function Table:setSelectedColor(self, SelectedColor) end + +---Gets the value of the CustomSortFunction property. +---@param self Table self +---@return table {} Custom sort functions for columns +function Table:getCustomSortFunction(self) end + +---Gets the value of the SortColumn property. +---@param self Table self +---@return number ? nil Currently sorted column index +function Table:getSortColumn(self) end + +---Gets the value of the Data property. +---@param self Table self +---@return table {} The table data as array of row arrays +function Table:getData(self) end + +---@class Benchmark +local Benchmark = {} + +---Starts a custom benchmark +---@param name string The name of the benchmark +function API.start(name) end + +---Clears a specific benchmark +---@param name string The name of the benchmark to clear +function API.clear(name) end + +---Clears all custom benchmarks +function API.clearAll() end + +---Gets statistics for a benchmark +---@param name string The name of the benchmark +---@return table ? stats The benchmark statistics or nil +function API.getStats(name) end + +---Stops a custom benchmark +---@param name string The name of the benchmark to stop +function API.stop(name) end + +---@class ComboBox : DropDown +---@field text string The current text content of the ComboBox +---@field manuallyOpened boolean Whether the dropdown was manually opened (not by auto-complete) +---@field focusedForeground color Foreground color when ComboBox is focused +---@field viewOffset number The horizontal scroll offset for viewing long text +---@field focusedBackground color Background color when ComboBox is focused +---@field cursorPos number The current cursor position in the text +---@field autoComplete boolean Whether to enable auto-complete filtering when typing +---@field editable boolean Whether the ComboBox allows text input +---@field placeholderColor color Color of the placeholder text +---@field placeholder string Text to display when input is empty +local ComboBox = {} + +---Gets the value of the Editable property. +---@param self ComboBox self +---@return boolean true Whether the ComboBox allows text input +function ComboBox:getEditable(self) end + +---Called when the ComboBox gains focus +function ComboBox:focus() end + +---Sets whether the ComboBox is editable +---@param editable boolean Whether the ComboBox should be editable +---@return ComboBox self +function ComboBox:setEditable(editable) end + +---Handles character input when editable +---@param char string The character that was typed +function ComboBox:char(char) end + +---Sets the value of the FocusedForeground property. +---@param self ComboBox self +---@param FocusedForeground color Foreground color when ComboBox is focused +function ComboBox:setFocusedForeground(self, FocusedForeground) end + +---Handles mouse clicks +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The mouse button (1 = left, 2 = right, 3 = middle) +---@param x number The x coordinate of the click +---@param y number The y coordinate of the click +---@return boolean handled Whether the event was handled +---@protected +function ComboBox:mouse_click(button, x, y) end + +---Gets the value of the PlaceholderColor property. +---@param self ComboBox self +---@return color gray Color of the placeholder text +function ComboBox:getPlaceholderColor(self) end + +---Gets the value of the FocusedBackground property. +---@param self ComboBox self +---@return color blue Background color when ComboBox is focused +function ComboBox:getFocusedBackground(self) end + +---Gets the value of the AutoComplete property. +---@param self ComboBox self +---@return boolean false Whether to enable auto-complete filtering when typing +function ComboBox:getAutoComplete(self) end + +---Gets the value of the ViewOffset property. +---@param self ComboBox self +---@return number 0 The horizontal scroll offset for viewing long text +function ComboBox:getViewOffset(self) end + +---Sets the value of the PlaceholderColor property. +---@param self ComboBox self +---@param PlaceholderColor color Color of the placeholder text +function ComboBox:setPlaceholderColor(self, PlaceholderColor) end + +---Renders the ComboBox +function ComboBox:render() end + +---Gets the value of the Placeholder property. +---@param self ComboBox self +---@return string "..." Text to display when input is empty +function ComboBox:getPlaceholder(self) end + +---Sets the value of the AutoComplete property. +---@param self ComboBox self +---@param AutoComplete boolean Whether to enable auto-complete filtering when typing +function ComboBox:setAutoComplete(self, AutoComplete) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return ComboBox self The initialized instance +---@protected +function ComboBox:init(props, basalt) end + +---Gets the value of the CursorPos property. +---@param self ComboBox self +---@return number 1 The current cursor position in the text +function ComboBox:getCursorPos(self) end + +---Gets the value of the FocusedForeground property. +---@param self ComboBox self +---@return color white Foreground color when ComboBox is focused +function ComboBox:getFocusedForeground(self) end + +---Creates a new ComboBox instance +---@return ComboBox self The newly created ComboBox instance +function ComboBox.new() end + +---Sets the value of the FocusedBackground property. +---@param self ComboBox self +---@param FocusedBackground color Background color when ComboBox is focused +function ComboBox:setFocusedBackground(self, FocusedBackground) end + +---Sets the value of the CursorPos property. +---@param self ComboBox self +---@param CursorPos number The current cursor position in the text +function ComboBox:setCursorPos(self, CursorPos) end + +---Sets the text content of the ComboBox +---@param text string The text to set +---@return ComboBox self +function ComboBox:setText(text) end + +---Sets the value of the Placeholder property. +---@param self ComboBox self +---@param Placeholder string Text to display when input is empty +function ComboBox:setPlaceholder(self, Placeholder) end + +---Handles key input when editable +---@param key number The key code that was pressed +---@param held boolean Whether the key is being held +function ComboBox:key(key, held) end + +---Sets the value of the ViewOffset property. +---@param self ComboBox self +---@param ViewOffset number The horizontal scroll offset for viewing long text +function ComboBox:setViewOffset(self, ViewOffset) end + +---Gets the current text content +---@return string text The current text +function ComboBox:getText() end + +---Gets the value of the ManuallyOpened property. +---@param self ComboBox self +---@return boolean false Whether the dropdown was manually opened (not by auto-complete) +function ComboBox:getManuallyOpened(self) end + +---Sets the value of the ManuallyOpened property. +---@param self ComboBox self +---@param ManuallyOpened boolean Whether the dropdown was manually opened (not by auto-complete) +function ComboBox:setManuallyOpened(self, ManuallyOpened) end + +---Called when the ComboBox loses focus +function ComboBox:blur() end + +---@class Tree : VisualElement +---@field nodeColor color Color of unselected nodes +---@field selectedColor color Background color of selected node +---@field scrollOffset number Current vertical scroll position +---@field expandedNodes table Table of nodes that are currently expanded +---@field horizontalOffset number Current horizontal scroll position +---@field nodes table The tree structure containing node objects with {text, children} properties +---@field selectedNode table nil Currently selected node +local Tree = {} + +---Gets the value of the ExpandedNodes property. +---@param self Tree self +---@return table {} Table of nodes that are currently expanded +function Tree:getExpandedNodes(self) end + +---Sets the value of the SelectedColor property. +---@param self Tree self +---@param SelectedColor color Background color of selected node +function Tree:setSelectedColor(self, SelectedColor) end + +---Handles mouse click events +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Tree:mouse_click(button, x, y) end + +---Sets the value of the HorizontalOffset property. +---@param self Tree self +---@param HorizontalOffset number Current horizontal scroll position +function Tree:setHorizontalOffset(self, HorizontalOffset) end + +---Sets the value of the ScrollOffset property. +---@param self Tree self +---@param ScrollOffset number Current vertical scroll position +function Tree:setScrollOffset(self, ScrollOffset) end + +---Gets the value of the SelectedNode property. +---@param self Tree self +---@return table ? nil Currently selected node +function Tree:getSelectedNode(self) end + +---Sets the value of the SelectedNode property. +---@param self Tree self +---@param SelectedNode table nil Currently selected node +function Tree:setSelectedNode(self, SelectedNode) end + +---Sets the value of the ExpandedNodes property. +---@param self Tree self +---@param ExpandedNodes table Table of nodes that are currently expanded +function Tree:setExpandedNodes(self, ExpandedNodes) end + +---Sets the value of the Nodes property. +---@param self Tree self +---@param Nodes table The tree structure containing node objects with {text, children} properties +function Tree:setNodes(self, Nodes) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Tree:render() end + +---Gets the value of the NodeColor property. +---@param self Tree self +---@return color white Color of unselected nodes +function Tree:getNodeColor(self) end + +---Gets the value of the Nodes property. +---@param self Tree self +---@return table {} The tree structure containing node objects with {text, children} properties +function Tree:getNodes(self) end + +---Toggles a node's expanded state +---@param node table The node to toggle +---@return Tree self The Tree instance +function Tree:toggleNode(node) end + +---Gets the size of the tree +---@return number width The width of the tree +---@return number height The height of the tree +function Tree:getNodeSize() end + +---Gets the value of the SelectedColor property. +---@param self Tree self +---@return color lightBlue Background color of selected node +function Tree:getSelectedColor(self) end + +---Expands a node +---@param node table The node to expand +---@return Tree self The Tree instance +function Tree:expandNode(node) end + +---Initializes the Tree instance +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Tree self The initialized instance +---@protected +function Tree:init(props, basalt) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param direction number The scroll direction (1 for up, -1 for down) +---@param x number The x position of the scroll +---@param y number The y position of the scroll +---@return boolean handled Whether the event was handled +---@protected +function Tree:mouse_scroll(direction, x, y) end + +---Sets the value of the NodeColor property. +---@param self Tree self +---@param NodeColor color Color of unselected nodes +function Tree:setNodeColor(self, NodeColor) end + +---Registers a callback for when a node is selected +---@param callback function The callback function +---@return Tree self The Tree instance +function Tree:onSelect(callback) end + +---Collapses a node +---@param node table The node to collapse +---@return Tree self The Tree instance +function Tree:collapseNode(node) end + +---Gets the value of the ScrollOffset property. +---@param self Tree self +---@return number 0 Current vertical scroll position +function Tree:getScrollOffset(self) end + +---Gets the value of the HorizontalOffset property. +---@param self Tree self +---@return number 0 Current horizontal scroll position +function Tree:getHorizontalOffset(self) end + +---@class TextBox : VisualElement +---@field scrollY number Vertical scroll offset +---@field scrollX number Horizontal scroll offset +---@field cursorY number Cursor Y position (line number) +---@field cursorColor number Color of the cursor +---@field syntaxPatterns table Syntax highlighting patterns +---@field cursorX number Cursor X position +---@field editable boolean Whether text can be edited +---@field lines table Array of text lines +local TextBox = {} + +---Gets the value of the CursorY property. +---@param self TextBox self +---@return number 1 Cursor Y position (line number) +function TextBox:getCursorY(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param char string The character that was typed +---@return boolean handled Whether the event was handled +---@protected +function TextBox:char(char) end + +---Gets the value of the CursorColor property. +---@param self TextBox self +---@return number nil Color of the cursor +function TextBox:getCursorColor(self) end + +---Sets the value of the Editable property. +---@param self TextBox self +---@param Editable boolean Whether text can be edited +function TextBox:setEditable(self, Editable) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function TextBox:render() end + +---Gets the value of the SyntaxPatterns property. +---@param self TextBox self +---@return table {} Syntax highlighting patterns +function TextBox:getSyntaxPatterns(self) end + +---Gets the value of the Lines property. +---@param self TextBox self +---@return table {} Array of text lines +function TextBox:getLines(self) end + +---Updates the viewport to keep the cursor in view +---@return TextBox self The TextBox instance +function TextBox:updateViewport() end + +---Sets the value of the CursorX property. +---@param self TextBox self +---@param CursorX number Cursor X position +function TextBox:setCursorX(self, CursorX) end + +---Sets the text of the TextBox +---@param text string The text to set +---@return TextBox self The TextBox instance +function TextBox:setText(text) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function TextBox:paste() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param key number The key that was pressed +---@return boolean handled Whether the event was handled +---@protected +function TextBox:key(key) end + +---Sets the value of the CursorY property. +---@param self TextBox self +---@param CursorY number Cursor Y position (line number) +function TextBox:setCursorY(self, CursorY) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param direction number The scroll direction +---@param x number The x position of the scroll +---@param y number The y position of the scroll +---@return boolean handled Whether the event was handled +---@protected +function TextBox:mouse_scroll(direction, x, y) end + +---Gets the value of the ScrollY property. +---@param self TextBox self +---@return number 0 Vertical scroll offset +function TextBox:getScrollY(self) end + +---Gets the value of the Editable property. +---@param self TextBox self +---@return boolean true Whether text can be edited +function TextBox:getEditable(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function TextBox:mouse_click(button, x, y) end + +---Gets the value of the ScrollX property. +---@param self TextBox self +---@return number 0 Horizontal scroll offset +function TextBox:getScrollX(self) end + +---Gets the text of the TextBox +---@return string text The text of the TextBox +function TextBox:getText() end + +---Sets the value of the SyntaxPatterns property. +---@param self TextBox self +---@param SyntaxPatterns table Syntax highlighting patterns +function TextBox:setSyntaxPatterns(self, SyntaxPatterns) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return TextBox self The initialized instance +---@protected +function TextBox:init(props, basalt) end + +---Adds a new syntax highlighting pattern +---@param pattern string The regex pattern to match +---@param color number The color to apply +---@return TextBox self The TextBox instance +function TextBox:addSyntaxPattern(pattern, color) end + +---Sets the value of the Lines property. +---@param self TextBox self +---@param Lines table Array of text lines +function TextBox:setLines(self, Lines) end + +---Removes a syntax pattern by index (1-based) +---@param index number The index of the pattern to remove +---@return TextBox self +function TextBox:removeSyntaxPattern(index) end + +---Clears all syntax highlighting patterns +---@return TextBox self +function TextBox:clearSyntaxPatterns() end + +---Gets the value of the CursorX property. +---@param self TextBox self +---@return number 1 Cursor X position +function TextBox:getCursorX(self) end + +---Sets the value of the ScrollY property. +---@param self TextBox self +---@param ScrollY number Vertical scroll offset +function TextBox:setScrollY(self, ScrollY) end + +---Sets the value of the ScrollX property. +---@param self TextBox self +---@param ScrollX number Horizontal scroll offset +function TextBox:setScrollX(self, ScrollX) end + +---Sets the value of the CursorColor property. +---@param self TextBox self +---@param CursorColor number Color of the cursor +function TextBox:setCursorColor(self, CursorColor) end + +---@class BaseElement : PropertySystem +---@field type string The type identifier of the element +---@field name string The name of the element +---@field id string The unique identifier for the element +---@field enabled boolean Whether the element is enabled or not +---@field eventCallbacks table The event callbacks for the element +local BaseElement = {} + +---Enables debugging for this element +---@param self BaseElement The element to debug +---@param level number The debug level +function BaseElement.debug(self, level) end + +---Gets the value of a state +---@param self BaseElement The element to get state from +---@param name string The name of the state +---@return any value The current state value +function BaseElement:getState(self, name) end + +---Enables or disables event listening for a specific event +---@param eventName string The name of the event to listen for +---@return table self The BaseElement instance +function BaseElement:listenEvent(eventName) end + +---Removes a state change observer +---@param self BaseElement The element to remove observer from +---@param stateName string The state to remove observer from +---@param callback function The callback function to remove +---@return BaseElement self The element instance +function BaseElement:removeStateChange(self, stateName, callback) end + +---Gets benchmark statistics for a method +---@param methodName string The name of the method to get statistics for +---@return table ? stats The benchmark statistics or nil +function BaseElement:getBenchmarkStats(methodName) end + +---Registers a callback function for an event +---@param event string The event to register the callback for +---@param callback function The callback function to register +---@return table self The BaseElement instance +function BaseElement:registerCallback(event, callback) end + +---Requests a render update for this element +---@return table self The BaseElement instance +function BaseElement:updateRender() end + +---Gets the value of the Id property. +---@param self BaseElement self +---@return string BaseElement The unique identifier for the element +function BaseElement:getId(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param event string The event to handle +---@return boolean ? handled Whether the event was handled +---@protected +function BaseElement:handleEvent(event) end + +---Returns the base frame of the element +---@return BaseFrame BaseFrame The base frame of the element +function BaseElement:getBaseFrame() end + +---Stops benchmarking for a method +---@param methodName string The name of the method to stop benchmarking +---@return BaseElement self The element instance +function BaseElement:stopBenchmark(methodName) end + +---Sets the value of the Type property. +---@param self BaseElement self +---@param Type string The type identifier of the element +function BaseElement:setType(self, Type) end + +---Gets the value of the EventCallbacks property. +---@param self BaseElement self +---@return table BaseElement The event callbacks for the element +function BaseElement:getEventCallbacks(self) end + +---Checks if the element is a specific type +---@param type string The type to check for +---@return boolean isType Whether the element is of the specified type +function BaseElement:isType(type) end + +---Registers a callback for state changes +---@param self BaseElement The element to watch +---@param stateName string The state to watch +---@param callback function Called with (element, newValue, oldValue) +---@return BaseElement self The element instance +function BaseElement:onStateChange(self, stateName, callback) end + +---Registers a new event listener for the element (on class level) +---@param class table The class to register +---@param eventName string The name of the event to register +function BaseElement.defineEvent(class, eventName) end + +---Gets the value of the Type property. +---@param self BaseElement self +---@return string BaseElement The type identifier of the element +function BaseElement:getType(self) end + +---Applies the current theme to this element +---@param self BaseElement The element to apply theme to +---@param applyToChildren boolean ? Whether to apply theme to child elements (default: true) +---@return BaseElement self The element instance +function BaseElement:applyTheme(self, applyToChildren) end + +---Sets the value of a state +---@param self BaseElement The element to set state for +---@param name string The name of the state +---@param value any The new value for the state +---@return BaseElement self The element instance +function BaseElement:setState(self, name, value) end + +---Gets the value of the Enabled property. +---@param self BaseElement self +---@return boolean BaseElement Whether the element is enabled or not +function BaseElement:getEnabled(self) end + +---Ends profiling a method +---@param methodName string The name of the method to stop profiling +---@return BaseElement self The element instance +function BaseElement:endProfile(methodName) end + +---Gets the theme properties for this element +---@param self BaseElement The element to get theme for +---@return table styles The theme properties +function BaseElement:getTheme(self) end + +---Destroys the element and cleans up all references +function BaseElement:destroy() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return table self The initialized instance +---@protected +function BaseElement:init(props, basalt) end + +---Starts profiling a method +---@param methodName string The name of the method to profile +---@return BaseElement self The element instance +function BaseElement:startProfile(methodName) end + +---Sets the value of the EventCallbacks property. +---@param self BaseElement self +---@param EventCallbacks table The event callbacks for the element +function BaseElement:setEventCallbacks(self, EventCallbacks) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@return table self The BaseElement instance +---@protected +function BaseElement:postInit() end + +---Gets the value of the Name property. +---@param self BaseElement self +---@return string BaseElement The name of the element +function BaseElement:getName(self) end + +---Sets the value of the Id property. +---@param self BaseElement self +---@param Id string The unique identifier for the element +function BaseElement:setId(self, Id) end + +---Sets the value of the Enabled property. +---@param self BaseElement self +---@param Enabled boolean Whether the element is enabled or not +function BaseElement:setEnabled(self, Enabled) end + +function BaseElement:computed() end + +---Binds a property to a state +---@param self BaseElement The element to bind +---@param propertyName string The property to bind +---@param stateName string The state to bind to (optional, uses propertyName if not provided) +---@return BaseElement self The element instance +function BaseElement:bind(self, propertyName, stateName) end + +---Observes a property and calls a callback when it changes +---@param property string The property to observe +---@param callback function The callback to call when the property changes +---@return table self The BaseElement instance +function BaseElement:onChange(property, callback) end + +---Enables benchmarking for a method +---@param methodName string The name of the method to benchmark +---@return BaseElement self The element instance +function BaseElement:benchmark(methodName) end + +---Dumps debug information for this element +---@param self BaseElement The element to dump debug info for +function BaseElement.dumpDebug(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param event string The event to handle +---@return boolean ? handled Whether the event was handled +---@protected +function BaseElement:dispatchEvent(event) end + +---Registers a new event callback for the element (on class level) +---@param class table The class to register +---@param callbackName string The name of the callback to register +function BaseElement.registerEventCallback(class, callbackName) end + +---Logs benchmark statistics for a method +---@param methodName string The name of the method to log +---@return BaseElement self The element instance +function BaseElement:logBenchmark(methodName) end + +---Triggers an event and calls all registered callbacks +---@param event string The event to fire +---@return table self The BaseElement instance +function BaseElement:fireEvent(event) end + +---Sets the value of the Name property. +---@param self BaseElement self +---@param Name string The name of the element +function BaseElement:setName(self, Name) end + +---@class PropertySystem +local PropertySystem = {} + +---Gets a property configuration +---@param name string The name of the property +---@return table config The configuration of the property +function PropertySystem:getPropertyConfig(name) end + +---Defines a property for an element class +---@param class table The element class to define the property for +---@param name string The name of the property +---@param config table The configuration of the property +function PropertySystem.defineProperty(class, name, config) end + +---Removes an observer from a property +---@param name string The name of the property +---@param callback function The callback function to remove +---@return table self The PropertySystem +function PropertySystem:removeObserver(name, callback) end + +---Removes all observers from a property +---@return table self The PropertySystem +function PropertySystem:removeAllObservers() end + +---Adds a setter hook to the PropertySystem. Setter hooks are functions that are called before a property is set. +---@param hook function The hook function to add +function PropertySystem.addSetterHook(hook) end + +---Observers a property +---@param name string The name of the property +---@param callback function The callback function to call when the property changes +---@return table self The PropertySystem +function PropertySystem:observe(name, callback) end + +---Creates an element from a blueprint +---@param elementClass table The element class to create from the blueprint +---@param blueprint table The blueprint to create the element from +---@return table element The created element +function PropertySystem.createFromBlueprint(elementClass, blueprint) end + +---Removes a property from the PropertySystem on instance level +---@param name string The name of the property +---@return table self The PropertySystem +function PropertySystem:removeProperty(name) end + +---Combines multiple properties into a single getter and setter +---@param class table The element class to combine the properties for +---@param name string The name of the combined property +function PropertySystem.combineProperties(class, name) end + +---Update call for a property IS USED INTERNALLY +---@param name string The name of the property +---@param value any The value of the property +---@return table self The PropertySystem +function PropertySystem:_updateProperty(name, value) end + +---Initializes the PropertySystem IS USED INTERNALLY +---@return table self The PropertySystem +function PropertySystem:__init() end + +---Creates a blueprint of an element class with all its properties +---@param elementClass table The element class to create a blueprint from +---@return table blueprint A table containing all property definitions +function PropertySystem.blueprint(elementClass) end + +---Adds a property to the PropertySystem on instance level +---@param name string The name of the property +---@param config table The configuration of the property +---@return table self The PropertySystem +function PropertySystem:instanceProperty(name, config) end + +---@class Reactive +local Reactive = {} + ---@class CheckBox : VisualElement ---@field text string Text to display ---@field autoSize boolean Whether to automatically size the checkbox ----@field checkedText string when checked ---@field checked boolean checkbox is checked +---@field checkedText string when checked local CheckBox = {} ----Sets the value of the Text property. ----@param self CheckBox self ----@param Text string Text to display -function CheckBox:setText(self, Text) end - ----Gets the value of the AutoSize property. ----@param self CheckBox self ----@return boolean true Whether to automatically size the checkbox -function CheckBox:getAutoSize(self) end - ----Sets the value of the AutoSize property. ----@param self CheckBox self ----@param AutoSize boolean Whether to automatically size the checkbox -function CheckBox:setAutoSize(self, AutoSize) end - ---Sets the value of the CheckedText property. ---@param self CheckBox self ---@param CheckedText string when checked function CheckBox:setCheckedText(self, CheckedText) end +---Sets the value of the AutoSize property. +---@param self CheckBox self +---@param AutoSize boolean Whether to automatically size the checkbox +function CheckBox:setAutoSize(self, AutoSize) end + +---Gets the value of the AutoSize property. +---@param self CheckBox self +---@return boolean true Whether to automatically size the checkbox +function CheckBox:getAutoSize(self) end + ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ---@protected function CheckBox:render() end ----Gets the value of the Checked property. ----@param self CheckBox self ----@return boolean Whether checkbox is checked -function CheckBox:getChecked(self) end - ----Gets the value of the CheckedText property. ----@param self CheckBox self ----@return string Text when checked -function CheckBox:getCheckedText(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@return CheckBox self The created instance ----@protected -function CheckBox.new() end - ---Gets the value of the Text property. ---@param self CheckBox self ---@return string empty Text to display function CheckBox:getText(self) end ----Sets the value of the Checked property. ----@param self CheckBox self ----@param Checked boolean checkbox is checked -function CheckBox:setChecked(self, Checked) end - ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ---@param button number The button that was clicked ---@param x number The x position of the click @@ -70,610 +1181,91 @@ function CheckBox:mouse_click(button, x, y) end ---@protected function CheckBox:init(props, basalt) end ----@class Reactive -local Reactive = {} - ----@class Frame : Container ----@field draggable boolean Whether the frame is draggable ----@field scrollable boolean Whether the frame is scrollable ----@field draggingMap table The map of dragging positions -local Frame = {} - ----Gets the value of the DraggingMap property. ----@param self Frame self ----@return table {} The map of dragging positions -function Frame:getDraggingMap(self) end - ----Sets the value of the Draggable property. ----@param self Frame self ----@param Draggable boolean Whether the frame is draggable -function Frame:setDraggable(self, Draggable) end - ----Gets the value of the Draggable property. ----@param self Frame self ----@return boolean false Whether the frame is draggable -function Frame:getDraggable(self) end - ----Sets the value of the Scrollable property. ----@param self Frame self ----@param Scrollable boolean Whether the frame is scrollable -function Frame:setScrollable(self, Scrollable) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param direction number The scroll direction ----@param x number The x position of the scroll ----@param y number The y position of the scroll ----@return boolean handled Whether the event was handled ----@protected -function Frame:mouse_scroll(direction, x, y) end - ----Sets the value of the DraggingMap property. ----@param self Frame self ----@param DraggingMap table The map of dragging positions -function Frame:setDraggingMap(self, DraggingMap) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the drag position ----@param y number The y position of the drag position ----@return boolean handled Whether the event was handled ----@protected -function Frame:mouse_drag(button, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@return number height The total height needed for all children ----@protected -function Frame:getChildrenHeight() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Frame:mouse_click(button, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was released ----@param x number The x position of the release ----@param y number The y position of the release ----@return boolean handled Whether the event was handled ----@protected -function Frame:mouse_up(button, x, y) end - ----Gets the value of the Scrollable property. ----@param self Frame self ----@return boolean false Whether the frame is scrollable -function Frame:getScrollable(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Frame self The initialized instance ----@protected -function Frame:init(props, basalt) end - ----@class Button : VisualElement ----@field text string Button text -local Button = {} - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@protected -function Button:init(props, basalt) end - ----Gets the value of the Text property. ----@param self Button self ----@return string Button Button text -function Button:getText(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Button:render() end +---Gets the value of the CheckedText property. +---@param self CheckBox self +---@return string Text when checked +function CheckBox:getCheckedText(self) end ---Sets the value of the Text property. ----@param self Button self ----@param Text string Button text -function Button:setText(self, Text) end - ----@class Switch : VisualElement ----@field onBackground number color when ON ----@field autoSize boolean to automatically size the element to fit switch and text ----@field text string to display next to switch ----@field offBackground number color when OFF ----@field checked boolean switch is checked -local Switch = {} - ----Sets the value of the Checked property. ----@param self Switch self ----@param Checked boolean switch is checked -function Switch:setChecked(self, Checked) end - ----Gets the value of the OffBackground property. ----@param self Switch self ----@return number Background color when OFF -function Switch:getOffBackground(self) end +---@param self CheckBox self +---@param Text string Text to display +function CheckBox:setText(self, Text) end ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance +---@return CheckBox self The created instance ---@protected -function Switch:init(props, basalt) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Switch:render() end - ----Sets the value of the OffBackground property. ----@param self Switch self ----@param OffBackground number color when OFF -function Switch:setOffBackground(self, OffBackground) end +function CheckBox.new() end ---Gets the value of the Checked property. ----@param self Switch self ----@return boolean Whether switch is checked -function Switch:getChecked(self) end - ----Sets the value of the OnBackground property. ----@param self Switch self ----@param OnBackground number color when ON -function Switch:setOnBackground(self, OnBackground) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean Whether the event was handled ----@protected -function Switch:mouse_click(button, x, y) end - ----Gets the value of the AutoSize property. ----@param self Switch self ----@return boolean Whether to automatically size the element to fit switch and text -function Switch:getAutoSize(self) end - ----Gets the value of the Text property. ----@param self Switch self ----@return string Text to display next to switch -function Switch:getText(self) end - ----Sets the value of the AutoSize property. ----@param self Switch self ----@param AutoSize boolean to automatically size the element to fit switch and text -function Switch:setAutoSize(self, AutoSize) end - ----Gets the value of the OnBackground property. ----@param self Switch self ----@return number Background color when ON -function Switch:getOnBackground(self) end - ----Sets the value of the Text property. ----@param self Switch self ----@param Text string to display next to switch -function Switch:setText(self, Text) end - ----@class TabControl : Container ----@field activeTabTextColor color color for the active tab text ----@field headerBackground color color for the tab header area ----@field activeTab number currently active tab ID ----@field activeTabBackground color color for the active tab ----@field tabs table of tab definitions ----@field tabHeight number of the tab header area -local TabControl = {} - -function TabControl:mouse_move() end - -function TabControl:multiBlit() end - -function TabControl:mouse_release() end - ----Gets the value of the HeaderBackground property. ----@param self TabControl self ----@return color Background color for the tab header area -function TabControl:getHeaderBackground(self) end - -function TabControl:_getHeaderMetrics() end - ----Gets the value of the ActiveTabBackground property. ----@param self TabControl self ----@return color Background color for the active tab -function TabControl:getActiveTabBackground(self) end - ----@param elementType string The type of element to add ----@param tabId number Optional tab ID, defaults to active tab ----@return table element The created element -function TabControl:addElement(elementType, tabId) end - -function TabControl:drawText() end - ----@param tabId number The ID of the tab to activate -function TabControl:setActiveTab(tabId) end - ----Sets the value of the ActiveTabBackground property. ----@param self TabControl self ----@param ActiveTabBackground color color for the active tab -function TabControl:setActiveTabBackground(self, ActiveTabBackground) end - ----Sets the value of the Tabs property. ----@param self TabControl self ----@param Tabs table of tab definitions -function TabControl:setTabs(self, Tabs) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@return number yOffset The Y offset for content ----@protected -function TabControl:getContentYOffset() end - -function TabControl:drawBg() end - -function TabControl:blit() end - ----Gets the value of the ActiveTab property. ----@param self TabControl self ----@return number The currently active tab ID -function TabControl:getActiveTab(self) end - -function TabControl:mouse_scroll() end - ----Gets the value of the ActiveTabTextColor property. ----@param self TabControl self ----@return color Foreground color for the active tab text -function TabControl:getActiveTabTextColor(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function TabControl:sortChildrenEvents() end - -function TabControl:drawFg() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function TabControl:render() end - ----@param element table The element to assign to a tab ----@param tabId number The ID of the tab to assign the element to ----@return TabControl self For method chaining -function TabControl:setTab(element, tabId) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param child table The child element to add ----@return Container self For method chaining ----@protected -function TabControl:addChild(child) end - -function TabControl:setCursor() end - ----Gets the value of the TabHeight property. ----@param self TabControl self ----@return number Height of the tab header area -function TabControl:getTabHeight(self) end - ----returns a proxy for adding elements to the tab ----@param title string The title of the tab ----@return table tabHandler The tab handler proxy for adding elements to the new tab -function TabControl:newTab(title) end - ----Sets the value of the TabHeight property. ----@param self TabControl self ----@param TabHeight number of the tab header area -function TabControl:setTabHeight(self, TabHeight) end - ----Sets the value of the HeaderBackground property. ----@param self TabControl self ----@param HeaderBackground color color for the tab header area -function TabControl:setHeaderBackground(self, HeaderBackground) end - -function TabControl:textBg() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@protected -function TabControl:init(props, basalt) end - -function TabControl:mouse_drag() end - -function TabControl:mouse_up() end - ----Gets the value of the Tabs property. ----@param self TabControl self ----@return table List of tab definitions -function TabControl:getTabs(self) end - ----Sets the value of the ActiveTabTextColor property. ----@param self TabControl self ----@param ActiveTabTextColor color color for the active tab text -function TabControl:setActiveTabTextColor(self, ActiveTabTextColor) end - -function TabControl:getRelativePosition() end - -function TabControl:textFg() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click (global) ----@param y number The y position of the click (global) ----@return boolean Whether the event was handled ----@protected -function TabControl:mouse_click(button, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param child table The child element to check ----@return boolean Whether the child should be visible ----@protected -function TabControl:isChildVisible(child) end - ----@class ElementManager -local ElementManager = {} - ----Gets an Plugin API by name ----@param name string The name of the API to get ----@return table API The API -function ElementManager.getAPI(name) end - ----Gets an element by name. If the element is not loaded, it will try to load it first. ----@param name string The name of the element to get ----@return table Element The element class -function ElementManager.getElement(name) end - ----Loads an element by name. This will load the element and apply any plugins to it. ----@param name string The name of the element to load -function ElementManager.loadElement(name) end - ----Gets a list of all elements ----@return table ElementList A list of all elements -function ElementManager.getElementList() end - ----@class Display : VisualElement -local Display = {} - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@protected -function Display:init(props, basalt) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Display:render() end - ----Writes text to the display at the given position with the given foreground and background colors ----@param x number The x position to write to ----@param y number The y position to write to ----@param text string The text to write ----@return Display self The display instance -function Display:write(x, y, text) end - ----Returns the current window object ----@return table window The current window object -function Display:getWindow() end - ----@class Timer : BaseElement ----@field interval number The interval in seconds at which the timer will trigger its action. ----@field running boolean Indicates whether the timer is currently running or not. ----@field amount number The amount of time the timer should run. ----@field action function The action to be performed when the timer triggers. -local Timer = {} - ----Starts the timer with the specified interval. ----@param self Timer The Timer instance to start ----@return Timer self The Timer instance -function Timer:start(self) end - ----Gets the value of the Action property. ----@param self Timer self ----@return function function The action to be performed when the timer triggers. -function Timer:getAction(self) end - ----Sets the value of the Running property. ----@param self Timer self ----@param Running boolean Indicates whether the timer is currently running or not. -function Timer:setRunning(self, Running) end - ----Gets the value of the Interval property. ----@param self Timer self ----@return number 1 The interval in seconds at which the timer will trigger its action. -function Timer:getInterval(self) end - ----Sets the value of the Amount property. ----@param self Timer self ----@param Amount number The amount of time the timer should run. -function Timer:setAmount(self, Amount) end - ----Gets the value of the Running property. ----@param self Timer self ----@return boolean false Indicates whether the timer is currently running or not. -function Timer:getRunning(self) end - ----Gets the value of the Amount property. ----@param self Timer self ----@return number -1 The amount of time the timer should run. -function Timer:getAmount(self) end - ----Stops the timer if it is currently running. ----@param self Timer The Timer instance to stop ----@return Timer self The Timer instance -function Timer:stop(self) end - ----Sets the value of the Action property. ----@param self Timer self ----@param Action function The action to be performed when the timer triggers. -function Timer:setAction(self, Action) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Timer:dispatchEvent() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@protected -function Timer:init(props, basalt) end - ----Sets the value of the Interval property. ----@param self Timer self ----@param Interval number The interval in seconds at which the timer will trigger its action. -function Timer:setInterval(self, Interval) end - ----@class ErrorHandler -local ErrorHandler = {} - ----Handles an error ----@param errMsg string The error message -function errorHandler.error(errMsg) end - ----@class Program : VisualElement ----@field path string The path to the program ----@field program table The program instance ----@field doneCallback function The done callback function ----@field running boolean Whether the program is running ----@field errorCallback function The error callback function -local Program = {} - ----Registers a callback for the program's done event ----@param fn function The callback function to register ----@return Program self The Program instance -function Program:onDone(fn) end - ----Gets the value of the Running property. ----@param self Program self ----@return boolean false Whether the program is running -function Program:getRunning(self) end - ----Sets the value of the Running property. ----@param self Program self ----@param Running boolean Whether the program is running -function Program:setRunning(self, Running) end - ----Sends an event to the program ----@param event string The event to send ----@return Program self The Program instance -function Program:sendEvent(event) end - ----Sets the value of the DoneCallback property. ----@param self Program self ----@param DoneCallback function The done callback function -function Program:setDoneCallback(self, DoneCallback) end - ----Sets the value of the Program property. ----@param self Program self ----@param Program table The program instance -function Program:setProgram(self, Program) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Program self The initialized instance ----@protected -function Program:init(props, basalt) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Program:focus() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Program:render() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param event string The event to handle ----@return any result The event result ----@protected -function Program:dispatchEvent(event) end - -function BasaltProgram:setArgs() end - ----Stops the program ----@return Program self The Program instance -function Program:stop() end - ----Gets the value of the DoneCallback property. ----@param self Program self ----@return function nil The done callback function -function Program:getDoneCallback(self) end - ----Sets the value of the Path property. ----@param self Program self ----@param Path string The path to the program -function Program:setPath(self, Path) end - ----Registers a callback for the program's error event, if the function returns false, the program won't stop ----@param fn function The callback function to register ----@return Program self The Program instance -function Program:onError(fn) end - ----Sets the value of the ErrorCallback property. ----@param self Program self ----@param ErrorCallback function The error callback function -function Program:setErrorCallback(self, ErrorCallback) end - ----Gets the value of the Path property. ----@param self Program self ----@return string "" The path to the program -function Program:getPath(self) end - ----Gets the value of the ErrorCallback property. ----@param self Program self ----@return function nil The error callback function -function Program:getErrorCallback(self) end - ----Gets the value of the Program property. ----@param self Program self ----@return table nil The program instance -function Program:getProgram(self) end - ----Executes a program ----@param path string The path to the program ----@return Program self The Program instance -function Program:execute(path) end +---@param self CheckBox self +---@return boolean Whether checkbox is checked +function CheckBox:getChecked(self) end + +---Sets the value of the Checked property. +---@param self CheckBox self +---@param Checked boolean checkbox is checked +function CheckBox:setChecked(self, Checked) end ---@class List : VisualElement ----@field selectedBackground color Background color for selected items ----@field items table List of items to display. Items can be tables with properties including selected state ---@field selectable boolean Whether items in the list can be selected ---@field selectedForeground color Text color for selected items ----@field offset number Current scroll offset for viewing long lists +---@field selectedBackground color Background color for selected items ---@field multiSelection boolean Whether multiple items can be selected at once +---@field items table List of items to display. Items can be tables with properties including selected state +---@field offset number Current scroll offset for viewing long lists local List = {} +---Clears all items from the list +---@return List self The List instance +function List:clear() end + ---Scrolls the list to the top ---@return List self The List instance function List:scrollToTop() end ----Gets the value of the Offset property. +---Gets the currently selected items +---@return table selected List of selected items +function List:getSelectedItems() end + +---Sets the value of the SelectedForeground property. ---@param self List self ----@return number 0 Current scroll offset for viewing long lists -function List:getOffset(self) end +---@param SelectedForeground color Text color for selected items +function List:setSelectedForeground(self, SelectedForeground) end + +---Gets the value of the MultiSelection property. +---@param self List self +---@return boolean false Whether multiple items can be selected at once +function List:getMultiSelection(self) end ---Gets the value of the SelectedBackground property. ---@param self List self ---@return color blue Background color for selected items function List:getSelectedBackground(self) end ----Gets the value of the Selectable property. +---Gets the value of the Items property. ---@param self List self ----@return boolean true Whether items in the list can be selected -function List:getSelectable(self) end +---@return table {} List of items to display. Items can be tables with properties including selected state +function List:getItems(self) end ----Gets first selected item ----@return table ? selected The first item -function List:getSelectedItem() end +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function List:render() end ----Registers a callback for the select event ----@param callback function The callback function to register ----@return List self The List instance -function List:onSelect(callback) end - ----Clears all items from the list ----@return List self The List instance -function List:clear() end +---Sets the value of the Offset property. +---@param self List self +---@param Offset number Current scroll offset for viewing long lists +function List:setOffset(self, Offset) end ---Sets the value of the Selectable property. ---@param self List self ---@param Selectable boolean Whether items in the list can be selected function List:setSelectable(self, Selectable) end +---Sets the value of the Items property. +---@param self List self +---@param Items table List of items to display. Items can be tables with properties including selected state +function List:setItems(self, Items) end + ---Gets the value of the SelectedForeground property. ---@param self List self ---@return color white Text color for selected items @@ -683,12 +1275,10 @@ function List:getSelectedForeground(self) end ---@return List self The List instance function List:scrollToBottom() end ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return List self The initialized instance ----@protected -function List:init(props, basalt) end +---Adds an item to the list +---@param text string |table The item to add (string or item table) +---@return List self The List instance +function List:addItem(text) end ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ---@param button number The mouse button that was clicked @@ -698,43 +1288,21 @@ function List:init(props, basalt) end ---@protected function List:mouse_click(button, x, y) end ----Gets the currently selected items ----@return table selected List of selected items -function List:getSelectedItems() end - ----Gets the value of the MultiSelection property. ----@param self List self ----@return boolean false Whether multiple items can be selected at once -function List:getMultiSelection(self) end - ----Removes an item from the list ----@param index number The index of the item to remove ----@return List self The List instance -function List:removeItem(index) end - ----Sets the value of the Items property. ----@param self List self ----@param Items table List of items to display. Items can be tables with properties including selected state -function List:setItems(self, Items) end - ----Adds an item to the list ----@param text string |table The item to add (string or item table) ----@return List self The List instance -function List:addItem(text) end - ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return List self The initialized instance ---@protected -function List:render() end +function List:init(props, basalt) end ----Gets the value of the Items property. ----@param self List self ----@return table {} List of items to display. Items can be tables with properties including selected state -function List:getItems(self) end +---Gets first selected item +---@return table ? selected The first item +function List:getSelectedItem() end ----Sets the value of the Offset property. +---Sets the value of the MultiSelection property. ---@param self List self ----@param Offset number Current scroll offset for viewing long lists -function List:setOffset(self, Offset) end +---@param MultiSelection boolean Whether multiple items can be selected at once +function List:setMultiSelection(self, MultiSelection) end ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ---@param direction number The direction of the scroll (1 for down, -1 for up) @@ -744,6 +1312,16 @@ function List:setOffset(self, Offset) end ---@protected function List:mouse_scroll(direction, x, y) end +---Gets the value of the Offset property. +---@param self List self +---@return number 0 Current scroll offset for viewing long lists +function List:getOffset(self) end + +---Gets the value of the Selectable property. +---@param self List self +---@return boolean true Whether items in the list can be selected +function List:getSelectable(self) end + ---Sets the value of the SelectedBackground property. ---@param self List self ---@param SelectedBackground color Background color for selected items @@ -756,41 +1334,22 @@ function List:setSelectedBackground(self, SelectedBackground) end ---@param func function The function to be called when the event fires function List:onOnSelect(self, func) end ----Sets the value of the MultiSelection property. ----@param self List self ----@param MultiSelection boolean Whether multiple items can be selected at once -function List:setMultiSelection(self, MultiSelection) end +---Removes an item from the list +---@param index number The index of the item to remove +---@return List self The List instance +function List:removeItem(index) end ----Sets the value of the SelectedForeground property. ----@param self List self ----@param SelectedForeground color Text color for selected items -function List:setSelectedForeground(self, SelectedForeground) end - ----@class ThemeAPI -local ThemeAPI = {} - ----Sets the current theme ----@param newTheme table The theme configuration to set -function ThemeAPI.setTheme(newTheme) end - ----Loads a theme from a JSON file ----@param path string Path to the theme JSON file -function ThemeAPI.loadTheme(path) end - ----Gets the current theme configuration ----@return table theme The current theme configuration -function ThemeAPI.getTheme() end +---Registers a callback for the select event +---@param callback function The callback function to register +---@return List self The List instance +function List:onSelect(callback) end ---@class Render local Render = {} ----Adds a dirty rectangle to the buffer ----@param x number The x position of the rectangle ----@param y number The y position of the rectangle ----@param width number The width of the rectangle ----@param height number The height of the rectangle +---Renders the buffer to the screen ---@return Render -function Render:addDirtyRect(x, y, width, height) end +function Render:render() end ---Checks if two rectangles overlap ---@param r1 table The first rectangle @@ -798,21 +1357,12 @@ function Render:addDirtyRect(x, y, width, height) end ---@return boolean function Render:rectOverlaps(r1, r2) end ----Blits a foreground color to the screen +---Blits a background color to the screen ---@param x number The x position ---@param y number The y position ----@param fg string The foreground color to blit +---@param bg string The background color to blit ---@return Render -function Render:fg(x, y, fg) end - ----Blits text to the screen ----@param x number The x position to blit to ----@param y number The y position to blit to ----@param text string The text to blit ----@param fg string The foreground color of the text ----@param bg string The background color of the text ----@return Render -function Render:blit(x, y, text, fg, bg) end +function Render:bg(x, y, bg) end ---Blits text to the screen with a background color ---@param x number The x position to blit to @@ -829,10 +1379,29 @@ function Render:textBg(x, y, text, bg) end ---@return Render function Render:text(x, y, text) end ----Clears the screen ----@param bg colors The background color to clear the screen with +---Gets the size of the render +---@return number , number +function Render:getSize() end + +---Blits a foreground color to the screen +---@param x number The x position +---@param y number The y position +---@param fg string The foreground color to blit ---@return Render -function Render:clear(bg) end +function Render:fg(x, y, fg) end + +---Merges two rectangles +---@param target table The target rectangle +---@param source table The source rectangle +---@return Render +function Render:mergeRects(target, source) end + +---Sets the cursor position +---@param x number The x position of the cursor +---@param y number The y position of the cursor +---@param blink boolean Whether the cursor should blink +---@return Render +function Render:setCursor(x, y, blink) end ---Blits text to the screen with multiple lines ---@param x number The x position to blit to @@ -845,16 +1414,29 @@ function Render:clear(bg) end ---@return Render function Render:multiBlit(x, y, width, height, text, fg, bg) end +---Adds a dirty rectangle to the buffer +---@param x number The x position of the rectangle +---@param y number The y position of the rectangle +---@param width number The width of the rectangle +---@param height number The height of the rectangle +---@return Render +function Render:addDirtyRect(x, y, width, height) end + +---Blits text to the screen +---@param x number The x position to blit to +---@param y number The y position to blit to +---@param text string The text to blit +---@param fg string The foreground color of the text +---@param bg string The background color of the text +---@return Render +function Render:blit(x, y, text, fg, bg) end + ---Sets the size of the render ---@param width number The width of the render ---@param height number The height of the render ---@return Render function Render:setSize(width, height) end ----Gets the size of the render ----@return number , number -function Render:getSize() end - ---Clears an area of the screen ---@param x number The x position of the area ---@param y number The y position of the area @@ -864,13 +1446,6 @@ function Render:getSize() end ---@return Render function Render:clearArea(x, y, width, height, bg) end ----Blits a background color to the screen ----@param x number The x position ----@param y number The y position ----@param bg string The background color to blit ----@return Render -function Render:bg(x, y, bg) end - ---Blits text to the screen with a foreground color ---@param x number The x position to blit to ---@param y number The y position to blit to @@ -879,43 +1454,2622 @@ function Render:bg(x, y, bg) end ---@return Render function Render:textFg(x, y, text, fg) end ----Renders the buffer to the screen +---Clears the screen +---@param bg colors The background color to clear the screen with ---@return Render -function Render:render() end - ----Sets the cursor position ----@param x number The x position of the cursor ----@param y number The y position of the cursor ----@param blink boolean Whether the cursor should blink ----@return Render -function Render:setCursor(x, y, blink) end - ----Merges two rectangles ----@param target table The target rectangle ----@param source table The source rectangle ----@return Render -function Render:mergeRects(target, source) end +function Render:clear(bg) end ---Creates a new Render object ---@param terminal table The terminal object to render to ---@return Render function Render.new(terminal) end +---@class Label : VisualElement +---@field text string The text content to display. Can be a string or a function that returns a string +---@field autoSize boolean Whether the label should automatically resize its width based on the text content +local Label = {} + +---Gets the wrapped lines of the Label +---@return table wrappedText The wrapped lines of the Label +function Label:getWrappedText() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Label:render() end + +---Gets the value of the AutoSize property. +---@param self Label self +---@return boolean true Whether the label should automatically resize its width based on the text content +function Label:getAutoSize(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Label self The initialized instance +---@protected +function Label:init(props, basalt) end + +---Gets the value of the Text property. +---@param self Label self +---@return string Label The text content to display. Can be a string or a function that returns a string +function Label:getText(self) end + +---Sets the value of the Text property. +---@param self Label self +---@param Text string The text content to display. Can be a string or a function that returns a string +function Label:setText(self, Text) end + +---Sets the value of the AutoSize property. +---@param self Label self +---@param AutoSize boolean Whether the label should automatically resize its width based on the text content +function Label:setAutoSize(self, AutoSize) end + +---@class Log +local Log = {} + +---Sends a debug message to the logger. +function Log.debug() end + +---Sends a warning message to the logger. +function Log.warn() end + +---Sets if the logger should log to a file. +function Log.setLogToFile() end + +---Sends an error message to the logger. +function Log.error() end + +---Sets if the logger should log +function Log.setEnabled() end + +---Sends an info message to the logger. +function Log.info() end + +---@class Switch : VisualElement +---@field text string to display next to switch +---@field checked boolean switch is checked +---@field offBackground number color when OFF +---@field autoSize boolean to automatically size the element to fit switch and text +---@field onBackground number color when ON +local Switch = {} + +---Gets the value of the OnBackground property. +---@param self Switch self +---@return number Background color when ON +function Switch:getOnBackground(self) end + +---Sets the value of the OnBackground property. +---@param self Switch self +---@param OnBackground number color when ON +function Switch:setOnBackground(self, OnBackground) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@protected +function Switch:init(props, basalt) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean Whether the event was handled +---@protected +function Switch:mouse_click(button, x, y) end + +---Sets the value of the Text property. +---@param self Switch self +---@param Text string to display next to switch +function Switch:setText(self, Text) end + +---Gets the value of the AutoSize property. +---@param self Switch self +---@return boolean Whether to automatically size the element to fit switch and text +function Switch:getAutoSize(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Switch:render() end + +---Sets the value of the OffBackground property. +---@param self Switch self +---@param OffBackground number color when OFF +function Switch:setOffBackground(self, OffBackground) end + +---Gets the value of the Text property. +---@param self Switch self +---@return string Text to display next to switch +function Switch:getText(self) end + +---Gets the value of the OffBackground property. +---@param self Switch self +---@return number Background color when OFF +function Switch:getOffBackground(self) end + +---Gets the value of the Checked property. +---@param self Switch self +---@return boolean Whether switch is checked +function Switch:getChecked(self) end + +---Sets the value of the AutoSize property. +---@param self Switch self +---@param AutoSize boolean to automatically size the element to fit switch and text +function Switch:setAutoSize(self, AutoSize) end + +---Sets the value of the Checked property. +---@param self Switch self +---@param Checked boolean switch is checked +function Switch:setChecked(self, Checked) end + +---@class Container : VisualElement +---@field offsetY number Vertical content offset +---@field childrenEventsSorted boolean Whether the children events are sorted +---@field childrenSorted boolean Whether the children are sorted +---@field focusedChild table The focused child of the container +---@field visibleChildren table The visible children of the container +---@field visibleChildrenEvents table The visible children events of the container +---@field childrenEvents table The children events of the container +---@field eventListenerCount table The event listener count of the container +---@field children table The children of the container +---@field offsetX number Horizontal content offset +local Container = {} + +---Sets the value of the VisibleChildrenEvents property. +---@param self Container self +---@param VisibleChildrenEvents table The visible children events of the container +function Container:setVisibleChildrenEvents(self, VisibleChildrenEvents) end + +---Adds a child to the container +---@param child table The child to add +---@return Container self The container instance +function Container:addChild(child) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param event string The event to handle +---@return boolean handled Whether the event was handled +---@protected +function Container:handleEvent(event) end + +function Container:drawBg() end + +---Creates a new Button element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Button element A new Button element. +function Container:addButton(self, props) end + +---Creates a new BigFont element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return BigFont element A new BigFont element. +function Container:addBigFont(self, props) end + +---Gets the value of the OffsetX property. +---@param self Container self +---@return number 0 Horizontal content offset +function Container:getOffsetX(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param char string The character that was pressed +---@return boolean handled Whether the event was handled +---@protected +function Container:char(char) end + +---Creates a new TabControl element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return TabControl element A new TabControl element. +function Container:addTabControl(self, props) end + +---Gets the value of the EventListenerCount property. +---@param self Container self +---@return table {} The event listener count of the container +function Container:getEventListenerCount(self) end + +---Creates a new Program element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Program element A new Program element. +function Container:addProgram(self, props) end + +---Creates a new Container element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Container element A new Container element. +function Container:addContainer(self, props) end + +---Registers the children events of the container +---@param child table The child to register events for +---@return Container self The container instance +function Container:registerChildrenEvents(child) end + +---Sets the value of the ChildrenSorted property. +---@param self Container self +---@param ChildrenSorted boolean Whether the children are sorted +function Container:setChildrenSorted(self, ChildrenSorted) end + +---Gets the value of the OffsetY property. +---@param self Container self +---@return number 0 Vertical content offset +function Container:getOffsetY(self) end + +---Stops benchmarking for a container and all its children +---@param methodName string The method to stop benchmarking +---@return Container self The container instance +function Container:stopContainerBenchmark(methodName) end + +---Creates a new CheckBox element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return CheckBox element A new CheckBox element. +function Container:addCheckBox(self, props) end + +---Creates a new Table element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Table element A new Table element. +function Container:addTable(self, props) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@protected +function Container:init(props, basalt) end + +---Gets the value of the ChildrenEvents property. +---@param self Container self +---@return table {} The children events of the container +function Container:getChildrenEvents(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to draw the text +---@param y number The y position to draw the text +---@param text string The text to draw +---@param bg color The background color of the text +---@return Container self The container instance +---@protected +function Container:textBg(x, y, text, bg) end + +---Sets the value of the VisibleChildren property. +---@param self Container self +---@param VisibleChildren table The visible children of the container +function Container:setVisibleChildren(self, VisibleChildren) end + +---Creates a new ScrollBar element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return ScrollBar element A new ScrollBar element. +function Container:addScrollBar(self, props) end + +---Creates a new Switch element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Switch element A new Switch element. +function Container:addSwitch(self, props) end + +---Removes a child from the container +---@param child table The child to remove +---@return Container self The container instance +function Container:removeChild(child) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@protected +function Container:mouse_release(button, x, y) end + +---Creates a new Display element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Display element A new Display element. +function Container:addDisplay(self, props) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param key number The key that was pressed +---@return boolean handled Whether the event was handled +---@protected +function Container:key(key) end + +---Creates a new Graph element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Graph element A new Graph element. +function Container:addGraph(self, props) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to draw the text +---@param y number The y position to draw the text +---@param text string The text to draw +---@param fg color The foreground color of the text +---@return Container self The container instance +---@protected +function Container:textFg(x, y, text, fg) end + +---Creates a new FlexBox element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return FlexBox element A new FlexBox element. +function Container:addFlexBox(self, props) end + +---Logs benchmark statistics for a container and all its children +---@param methodName string The method to log +---@return Container self The container instance +function Container:logContainerBenchmarks(methodName) end + +---Returns whether a child is visible +---@param child table The child to check +---@return boolean boolean the child is visible +function Container:isChildVisible(child) end + +---Enables debugging for this container and all its children +---@param self Container The container to debug +---@param level number The debug level +function Container.debugChildren(self, level) end + +---Sets the value of the EventListenerCount property. +---@param self Container self +---@param EventListenerCount table The event listener count of the container +function Container:setEventListenerCount(self, EventListenerCount) end + +---Creates a new Image element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Image element A new Image element. +function Container:addImage(self, props) end + +---Clears the container +---@return Container self The container instance +function Container:clear() end + +---Sorts the children of the container +---@return Container self The container instance +function Container:sortChildren() end + +---Creates a new List element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return List element A new List element. +function Container:addList(self, props) end + +---Calls a event on all children +---@param visibleOnly boolean Whether to only call the event on visible children +---@param event string The event to call +---@return boolean handled Whether the event was handled +---@return table ? child The child that handled the event +function Container:callChildrenEvent(visibleOnly, event) end + +---Creates a new Input element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Input element A new Input element. +function Container:addInput(self, props) end + +---Unregisters the children events of the container +---@param child table The child to unregister events for +---@return Container self The container instance +function Container:removeChildrenEvents(child) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to draw the text +---@param y number The y position to draw the text +---@param text string The text to draw +---@param fg string The foreground color of the text +---@param bg string The background color of the text +---@return Container self The container instance +---@protected +function Container:blit(x, y, text, fg, bg) end + +---Creates a new ComboBox element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return ComboBox element A new ComboBox element. +function Container:addComboBox(self, props) end + +---Gets the value of the VisibleChildren property. +---@param self Container self +---@return table {} The visible children of the container +function Container:getVisibleChildren(self) end + +---Gets the value of the VisibleChildrenEvents property. +---@param self Container self +---@return table {} The visible children events of the container +function Container:getVisibleChildrenEvents(self) end + +---Creates a new LineChart element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return LineChart element A new LineChart element. +function Container:addLineChart(self, props) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Container:mouse_click(button, x, y) end + +---Creates a new ProgressBar element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return ProgressBar element A new ProgressBar element. +function Container:addProgressBar(self, props) end + +---Creates a new Timer element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Timer element A new Timer element. +function Container:addTimer(self, props) end + +function Container:drawText() end + +---Creates a new Slider element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Slider element A new Slider element. +function Container:addSlider(self, props) end + +---Gets the value of the ChildrenEventsSorted property. +---@param self Container self +---@return boolean true Whether the children events are sorted +function Container:getChildrenEventsSorted(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param _ number unknown +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Container:mouse_move(_, x, y) end + +---Creates a new Menu element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Menu element A new Menu element. +function Container:addMenu(self, props) end + +---Sets the value of the ChildrenEventsSorted property. +---@param self Container self +---@param ChildrenEventsSorted boolean Whether the children events are sorted +function Container:setChildrenEventsSorted(self, ChildrenEventsSorted) end + +---Gets the value of the FocusedChild property. +---@param self Container self +---@return table nil The focused child of the container +function Container:getFocusedChild(self) end + +---Gets the value of the Children property. +---@param self Container self +---@return table {} The children of the container +function Container:getChildren(self) end + +---Creates a new BaseFrame element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return BaseFrame element A new BaseFrame element. +function Container:addBaseFrame(self, props) end + +---Creates a new BaseElement element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return BaseElement element A new BaseElement element. +function Container:addBaseElement(self, props) end + +---Creates a new Label element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Label element A new Label element. +function Container:addLabel(self, props) end + +---Sets the value of the ChildrenEvents property. +---@param self Container self +---@param ChildrenEvents table The children events of the container +function Container:setChildrenEvents(self, ChildrenEvents) end + +---Creates a new TextBox element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return TextBox element A new TextBox element. +function Container:addTextBox(self, props) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to draw the text +---@param y number The y position to draw the text +---@param width number The width of the text +---@param height number The height of the text +---@param text string The text to draw +---@param fg string The foreground color of the text +---@param bg string The background color of the text +---@return Container self The container instance +---@protected +function Container:multiBlit(x, y, width, height, text, fg, bg) end + +---Sets the value of the OffsetX property. +---@param self Container self +---@param OffsetX number Horizontal content offset +function Container:setOffsetX(self, OffsetX) end + +---Sets the value of the Children property. +---@param self Container self +---@param Children table The children of the container +function Container:setChildren(self, Children) end + +---Creates a new DropDown element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return DropDown element A new DropDown element. +function Container:addDropDown(self, props) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Container:mouse_up(button, x, y) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param direction number The direction of the scroll +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Container:mouse_scroll(direction, x, y) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Container:mouse_drag(button, x, y) end + +---Unregisters the children events of the container +---@param child table The child to unregister events for +---@param eventName string The event name to unregister +---@return Container self The container instance +function Container:unregisterChildEvent(child, eventName) end + +---Sets the value of the OffsetY property. +---@param self Container self +---@param OffsetY number Vertical content offset +function Container:setOffsetY(self, OffsetY) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Container:render() end + +---Sorts the children events of the container +---@param eventName string The event name to sort +---@return Container self The container instance +function Container:sortChildrenEvents(eventName) end + +---Removes a child from the container +---@param path string The path to the child to remove +---@return Container ? self The container instance +function Container:getChild(path) end + +---Enables benchmarking for a container and all its children +---@param methodName string The method to benchmark +---@return Container self The container instance +function Container:benchmarkContainer(methodName) end + +---Creates a new Tree element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Tree element A new Tree element. +function Container:addTree(self, props) end + +---Creates a new Frame element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return Frame element A new Frame element. +function Container:addFrame(self, props) end + +---Creates a new BarChart element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return BarChart element A new BarChart element. +function Container:addBarChart(self, props) end + +---Registers the children events of the container +---@param child table The child to register events for +---@param eventName string The event name to register +---@return Container self The container instance +function Container:registerChildEvent(child, eventName) end + +---Sets the value of the FocusedChild property. +---@param self Container self +---@param FocusedChild table The focused child of the container +function Container:setFocusedChild(self, FocusedChild) end + +---Gets the value of the ChildrenSorted property. +---@param self Container self +---@return boolean true Whether the children are sorted +function Container:getChildrenSorted(self) end + +---Creates a new VisualElement element. +---@param self Container self +---@param props? table Optional: properties for the element. +---@return VisualElement element A new VisualElement element. +function Container:addVisualElement(self, props) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param key number The key that was released +---@return boolean handled Whether the event was handled +---@protected +function Container:key_up(key) end + +function Container:drawFg() end + +---@class BigFont : VisualElement +---@field text string BigFont text +---@field fontSize number The font size of the BigFont +local BigFont = {} + +---Gets the value of the FontSize property. +---@param self BigFont self +---@return number 1 The font size of the BigFont +function BigFont:getFontSize(self) end + +---Sets the value of the Text property. +---@param self BigFont self +---@param Text string BigFont text +function BigFont:setText(self, Text) end + +---Gets the value of the Text property. +---@param self BigFont self +---@return string BigFont BigFont text +function BigFont:getText(self) end + +---Sets the value of the FontSize property. +---@param self BigFont self +---@param FontSize number The font size of the BigFont +function BigFont:setFontSize(self, FontSize) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function BigFont:render() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@protected +function BigFont:init(props, basalt) end + +---@class TabControl : Container +---@field tabs table of tab definitions +---@field activeTabBackground color color for the active tab +---@field headerBackground color color for the tab header area +---@field tabHeight number of the tab header area +---@field activeTab number currently active tab ID +---@field activeTabTextColor color color for the active tab text +local TabControl = {} + +function TabControl:_getHeaderMetrics() end + +---Sets the value of the ActiveTabBackground property. +---@param self TabControl self +---@param ActiveTabBackground color color for the active tab +function TabControl:setActiveTabBackground(self, ActiveTabBackground) end + +function TabControl:setCursor() end + +---Gets the value of the HeaderBackground property. +---@param self TabControl self +---@return color Background color for the tab header area +function TabControl:getHeaderBackground(self) end + +function TabControl:getRelativePosition() end + +function TabControl:drawFg() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@protected +function TabControl:init(props, basalt) end + +function TabControl:mouse_move() end + +function TabControl:mouse_release() end + +---@param element table The element to assign to a tab +---@param tabId number The ID of the tab to assign the element to +---@return TabControl self For method chaining +function TabControl:setTab(element, tabId) end + +function TabControl:drawBg() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function TabControl:sortChildrenEvents() end + +function TabControl:mouse_up() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param child table The child element to check +---@return boolean Whether the child should be visible +---@protected +function TabControl:isChildVisible(child) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click (global) +---@param y number The y position of the click (global) +---@return boolean Whether the event was handled +---@protected +function TabControl:mouse_click(button, x, y) end + +---Gets the value of the ActiveTab property. +---@param self TabControl self +---@return number The currently active tab ID +function TabControl:getActiveTab(self) end + +function TabControl:textBg() end + +function TabControl:drawText() end + +---Sets the value of the HeaderBackground property. +---@param self TabControl self +---@param HeaderBackground color color for the tab header area +function TabControl:setHeaderBackground(self, HeaderBackground) end + +---Sets the value of the TabHeight property. +---@param self TabControl self +---@param TabHeight number of the tab header area +function TabControl:setTabHeight(self, TabHeight) end + +---Gets the value of the TabHeight property. +---@param self TabControl self +---@return number Height of the tab header area +function TabControl:getTabHeight(self) end + +---Gets the value of the ActiveTabBackground property. +---@param self TabControl self +---@return color Background color for the active tab +function TabControl:getActiveTabBackground(self) end + +---@param elementType string The type of element to add +---@param tabId number Optional tab ID, defaults to active tab +---@return table element The created element +function TabControl:addElement(elementType, tabId) end + +---@param tabId number The ID of the tab to activate +function TabControl:setActiveTab(tabId) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function TabControl:render() end + +function TabControl:multiBlit() end + +function TabControl:mouse_scroll() end + +---Sets the value of the ActiveTabTextColor property. +---@param self TabControl self +---@param ActiveTabTextColor color color for the active tab text +function TabControl:setActiveTabTextColor(self, ActiveTabTextColor) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@return number yOffset The Y offset for content +---@protected +function TabControl:getContentYOffset() end + +function TabControl:mouse_drag() end + +function TabControl:textFg() end + +---Gets the value of the ActiveTabTextColor property. +---@param self TabControl self +---@return color Foreground color for the active tab text +function TabControl:getActiveTabTextColor(self) end + +function TabControl:blit() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param child table The child element to add +---@return Container self For method chaining +---@protected +function TabControl:addChild(child) end + +---Sets the value of the Tabs property. +---@param self TabControl self +---@param Tabs table of tab definitions +function TabControl:setTabs(self, Tabs) end + +---returns a proxy for adding elements to the tab +---@param title string The title of the tab +---@return table tabHandler The tab handler proxy for adding elements to the new tab +function TabControl:newTab(title) end + +---Gets the value of the Tabs property. +---@param self TabControl self +---@return table List of tab definitions +function TabControl:getTabs(self) end + +---@class Program : VisualElement +---@field errorCallback function The error callback function +---@field path string The path to the program +---@field doneCallback function The done callback function +---@field program table The program instance +---@field running boolean Whether the program is running +local Program = {} + +---Sets the value of the DoneCallback property. +---@param self Program self +---@param DoneCallback function The done callback function +function Program:setDoneCallback(self, DoneCallback) end + +---Executes a program +---@param path string The path to the program +---@return Program self The Program instance +function Program:execute(path) end + +---Sends an event to the program +---@param event string The event to send +---@return Program self The Program instance +function Program:sendEvent(event) end + +---Sets the value of the Path property. +---@param self Program self +---@param Path string The path to the program +function Program:setPath(self, Path) end + +---Sets the value of the Running property. +---@param self Program self +---@param Running boolean Whether the program is running +function Program:setRunning(self, Running) end + +---Registers a callback for the program's error event, if the function returns false, the program won't stop +---@param fn function The callback function to register +---@return Program self The Program instance +function Program:onError(fn) end + +---Gets the value of the Path property. +---@param self Program self +---@return string "" The path to the program +function Program:getPath(self) end + +---Stops the program +---@return Program self The Program instance +function Program:stop() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Program:render() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Program:focus() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param event string The event to handle +---@return any result The event result +---@protected +function Program:dispatchEvent(event) end + +---Gets the value of the ErrorCallback property. +---@param self Program self +---@return function nil The error callback function +function Program:getErrorCallback(self) end + +---Registers a callback for the program's done event +---@param fn function The callback function to register +---@return Program self The Program instance +function Program:onDone(fn) end + +---Gets the value of the DoneCallback property. +---@param self Program self +---@return function nil The done callback function +function Program:getDoneCallback(self) end + +---Sets the value of the ErrorCallback property. +---@param self Program self +---@param ErrorCallback function The error callback function +function Program:setErrorCallback(self, ErrorCallback) end + +---Sets the value of the Program property. +---@param self Program self +---@param Program table The program instance +function Program:setProgram(self, Program) end + +---Gets the value of the Running property. +---@param self Program self +---@return boolean false Whether the program is running +function Program:getRunning(self) end + +function BasaltProgram:setArgs() end + +---Gets the value of the Program property. +---@param self Program self +---@return table nil The program instance +function Program:getProgram(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Program self The initialized instance +---@protected +function Program:init(props, basalt) end + +---@class VisualElement : BaseElement +---@field clicked boolean Whether the element is currently clicked +---@field y number The vertical position relative to parent +---@field x number The horizontal position relative to parent +---@field background color The background color +---@field backgroundEnabled boolean Whether to render the background +---@field foreground color The text/foreground color +---@field width number The width of the element +---@field z number The z-index for layering elements +---@field height number The height of the element +---@field visible boolean Whether the element is visible +---@field hover boolean Whether the mouse is currently hover over the element (Craftos-PC only) +---@field focused boolean Whether the element has input focus +---@field ignoreOffset boolean Whether to ignore the parent's offset +local VisualElement = {} + +---Registers a function to handle the onChar event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnChar(self, func) end + +---Calculates the position of the element relative to its parent +---@return number x The x position +---@return number y The y position +function VisualElement:calculatePosition() end + +---Sets the value of the Hover property. +---@param self VisualElement self +---@param Hover boolean Whether the mouse is currently hover over the element (Craftos-PC only) +function VisualElement:setHover(self, Hover) end + +---Registers a function to handle the onBlur event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnBlur(self, func) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function VisualElement:postRender() end + +function VisualElement:drawFg() end + +---Registers a function to handle the onClick event. +---@param button string +---@param x number +---@param y number +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnClick(self, func) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to draw +---@param y number The y position to draw +---@param width number The width of the area to draw +---@param height number The height of the area to draw +---@param text string The text to draw +---@param fg string The foreground color +---@param bg string The background color +---@protected +function VisualElement:multiBlit(x, y, width, height, text, fg, bg) end + +---Registers a function to handle the onLeave event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnLeave(self, func) end + +---Checks if the specified coordinates are within the bounds of the element +---@param x number The x position to check +---@param y number The y position to check +---@return boolean isInBounds Whether the coordinates are within the bounds of the element +function VisualElement:isInBounds(x, y) end + +---Registers a function to handle the onEnter event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnEnter(self, func) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to draw +---@param y number The y position to draw +---@param text string The text char to draw +---@param fg string The foreground color +---@param bg string The background color +---@protected +function VisualElement:blit(x, y, text, fg, bg) end + +---Registers a function to handle the onScroll event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnScroll(self, func) end + +---Gets the value of the Y property. +---@param self VisualElement self +---@return number 1 The vertical position relative to parent +function VisualElement:getY(self) end + +---Sets the value of the Clicked property. +---@param self VisualElement self +---@param Clicked boolean Whether the element is currently clicked +function VisualElement:setClicked(self, Clicked) end + +---Gets the value of the BackgroundEnabled property. +---@param self VisualElement self +---@return boolean true Whether to render the background +function VisualElement:getBackgroundEnabled(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was released +---@param x number The x position of the release +---@param y number The y position of the release +---@return boolean release Whether the element was released on the element +---@protected +function VisualElement:mouse_up(button, x, y) end + +---Sets the value of the Height property. +---@param self VisualElement self +---@param Height number The height of the element +function VisualElement:setHeight(self, Height) end + +---Registers a function to handle the onMouseUp event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnMouseUp(self, func) end + +---Creates a new Animation Object +---@return Animation animation The new animation +function VisualElement:animate() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param key number The key that was pressed +---@protected +function VisualElement:key(key) end + +---Sets the value of the Visible property. +---@param self VisualElement self +---@param Visible boolean Whether the element is visible +function VisualElement:setVisible(self, Visible) end + +---Returns the relative position of the element or the given coordinates. +---@return number x The relative x position +---@return number y The relative y position +function VisualElement:getRelativePosition() end + +---Sets the value of the X property. +---@param self VisualElement self +---@param X number The horizontal position relative to parent +function VisualElement:setX(self, X) end + +---Gets the value of the IgnoreOffset property. +---@param self VisualElement self +---@return boolean false Whether to ignore the parent's offset +function VisualElement:getIgnoreOffset(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to draw +---@param y number The y position to draw +---@param text string The text char to draw +---@param fg color The foreground color +---@protected +function VisualElement:textFg(x, y, text, fg) end + +function VisualElement:drawText() end + +---Sets the value of the Focused property. +---@param self VisualElement self +---@param Focused boolean Whether the element has input focus +function VisualElement:setFocused(self, Focused) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position of the cursor +---@param y number The y position of the cursor +---@param blink boolean Whether the cursor should blink +---@param color number The color of the cursor +---@return VisualElement self The VisualElement instance +---@protected +function VisualElement:setCursor(x, y, blink, color) end + +---Registers a function to handle the onKeyUp event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnKeyUp(self, func) end + +---Gets the value of the Visible property. +---@param self VisualElement self +---@return boolean true Whether the element is visible +function VisualElement:getVisible(self) end + +---Sets the value of the Background property. +---@param self VisualElement self +---@param Background color The background color +function VisualElement:setBackground(self, Background) end + +---Convenience to stop animations from the element +function VisualElement.stopAnimation() end + +---Gets the value of the Z property. +---@param self VisualElement self +---@return number 1 The z-index for layering elements +function VisualElement:getZ(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean clicked Whether the element was clicked +---@protected +function VisualElement:mouse_click(button, x, y) end + +---Sets the value of the Foreground property. +---@param self VisualElement self +---@param Foreground color The text/foreground color +function VisualElement:setForeground(self, Foreground) end + +---Gets the value of the Height property. +---@param self VisualElement self +---@return number 1 The height of the element +function VisualElement:getHeight(self) end + +---Sets the value of the IgnoreOffset property. +---@param self VisualElement self +---@param IgnoreOffset boolean Whether to ignore the parent's offset +function VisualElement:setIgnoreOffset(self, IgnoreOffset) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param _ number unknown +---@param x number The x position of the mouse +---@param y number The y position of the mouse +---@return boolean hover Whether the mouse has moved over the element +---@protected +function VisualElement:mouse_move(_, x, y) end + +---Sets the value of the BackgroundEnabled property. +---@param self VisualElement self +---@param BackgroundEnabled boolean Whether to render the background +function VisualElement:setBackgroundEnabled(self, BackgroundEnabled) end + +---Sets the value of the Z property. +---@param self VisualElement self +---@param Z number The z-index for layering elements +function VisualElement:setZ(self, Z) end + +---Gets the value of the Width property. +---@param self VisualElement self +---@return number 1 The width of the element +function VisualElement:getWidth(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param key number The key that was released +---@protected +function VisualElement:key_up(key) end + +---Gets the value of the Background property. +---@param self VisualElement self +---@return color black The background color +function VisualElement:getBackground(self) end + +---Gets the value of the X property. +---@param self VisualElement self +---@return number 1 The horizontal position relative to parent +function VisualElement:getX(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param char string The character that was pressed +---@protected +function VisualElement:char(char) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked while dragging +---@param x number The x position of the drag +---@param y number The y position of the drag +---@return boolean drag Whether the element was dragged +---@protected +function VisualElement:mouse_drag(button, x, y) end + +---Gets the value of the Hover property. +---@param self VisualElement self +---@return boolean false Whether the mouse is currently hover over the element (Craftos-PC only) +function VisualElement:getHover(self) end + +---Gets the value of the Foreground property. +---@param self VisualElement self +---@return color white The text/foreground color +function VisualElement:getForeground(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param x number The x position to draw +---@param y number The y position to draw +---@param text string The text char to draw +---@param bg color The background color +---@protected +function VisualElement:textBg(x, y, text, bg) end + +---Gets the value of the Focused property. +---@param self VisualElement self +---@return boolean false Whether the element has input focus +function VisualElement:getFocused(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@protected +function VisualElement:init(props, basalt) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was released +---@param x number The x position of the release +---@param y number The y position of the release +---@protected +function VisualElement:mouse_release(button, x, y) end + +---Registers a function to handle the onRelease event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnRelease(self, func) end + +---Returns the absolute position of the element or the given coordinates. +---@return number x The absolute x position +---@return number y The absolute y position +function VisualElement:getAbsolutePosition() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function VisualElement:render() end + +function VisualElement:destroy() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function VisualElement:blur() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param direction number The scroll direction +---@param x number The x position of the scroll +---@param y number The y position of the scroll +---@return boolean scroll Whether the element was scrolled +---@protected +function VisualElement:mouse_scroll(direction, x, y) end + +---Registers a function to handle the onDrag event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnDrag(self, func) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function VisualElement:focus() end + +---This function is used to prioritize the element by moving it to the top of its parent's children. It removes the element from its parent and adds it back, effectively changing its order. +---@return VisualElement self The VisualElement instance +function VisualElement:prioritize() end + +---Registers a function to handle the onKey event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnKey(self, func) end + +---Registers a function to handle the onFocus event. +---@param self VisualElement self +---@param func function The function to be called when the event fires +function VisualElement:onOnFocus(self, func) end + +---Sets the value of the Width property. +---@param self VisualElement self +---@param Width number The width of the element +function VisualElement:setWidth(self, Width) end + +function VisualElement:drawBg() end + +---Gets the value of the Clicked property. +---@param self VisualElement self +---@return boolean false Whether the element is currently clicked +function VisualElement:getClicked(self) end + +---Sets the value of the Y property. +---@param self VisualElement self +---@param Y number The vertical position relative to parent +function VisualElement:setY(self, Y) end + +---@class ErrorHandler +local ErrorHandler = {} + +---Handles an error +---@param errMsg string The error message +function errorHandler.error(errMsg) end + +---@class Image : VisualElement +---@field autoResize boolean Whether to automatically resize the image when content exceeds bounds +---@field offsetX number Horizontal offset for viewing larger images +---@field bimg table The bimg image data +---@field offsetY number Vertical offset for viewing larger images +---@field currentFrame number Current animation frame +local Image = {} + +---Sets the value of the OffsetX property. +---@param self Image self +---@param OffsetX number Horizontal offset for viewing larger images +function Image:setOffsetX(self, OffsetX) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Image:render() end + +---Gets the size of the image +---@return number width The width of the image +---@return number height The height of the image +function Image:getImageSize() end + +---Gets the value of the Bimg property. +---@param self Image self +---@return table {} The bimg image data +function Image:getBimg(self) end + +---Sets the value of the CurrentFrame property. +---@param self Image self +---@param CurrentFrame number Current animation frame +function Image:setCurrentFrame(self, CurrentFrame) end + +---Sets the value of the Bimg property. +---@param self Image self +---@param Bimg table The bimg image data +function Image:setBimg(self, Bimg) end + +---Sets the background color at the specified position +---@param x number The x position +---@param y number The y position +---@param pattern string The background color pattern +---@return Image self The Image instance +function Image:setBg(x, y, pattern) end + +---Updates the specified frame with the provided data +---@param frameIndex number The index of the frame to update +---@param frame table The new frame data +---@return Image self The Image instance +function Image:updateFrame(frameIndex, frame) end + +---Gets the value of the OffsetX property. +---@param self Image self +---@return number 0 Horizontal offset for viewing larger images +function Image:getOffsetX(self) end + +---Advances to the next frame in the animation +---@return Image self The Image instance +function Image:nextFrame() end + +---Sets the value of the AutoResize property. +---@param self Image self +---@param AutoResize boolean Whether to automatically resize the image when content exceeds bounds +function Image:setAutoResize(self, AutoResize) end + +---Gets the metadata of the image +---@return table metadata The metadata of the image +function Image:getMetadata() end + +---Sets the text at the specified position +---@param x number The x position +---@param y number The y position +---@param text string The text to set +---@return Image self The Image instance +function Image:setText(x, y, text) end + +---Gets the specified frame +---@param frameIndex number The index of the frame to get +---@return table frame The frame data +function Image:getFrame(frameIndex) end + +---Sets the foreground color at the specified position +---@param x number The x position +---@param y number The y position +---@param pattern string The foreground color pattern +---@return Image self The Image instance +function Image:setFg(x, y, pattern) end + +---Adds a new frame to the image +---@return Image self The Image instance +function Image:addFrame() end + +---Gets pixel information at position +---@param x number X position +---@param y number Y position +---@return number ? fg Foreground color +---@return number ? bg Background color +---@return string ? char Character at position +function Image:getPixelData(x, y) end + +---Sets the metadata of the image +---@param key string The key of the metadata to set +---@param value string The value of the metadata to set +---@return Image self The Image instance +function Image:setMetadata(key, value) end + +---Gets the value of the OffsetY property. +---@param self Image self +---@return number 0 Vertical offset for viewing larger images +function Image:getOffsetY(self) end + +---Resizes the image to the specified width and height +---@param width number The new width of the image +---@param height number The new height of the image +---@return Image self The Image instance +function Image:resizeImage(width, height) end + +---Gets the background color at the specified position +---@param x number The x position +---@param y number The y position +---@param length number The length of the background color pattern to get +---@return string bg The background color pattern +function Image:getBg(x, y, length) end + +---Sets the pixel at the specified position +---@param x number The x position +---@param y number The y position +---@param char string The character to set +---@param fg string The foreground color pattern +---@param bg string The background color pattern +---@return Image self The Image instance +function Image:setPixel(x, y, char, fg, bg) end + +---Gets the text at the specified position +---@param x number The x position +---@param y number The y position +---@param length number The length of the text to get +---@return string text The text at the specified position +function Image:getText(x, y, length) end + +---Gets the foreground color at the specified position +---@param x number The x position +---@param y number The y position +---@param length number The length of the foreground color pattern to get +---@return string fg The foreground color pattern +function Image:getFg(x, y, length) end + +---Gets the value of the AutoResize property. +---@param self Image self +---@return boolean false Whether to automatically resize the image when content exceeds bounds +function Image:getAutoResize(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Image self The initialized instance +---@protected +function Image:init(props, basalt) end + +---Sets the value of the OffsetY property. +---@param self Image self +---@param OffsetY number Vertical offset for viewing larger images +function Image:setOffsetY(self, OffsetY) end + +---Gets the value of the CurrentFrame property. +---@param self Image self +---@return number 1 Current animation frame +function Image:getCurrentFrame(self) end + +---@class Animation +local Animation = {} + +---Adds a new animation to the sequence +---@param type string The type of animation +---@param args table The animation arguments +---@param duration number The duration in seconds +---@param easing string The easing function name +function Animation:addAnimation(type, args, duration, easing) end + +---Creates a new Animation +---@param element VisualElement The element to animate +---@return Animation The new animation +function Animation.new(element) end + +---Registers a new animation type +---@param name string The name of the animation +---@param handlers table Table containing start, update and complete handlers +function Animation.registerAnimation(name, handlers) end + +---The event handler for the animation (listens to timer events) +---@param event string The event type +---@param timerId number The timer ID +function Animation:event(event, timerId) end + +---Stops the animation immediately: cancels timers, completes running anim instances and clears the element property +function Animation:stop() end + +---Starts the animation +---@return Animation self The animation instance +function Animation:start() end + +---Creates a new sequence +---@return Animation self The animation instance +function Animation:sequence() end + +---Registers a callback for the start event +---@param callback function The callback function to register +function Animation:onStart(callback) end + +---Registers a new easing function +---@param name string The name of the easing function +---@param func function The easing function (takes progress 0-1, returns modified progress) +function Animation.registerEasing(name, func) end + +---Registers a callback for the update event +---@param callback function The callback function to register +---@return Animation self The animation instance +function Animation:onUpdate(callback) end + +---Registers a callback for the complete event +---@param callback function The callback function to register +---@return Animation self The animation instance +function Animation:onComplete(callback) end + +---@class Graph : VisualElement +---@field minValue number The minimum value of the graph +---@field series table The series of the graph +---@field maxValue number The maximum value of the graph +local Graph = {} + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Graph:render() end + +---Clears all points from a series +---@return Graph self The graph instance +function Graph:clear() end + +---@param name string The name of the series +---@param value number The value of the point +---@return Graph self The graph instance +function Graph:addPoint(name, value) end + +---@param name string The name of the series +---@return Graph self The graph instance +function Graph:focusSeries(name) end + +---Gets the value of the MinValue property. +---@param self Graph self +---@return number 0 The minimum value of the graph +function Graph:getMinValue(self) end + +---Sets the value of the MinValue property. +---@param self Graph self +---@param MinValue number The minimum value of the graph +function Graph:setMinValue(self, MinValue) end + +---Sets the value of the Series property. +---@param self Graph self +---@param Series table The series of the graph +function Graph:setSeries(self, Series) end + +---@param name string The name of the series +---@param count number The number of points in the series +---@return Graph self The graph instance +function Graph:setSeriesPointCount(name, count) end + +---@param name string The name of the series +---@param visible boolean Whether the series should be visible +---@return Graph self The graph instance +function Graph:changeSeriesVisibility(name, visible) end + +---@param name string The name of the series +---@param symbol string The symbol of the series +---@param bgCol number The background color of the series +---@param fgCol number The foreground color of the series +---@param pointCount number The number of points in the series +---@return Graph self The graph instance +function Graph:addSeries(name, symbol, bgCol, fgCol, pointCount) end + +---@param name string The name of the series +---@return table ? series The series +function Graph:getSeries(name) end + +---@param name string The name of the series +---@return Graph self The graph instance +function Graph:removeSeries(name) end + +---Gets the value of the MaxValue property. +---@param self Graph self +---@return number 100 The maximum value of the graph +function Graph:getMaxValue(self) end + +---Sets the value of the MaxValue property. +---@param self Graph self +---@param MaxValue number The maximum value of the graph +function Graph:setMaxValue(self, MaxValue) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Graph self The initialized instance +---@protected +function Graph:init(props, basalt) end + +---@class ElementManager +local ElementManager = {} + +---Gets a list of all elements +---@return table ElementList A list of all elements +function ElementManager.getElementList() end + +---Gets an Plugin API by name +---@param name string The name of the API to get +---@return table API The API +function ElementManager.getAPI(name) end + +---Loads an element by name. This will load the element and apply any plugins to it. +---@param name string The name of the element to load +function ElementManager.loadElement(name) end + +---Gets an element by name. If the element is not loaded, it will try to load it first. +---@param name string The name of the element to get +---@return table Element The element class +function ElementManager.getElement(name) end + +---@class AnimationInstance +local AnimationInstance = {} + +---Gets called when the animation is completed +function AnimationInstance:complete() end + +---Updates the animation +---@param elapsed number The elapsed time in seconds +---@return boolean Whether the animation is finished +function AnimationInstance:update(elapsed) end + +---Starts the animation +---@return AnimationInstance self The animation instance +function AnimationInstance:start() end + +---Creates a new AnimationInstance +---@param element VisualElement The element to animate +---@param animType string The type of animation +---@param args table The animation arguments +---@param duration number Duration in seconds +---@param easing string The easing function name +---@return AnimationInstance The new animation instance +function AnimationInstance.new(element, animType, args, duration, easing) end + +---@class Timer : BaseElement +---@field interval number The interval in seconds at which the timer will trigger its action. +---@field action function The action to be performed when the timer triggers. +---@field amount number The amount of time the timer should run. +---@field running boolean Indicates whether the timer is currently running or not. +local Timer = {} + +---Gets the value of the Interval property. +---@param self Timer self +---@return number 1 The interval in seconds at which the timer will trigger its action. +function Timer:getInterval(self) end + +---Sets the value of the Interval property. +---@param self Timer self +---@param Interval number The interval in seconds at which the timer will trigger its action. +function Timer:setInterval(self, Interval) end + +---Gets the value of the Amount property. +---@param self Timer self +---@return number -1 The amount of time the timer should run. +function Timer:getAmount(self) end + +---Sets the value of the Running property. +---@param self Timer self +---@param Running boolean Indicates whether the timer is currently running or not. +function Timer:setRunning(self, Running) end + +---Sets the value of the Amount property. +---@param self Timer self +---@param Amount number The amount of time the timer should run. +function Timer:setAmount(self, Amount) end + +---Stops the timer if it is currently running. +---@param self Timer The Timer instance to stop +---@return Timer self The Timer instance +function Timer:stop(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Timer:dispatchEvent() end + +---Starts the timer with the specified interval. +---@param self Timer The Timer instance to start +---@return Timer self The Timer instance +function Timer:start(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@protected +function Timer:init(props, basalt) end + +---Gets the value of the Running property. +---@param self Timer self +---@return boolean false Indicates whether the timer is currently running or not. +function Timer:getRunning(self) end + +---Gets the value of the Action property. +---@param self Timer self +---@return function function The action to be performed when the timer triggers. +function Timer:getAction(self) end + +---Sets the value of the Action property. +---@param self Timer self +---@param Action function The action to be performed when the timer triggers. +function Timer:setAction(self, Action) end + +---@class Menu : List +---@field separatorColor color The color used for separator items in the menu +local Menu = {} + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean Whether the event was handled +---@protected +function Menu:mouse_click(button, x, y) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Menu:render() end + +---Gets the value of the SeparatorColor property. +---@param self Menu self +---@return color gray The color used for separator items in the menu +function Menu:getSeparatorColor(self) end + +---Sets the value of the SeparatorColor property. +---@param self Menu self +---@param SeparatorColor color The color used for separator items in the menu +function Menu:setSeparatorColor(self, SeparatorColor) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Menu self The initialized instance +---@protected +function Menu:init(props, basalt) end + +---Sets the menu items +---@param items table [] List of items with {text, separator, callback, foreground, background} properties +---@return Menu self The Menu instance +function Menu:setItems(items) end + +---@class Button : VisualElement +---@field text string Button text +local Button = {} + +---Gets the value of the Text property. +---@param self Button self +---@return string Button Button text +function Button:getText(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Button:render() end + +---Sets the value of the Text property. +---@param self Button self +---@param Text string Button text +function Button:setText(self, Text) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@protected +function Button:init(props, basalt) end + +---@class Display : VisualElement +local Display = {} + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Display:render() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@protected +function Display:init(props, basalt) end + +---Writes text to the display at the given position with the given foreground and background colors +---@param x number The x position to write to +---@param y number The y position to write to +---@param text string The text to write +---@return Display self The display instance +function Display:write(x, y, text) end + +---Returns the current window object +---@return table window The current window object +function Display:getWindow() end + +---@class ProgressBar : VisualElement +---@field progress number Current progress value (0-100) +---@field showPercentage boolean Whether to show the percentage text in the center +---@field direction string The direction of the progress bar ("up", "down", "left", "right") +---@field progressColor color The color used for the filled portion of the progress bar +local ProgressBar = {} + +---Gets the value of the ProgressColor property. +---@param self ProgressBar self +---@return color lime The color used for the filled portion of the progress bar +function ProgressBar:getProgressColor(self) end + +---Sets the value of the Progress property. +---@param self ProgressBar self +---@param Progress number Current progress value (0-100) +function ProgressBar:setProgress(self, Progress) end + +---Sets the value of the ShowPercentage property. +---@param self ProgressBar self +---@param ShowPercentage boolean Whether to show the percentage text in the center +function ProgressBar:setShowPercentage(self, ShowPercentage) end + +---Sets the value of the Direction property. +---@param self ProgressBar self +---@param Direction string The direction of the progress bar ("up", "down", "left", "right") +function ProgressBar:setDirection(self, Direction) end + +---Sets the value of the ProgressColor property. +---@param self ProgressBar self +---@param ProgressColor color The color used for the filled portion of the progress bar +function ProgressBar:setProgressColor(self, ProgressColor) end + +---Gets the value of the Progress property. +---@param self ProgressBar self +---@return number 0 Current progress value (0-100) +function ProgressBar:getProgress(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function ProgressBar:render() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return ProgressBar self The initialized instance +---@protected +function ProgressBar:init(props, basalt) end + +---Gets the value of the Direction property. +---@param self ProgressBar self +---@return string right The direction of the progress bar ("up", "down", "left", "right") +function ProgressBar:getDirection(self) end + +---Gets the value of the ShowPercentage property. +---@param self ProgressBar self +---@return boolean false Whether to show the percentage text in the center +function ProgressBar:getShowPercentage(self) end + +---@class Input : VisualElement +---@field text string The current text content of the input +---@field replaceChar string Character to replace the input with (for password fields) +---@field maxLength number nil Maximum length of input text (optional) +---@field focusedForeground color Foreground color when input is focused +---@field viewOffset number The horizontal scroll offset for viewing long text +---@field focusedBackground color Background color when input is focused +---@field cursorPos number The current cursor position in the text +---@field cursorColor number Color of the cursor +---@field pattern string nil Regular expression pattern for input validation +---@field placeholderColor color Color of the placeholder text +---@field placeholder string Text to display when input is empty +local Input = {} + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Input self The initialized instance +---@protected +function Input:init(props, basalt) end + +---Sets the value of the Text property. +---@param self Input self +---@param Text string The current text content of the input +function Input:setText(self, Text) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Input:render() end + +---Sets the value of the FocusedForeground property. +---@param self Input self +---@param FocusedForeground color Foreground color when input is focused +function Input:setFocusedForeground(self, FocusedForeground) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Input:paste() end + +---Gets the value of the CursorPos property. +---@param self Input self +---@return number 1 The current cursor position in the text +function Input:getCursorPos(self) end + +---Sets the value of the ViewOffset property. +---@param self Input self +---@param ViewOffset number The horizontal scroll offset for viewing long text +function Input:setViewOffset(self, ViewOffset) end + +---Gets the value of the MaxLength property. +---@param self Input self +---@return number ? nil Maximum length of input text (optional) +function Input:getMaxLength(self) end + +---Gets the value of the Text property. +---@param self Input self +---@return string - The current text content of the input +function Input:getText(self) end + +---Sets the value of the CursorPos property. +---@param self Input self +---@param CursorPos number The current cursor position in the text +function Input:setCursorPos(self, CursorPos) end + +---Sets the value of the CursorColor property. +---@param self Input self +---@param CursorColor number Color of the cursor +function Input:setCursorColor(self, CursorColor) end + +---Sets the value of the Pattern property. +---@param self Input self +---@param Pattern string nil Regular expression pattern for input validation +function Input:setPattern(self, Pattern) end + +---Gets the value of the Pattern property. +---@param self Input self +---@return string ? nil Regular expression pattern for input validation +function Input:getPattern(self) end + +---Gets the value of the Placeholder property. +---@param self Input self +---@return string ... Text to display when input is empty +function Input:getPlaceholder(self) end + +---Sets the value of the PlaceholderColor property. +---@param self Input self +---@param PlaceholderColor color Color of the placeholder text +function Input:setPlaceholderColor(self, PlaceholderColor) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Input:focus() end + +---Sets the value of the MaxLength property. +---@param self Input self +---@param MaxLength number nil Maximum length of input text (optional) +function Input:setMaxLength(self, MaxLength) end + +---Sets the value of the Placeholder property. +---@param self Input self +---@param Placeholder string Text to display when input is empty +function Input:setPlaceholder(self, Placeholder) end + +---Sets the value of the FocusedBackground property. +---@param self Input self +---@param FocusedBackground color Background color when input is focused +function Input:setFocusedBackground(self, FocusedBackground) end + +---Gets the value of the FocusedBackground property. +---@param self Input self +---@return color blue Background color when input is focused +function Input:getFocusedBackground(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Input:blur() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Input:mouse_click(button, x, y) end + +---Gets the value of the ViewOffset property. +---@param self Input self +---@return number 0 The horizontal scroll offset for viewing long text +function Input:getViewOffset(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param key number The key that was pressed +---@return boolean handled Whether the event was handled +---@protected +function Input:key(key) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param char string The character that was typed +---@return boolean handled Whether the event was handled +---@protected +function Input:char(char) end + +---Sets the cursor position and color +---@param x number The x position of the cursor +---@param y number The y position of the cursor +---@param blink boolean Whether the cursor should blink +---@param color number The color of the cursor +function Input:setCursor(x, y, blink, color) end + +---Updates the input's viewport +---@return Input self The updated instance +function Input:updateViewport() end + +---Gets the value of the CursorColor property. +---@param self Input self +---@return number nil Color of the cursor +function Input:getCursorColor(self) end + +---Gets the value of the ReplaceChar property. +---@param self Input self +---@return string nil Character to replace the input with (for password fields) +function Input:getReplaceChar(self) end + +---Sets the value of the ReplaceChar property. +---@param self Input self +---@param ReplaceChar string Character to replace the input with (for password fields) +function Input:setReplaceChar(self, ReplaceChar) end + +---Gets the value of the PlaceholderColor property. +---@param self Input self +---@return color gray Color of the placeholder text +function Input:getPlaceholderColor(self) end + +---Gets the value of the FocusedForeground property. +---@param self Input self +---@return color white Foreground color when input is focused +function Input:getFocusedForeground(self) end + +---@class Frame : Container +---@field draggable boolean Whether the frame is draggable +---@field draggingMap table The map of dragging positions +---@field scrollable boolean Whether the frame is scrollable +local Frame = {} + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Frame:mouse_click(button, x, y) end + +---Gets the value of the Draggable property. +---@param self Frame self +---@return boolean false Whether the frame is draggable +function Frame:getDraggable(self) end + +---Sets the value of the DraggingMap property. +---@param self Frame self +---@param DraggingMap table The map of dragging positions +function Frame:setDraggingMap(self, DraggingMap) end + +---Gets the value of the Scrollable property. +---@param self Frame self +---@return boolean false Whether the frame is scrollable +function Frame:getScrollable(self) end + +---Gets the value of the DraggingMap property. +---@param self Frame self +---@return table {} The map of dragging positions +function Frame:getDraggingMap(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Frame self The initialized instance +---@protected +function Frame:init(props, basalt) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param direction number The scroll direction +---@param x number The x position of the scroll +---@param y number The y position of the scroll +---@return boolean handled Whether the event was handled +---@protected +function Frame:mouse_scroll(direction, x, y) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was clicked +---@param x number The x position of the drag position +---@param y number The y position of the drag position +---@return boolean handled Whether the event was handled +---@protected +function Frame:mouse_drag(button, x, y) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@return number height The total height needed for all children +---@protected +function Frame:getChildrenHeight() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The button that was released +---@param x number The x position of the release +---@param y number The y position of the release +---@return boolean handled Whether the event was handled +---@protected +function Frame:mouse_up(button, x, y) end + +---Sets the value of the Draggable property. +---@param self Frame self +---@param Draggable boolean Whether the frame is draggable +function Frame:setDraggable(self, Draggable) end + +---Sets the value of the Scrollable property. +---@param self Frame self +---@param Scrollable boolean Whether the frame is scrollable +function Frame:setScrollable(self, Scrollable) end + +---@class Slider : VisualElement +---@field max number Maximum value for value conversion (maps slider position to this range) +---@field sliderColor color Color of the slider handle +---@field horizontal boolean Whether the slider is horizontal (false for vertical) +---@field barColor color Color of the slider track +---@field step number Current position of the slider handle (1 to width/height) +local Slider = {} + +---Sets the value of the Step property. +---@param self Slider self +---@param Step number Current position of the slider handle (1 to width/height) +function Slider:setStep(self, Step) end + +---Sets the value of the Horizontal property. +---@param self Slider self +---@param Horizontal boolean Whether the slider is horizontal (false for vertical) +function Slider:setHorizontal(self, Horizontal) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function Slider:render() end + +---Gets the value of the Max property. +---@param self Slider self +---@return number 100 Maximum value for value conversion (maps slider position to this range) +function Slider:getMax(self) end + +---Sets the value of the Max property. +---@param self Slider self +---@param Max number Maximum value for value conversion (maps slider position to this range) +function Slider:setMax(self, Max) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The mouse button that was released +---@param x number The x position of the release +---@param y number The y position of the release +---@return boolean handled Whether the event was handled +---@protected +function Slider:mouse_scroll(button, x, y) end + +---Sets the value of the SliderColor property. +---@param self Slider self +---@param SliderColor color Color of the slider handle +function Slider:setSliderColor(self, SliderColor) end + +---Gets the current value of the slider +---@return number value The current value (0 to max) +function Slider:getValue() end + +---Gets the value of the Horizontal property. +---@param self Slider self +---@return boolean true Whether the slider is horizontal (false for vertical) +function Slider:getHorizontal(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return Slider self The initialized instance +---@protected +function Slider:init(props, basalt) end + +---Sets the value of the BarColor property. +---@param self Slider self +---@param BarColor color Color of the slider track +function Slider:setBarColor(self, BarColor) end + +---Gets the value of the Step property. +---@param self Slider self +---@return number 1 Current position of the slider handle (1 to width/height) +function Slider:getStep(self) end + +---Registers a function to handle the onChange event. +---@param value number +---@param self Slider self +---@param func function The function to be called when the event fires +function Slider:onOnChange(self, func) end + +---Gets the value of the BarColor property. +---@param self Slider self +---@return color gray Color of the slider track +function Slider:getBarColor(self) end + +---Gets the value of the SliderColor property. +---@param self Slider self +---@return color blue Color of the slider handle +function Slider:getSliderColor(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The mouse button that was clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean handled Whether the event was handled +---@protected +function Slider:mouse_click(button, x, y) end + +---@class LineChart : Graph +local LineChart = {} + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function LineChart:render() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return LineChart self The initialized instance +---@protected +function LineChart:init(props, basalt) end + +---@class ScrollBar : VisualElement +---@field max number Maximum scroll value +---@field orientation string Orientation of the ScrollBar ("vertical" or "horizontal") +---@field dragMultiplier number How fast the ScrollBar moves when dragging +---@field handleSize number Size of the ScrollBar handle in characters +---@field maxValue number 100 Maximum value or function that returns it +---@field symbolBackgroundColor color Background color of the ScrollBar handle +---@field minValue number 0 Minimum value or function that returns it +---@field attachedElement table nil The element this ScrollBar is attached to +---@field attachedProperty string nil The property being controlled +---@field step number Step size for scroll operations +---@field value number Current scroll value +---@field backgroundSymbol string Symbol used for the ScrollBar background +---@field symbol string " Symbol used for the ScrollBar handle +---@field min number Minimum scroll value +local ScrollBar = {} + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param props table The properties to initialize the element with +---@param basalt table The basalt instance +---@return ScrollBar self The initialized instance +---@protected +function ScrollBar:init(props, basalt) end + +---Gets the value of the Max property. +---@param self ScrollBar self +---@return number 100 Maximum scroll value +function ScrollBar:getMax(self) end + +---Gets the value of the AttachedProperty property. +---@param self ScrollBar self +---@return string ? nil The property being controlled +function ScrollBar:getAttachedProperty(self) end + +---Sets the value of the SymbolBackgroundColor property. +---@param self ScrollBar self +---@param SymbolBackgroundColor color Background color of the ScrollBar handle +function ScrollBar:setSymbolBackgroundColor(self, SymbolBackgroundColor) end + +---Gets the value of the HandleSize property. +---@param self ScrollBar self +---@return number 2 Size of the ScrollBar handle in characters +function ScrollBar:getHandleSize(self) end + +---Gets the value of the SymbolBackgroundColor property. +---@param self ScrollBar self +---@return color black Background color of the ScrollBar handle +function ScrollBar:getSymbolBackgroundColor(self) end + +---Gets the value of the Value property. +---@param self ScrollBar self +---@return number 0 Current scroll value +function ScrollBar:getValue(self) end + +---Sets the value of the Value property. +---@param self ScrollBar self +---@param Value number Current scroll value +function ScrollBar:setValue(self, Value) end + +---Sets the value of the AttachedProperty property. +---@param self ScrollBar self +---@param AttachedProperty string nil The property being controlled +function ScrollBar:setAttachedProperty(self, AttachedProperty) end + +---Sets the value of the DragMultiplier property. +---@param self ScrollBar self +---@param DragMultiplier number How fast the ScrollBar moves when dragging +function ScrollBar:setDragMultiplier(self, DragMultiplier) end + +---Gets the value of the Symbol property. +---@param self ScrollBar self +---@return string " " Symbol used for the ScrollBar handle +function ScrollBar:getSymbol(self) end + +---Gets the value of the MinValue property. +---@param self ScrollBar self +---@return number |function 0 Minimum value or function that returns it +function ScrollBar:getMinValue(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param direction number The scroll direction (1 for up, -1 for down) +---@param x number The x position of the scroll +---@param y number The y position of the scroll +---@return boolean Whether the event was handled +---@protected +function ScrollBar:mouse_scroll(direction, x, y) end + +---Sets the value of the Max property. +---@param self ScrollBar self +---@param Max number Maximum scroll value +function ScrollBar:setMax(self, Max) end + +---Gets the value of the Orientation property. +---@param self ScrollBar self +---@return string vertical Orientation of the ScrollBar ("vertical" or "horizontal") +function ScrollBar:getOrientation(self) end + +---Gets the value of the Min property. +---@param self ScrollBar self +---@return number 0 Minimum scroll value +function ScrollBar:getMin(self) end + +---Gets the value of the Step property. +---@param self ScrollBar self +---@return number 1 Step size for scroll operations +function ScrollBar:getStep(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The mouse button clicked +---@param x number The x position of the click +---@param y number The y position of the click +---@return boolean Whether the event was handled +---@protected +function ScrollBar:mouse_click(button, x, y) end + +---Gets the value of the DragMultiplier property. +---@param self ScrollBar self +---@return number 1 How fast the ScrollBar moves when dragging +function ScrollBar:getDragMultiplier(self) end + +---Sets the value of the AttachedElement property. +---@param self ScrollBar self +---@param AttachedElement table nil The element this ScrollBar is attached to +function ScrollBar:setAttachedElement(self, AttachedElement) end + +---Attaches the ScrollBar to an element's property +---@param element BaseElement The element to attach to +---@param config table Configuration {property = "propertyName", min = number|function, max = number|function} +---@return ScrollBar self The ScrollBar instance +function ScrollBar:attach(element, config) end + +---Gets the value of the MaxValue property. +---@param self ScrollBar self +---@return number |function 100 Maximum value or function that returns it +function ScrollBar:getMaxValue(self) end + +---Updates the attached element's property based on the ScrollBar value +---@return ScrollBar self The ScrollBar instance +function ScrollBar:updateAttachedElement() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function ScrollBar:render() end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param button number The mouse button being dragged +---@param x number The x position of the drag +---@param y number The y position of the drag +---@return boolean Whether the event was handled +---@protected +function ScrollBar:mouse_drag(button, x, y) end + +---Sets the value of the Min property. +---@param self ScrollBar self +---@param Min number Minimum scroll value +function ScrollBar:setMin(self, Min) end + +---Sets the value of the Symbol property. +---@param self ScrollBar self +---@param Symbol string " Symbol used for the ScrollBar handle +function ScrollBar:setSymbol(self, Symbol) end + +---Sets the value of the Orientation property. +---@param self ScrollBar self +---@param Orientation string Orientation of the ScrollBar ("vertical" or "horizontal") +function ScrollBar:setOrientation(self, Orientation) end + +---Sets the value of the Step property. +---@param self ScrollBar self +---@param Step number Step size for scroll operations +function ScrollBar:setStep(self, Step) end + +---Gets the value of the BackgroundSymbol property. +---@param self ScrollBar self +---@return string "\127" Symbol used for the ScrollBar background +function ScrollBar:getBackgroundSymbol(self) end + +---Sets the value of the MinValue property. +---@param self ScrollBar self +---@param MinValue number 0 Minimum value or function that returns it +function ScrollBar:setMinValue(self, MinValue) end + +---Gets the value of the AttachedElement property. +---@param self ScrollBar self +---@return table ? nil The element this ScrollBar is attached to +function ScrollBar:getAttachedElement(self) end + +---Sets the value of the BackgroundSymbol property. +---@param self ScrollBar self +---@param BackgroundSymbol string Symbol used for the ScrollBar background +function ScrollBar:setBackgroundSymbol(self, BackgroundSymbol) end + +---Sets the value of the MaxValue property. +---@param self ScrollBar self +---@param MaxValue number 100 Maximum value or function that returns it +function ScrollBar:setMaxValue(self, MaxValue) end + +---Sets the value of the HandleSize property. +---@param self ScrollBar self +---@param HandleSize number Size of the ScrollBar handle in characters +function ScrollBar:setHandleSize(self, HandleSize) end + +---@class BigFontText +local BigFontText = {} + +---@class basalt +local basalt = {} + +---Returns a Plugin API +---@param name string The name of the plugin +---@return table Plugin The plugin API +function basalt.getAPI(name) end + +---Returns the element manager instance +---@return table ElementManager The element manager +function basalt.getElementManager() end + +---Creates and returns a new BaseFrame +---@return BaseFrame BaseFrame The created frame instance +function basalt.createFrame() end + +---Creates and returns a new UI element of the specified type. +---@param type string The type of element to create (e.g. "Button", "Label", "BaseFrame") +---@return table element The created element instance +function basalt.create(type) end + +---Removes a callback function for a specific event +---@param eventName string The name of the event +---@param callback function The callback function to remove +---@return boolean success Whether the callback was found and removed +function basalt.removeEvent(eventName, callback) end + +---Starts the Basalt runtime +function basalt.run() end + +---Returns the error manager instance +---@return table ErrorManager The error manager +function basalt.getErrorManager() end + +---Sets the active frame +---@param frame BaseFrame The frame to set as active +function basalt.setActiveFrame(frame) end + +---Triggers a custom event and calls all registered callbacks +---@param eventName string The name of the event to trigger +function basalt.triggerEvent(eventName) end + +---Returns an element's class without creating a instance +---@param name string The name of the element +---@return table Element The element class +function basalt.getElementClass(name) end + +---Registers a callback function for a specific event +---@param eventName string The name of the event to listen for (e.g. "mouse_click", "key", "timer") +---@param callback function The callback function to execute when the event occurs +function basalt.onEvent(eventName, callback) end + +---Stops the Basalt runtime +function basalt.stop() end + +---Gets or creates the main frame +---@return BaseFrame BaseFrame The main frame instance +function basalt.getMainFrame() end + +---Sets a frame as focused +---@param frame BaseFrame The frame to set as focused +function basalt.setFocus(frame) end + +---Removes a scheduled update +---@param func thread The scheduled function to remove +---@return boolean success Whether the scheduled function was removed +function basalt.removeSchedule(func) end + +---Returns the active frame +---@return BaseFrame ? BaseFrame The frame to set as active +function basalt.getActiveFrame() end + +---Schedules a function to run in a coroutine +---@param func function The function to schedule +---@return thread func The scheduled function +function basalt.schedule(func) end + +---Runs basalt once, can be used to update the UI manually, but you have to feed it the events +function basalt.update() end + +---Returns the focused frame +---@return BaseFrame ? BaseFrame The focused frame +function basalt.getFocus() end + ---@class FlexBox : Container ---@field flexWrap boolean Whether to wrap flex items onto multiple lines ----@field flexDirection string The direction of the flexbox layout "row" or "column" ---@field flexUpdateLayout boolean Whether to update the layout of the flexbox ----@field flexCrossPadding number The padding on both sides of the cross axis ----@field flexSpacing number The spacing between flex items ----@field flexJustifyContent string The alignment of flex items along the main axis +---@field flexDirection string The direction of the flexbox layout "row" or "column" ---@field flexAlignItems string The alignment of flex items along the cross axis +---@field flexCrossPadding number The padding on both sides of the cross axis +---@field flexJustifyContent string The alignment of flex items along the main axis +---@field flexSpacing number The spacing between flex items local FlexBox = {} +---Sets the value of the FlexUpdateLayout property. +---@param self FlexBox self +---@param FlexUpdateLayout boolean Whether to update the layout of the flexbox +function FlexBox:setFlexUpdateLayout(self, FlexUpdateLayout) end + +---Sets the value of the FlexDirection property. +---@param self FlexBox self +---@param FlexDirection string The direction of the flexbox layout "row" or "column" +function FlexBox:setFlexDirection(self, FlexDirection) end + +---Gets the value of the FlexDirection property. +---@param self FlexBox self +---@return string "row" The direction of the flexbox layout "row" or "column" +function FlexBox:getFlexDirection(self) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@param element Element The child element to remove +---@return FlexBox self The flexbox instance +---@protected +function FlexBox:removeChild(element) end + +---Sets the value of the FlexSpacing property. +---@param self FlexBox self +---@param FlexSpacing number The spacing between flex items +function FlexBox:setFlexSpacing(self, FlexSpacing) end + +---Sets the value of the FlexJustifyContent property. +---@param self FlexBox self +---@param FlexJustifyContent string The alignment of flex items along the main axis +function FlexBox:setFlexJustifyContent(self, FlexJustifyContent) end + +---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. +---@protected +function FlexBox:render() end + +---Adds a new line break to the flexbox +---@param self FlexBox The element itself +---@return FlexBox +function FlexBox:addLineBreak(self) end + +---Gets the value of the FlexUpdateLayout property. +---@param self FlexBox self +---@return boolean false Whether to update the layout of the flexbox +function FlexBox:getFlexUpdateLayout(self) end + +---Gets the value of the FlexJustifyContent property. +---@param self FlexBox self +---@return string "flex-start" The alignment of flex items along the main axis +function FlexBox:getFlexJustifyContent(self) end + ---Gets the value of the FlexSpacing property. ---@param self FlexBox self ---@return number 1 The spacing between flex items function FlexBox:getFlexSpacing(self) end +---Adds a child element to the flexbox +---@param element Element The child element to add +---@return FlexBox self The flexbox instance +function FlexBox:addChild(element) end + +---Sets the value of the FlexCrossPadding property. +---@param self FlexBox self +---@param FlexCrossPadding number The padding on both sides of the cross axis +function FlexBox:setFlexCrossPadding(self, FlexCrossPadding) end + ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ---@param props table The properties to initialize the element with ---@param basalt table The basalt instance @@ -923,6 +4077,11 @@ function FlexBox:getFlexSpacing(self) end ---@protected function FlexBox:init(props, basalt) end +---Gets the value of the FlexCrossPadding property. +---@param self FlexBox self +---@return number 0 The padding on both sides of the cross axis +function FlexBox:getFlexCrossPadding(self) end + ---Sets the value of the FlexAlignItems property. ---@param self FlexBox self ---@param FlexAlignItems string The alignment of flex items along the cross axis @@ -938,693 +4097,29 @@ function FlexBox:getFlexWrap(self) end ---@param FlexWrap boolean Whether to wrap flex items onto multiple lines function FlexBox:setFlexWrap(self, FlexWrap) end ----Sets the value of the FlexJustifyContent property. ----@param self FlexBox self ----@param FlexJustifyContent string The alignment of flex items along the main axis -function FlexBox:setFlexJustifyContent(self, FlexJustifyContent) end - ----Sets the value of the FlexUpdateLayout property. ----@param self FlexBox self ----@param FlexUpdateLayout boolean Whether to update the layout of the flexbox -function FlexBox:setFlexUpdateLayout(self, FlexUpdateLayout) end - ----Gets the value of the FlexUpdateLayout property. ----@param self FlexBox self ----@return boolean false Whether to update the layout of the flexbox -function FlexBox:getFlexUpdateLayout(self) end - ----Gets the value of the FlexJustifyContent property. ----@param self FlexBox self ----@return string "flex-start" The alignment of flex items along the main axis -function FlexBox:getFlexJustifyContent(self) end - ----Adds a child element to the flexbox ----@param element Element The child element to add ----@return FlexBox self The flexbox instance -function FlexBox:addChild(element) end - ----Gets the value of the FlexDirection property. ----@param self FlexBox self ----@return string "row" The direction of the flexbox layout "row" or "column" -function FlexBox:getFlexDirection(self) end - ----Sets the value of the FlexSpacing property. ----@param self FlexBox self ----@param FlexSpacing number The spacing between flex items -function FlexBox:setFlexSpacing(self, FlexSpacing) end - ----Gets the value of the FlexCrossPadding property. ----@param self FlexBox self ----@return number 0 The padding on both sides of the cross axis -function FlexBox:getFlexCrossPadding(self) end - ---Gets the value of the FlexAlignItems property. ---@param self FlexBox self ---@return string "flex-start" The alignment of flex items along the cross axis function FlexBox:getFlexAlignItems(self) end ----Sets the value of the FlexDirection property. ----@param self FlexBox self ----@param FlexDirection string The direction of the flexbox layout "row" or "column" -function FlexBox:setFlexDirection(self, FlexDirection) end +---@class ThemeAPI +local ThemeAPI = {} ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function FlexBox:render() end +---Gets the current theme configuration +---@return table theme The current theme configuration +function ThemeAPI.getTheme() end ----Adds a new line break to the flexbox ----@param self FlexBox The element itself ----@return FlexBox -function FlexBox:addLineBreak(self) end +---Loads a theme from a JSON file +---@param path string Path to the theme JSON file +function ThemeAPI.loadTheme(path) end ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param element Element The child element to remove ----@return FlexBox self The flexbox instance ----@protected -function FlexBox:removeChild(element) end - ----Sets the value of the FlexCrossPadding property. ----@param self FlexBox self ----@param FlexCrossPadding number The padding on both sides of the cross axis -function FlexBox:setFlexCrossPadding(self, FlexCrossPadding) end - ----@class Animation -local Animation = {} - ----Adds a new animation to the sequence ----@param type string The type of animation ----@param args table The animation arguments ----@param duration number The duration in seconds ----@param easing string The easing function name -function Animation:addAnimation(type, args, duration, easing) end - ----Registers a new easing function ----@param name string The name of the easing function ----@param func function The easing function (takes progress 0-1, returns modified progress) -function Animation.registerEasing(name, func) end - ----Stops the animation immediately: cancels timers, completes running anim instances and clears the element property -function Animation:stop() end - ----Starts the animation ----@return Animation self The animation instance -function Animation:start() end - ----The event handler for the animation (listens to timer events) ----@param event string The event type ----@param timerId number The timer ID -function Animation:event(event, timerId) end - ----Creates a new sequence ----@return Animation self The animation instance -function Animation:sequence() end - ----Registers a callback for the complete event ----@param callback function The callback function to register ----@return Animation self The animation instance -function Animation:onComplete(callback) end - ----Creates a new Animation ----@param element VisualElement The element to animate ----@return Animation The new animation -function Animation.new(element) end - ----Registers a callback for the update event ----@param callback function The callback function to register ----@return Animation self The animation instance -function Animation:onUpdate(callback) end - ----Registers a new animation type ----@param name string The name of the animation ----@param handlers table Table containing start, update and complete handlers -function Animation.registerAnimation(name, handlers) end - ----Registers a callback for the start event ----@param callback function The callback function to register -function Animation:onStart(callback) end - ----@class Log -local Log = {} - ----Sets if the logger should log -function Log.setEnabled() end - ----Sends a warning message to the logger. -function Log.warn() end - ----Sets if the logger should log to a file. -function Log.setLogToFile() end - ----Sends an info message to the logger. -function Log.info() end - ----Sends an error message to the logger. -function Log.error() end - ----Sends a debug message to the logger. -function Log.debug() end - ----@class Benchmark -local Benchmark = {} - ----Starts a custom benchmark ----@param name string The name of the benchmark -function API.start(name) end - ----Gets statistics for a benchmark ----@param name string The name of the benchmark ----@return table ? stats The benchmark statistics or nil -function API.getStats(name) end - ----Clears all custom benchmarks -function API.clearAll() end - ----Stops a custom benchmark ----@param name string The name of the benchmark to stop -function API.stop(name) end - ----Clears a specific benchmark ----@param name string The name of the benchmark to clear -function API.clear(name) end - ----@class basalt -local basalt = {} - ----Sets the active frame ----@param frame BaseFrame The frame to set as active -function basalt.setActiveFrame(frame) end - ----Returns the active frame ----@return BaseFrame ? BaseFrame The frame to set as active -function basalt.getActiveFrame() end - ----Returns an element's class without creating a instance ----@param name string The name of the element ----@return table Element The element class -function basalt.getElementClass(name) end - ----Stops the Basalt runtime -function basalt.stop() end - ----Starts the Basalt runtime -function basalt.run() end - ----Sets a frame as focused ----@param frame BaseFrame The frame to set as focused -function basalt.setFocus(frame) end - ----Returns a Plugin API ----@param name string The name of the plugin ----@return table Plugin The plugin API -function basalt.getAPI(name) end - ----Schedules a function to run in a coroutine ----@param func function The function to schedule ----@return thread func The scheduled function -function basalt.schedule(func) end - ----Triggers a custom event and calls all registered callbacks ----@param eventName string The name of the event to trigger -function basalt.triggerEvent(eventName) end - ----Removes a scheduled update ----@param func thread The scheduled function to remove ----@return boolean success Whether the scheduled function was removed -function basalt.removeSchedule(func) end - ----Creates and returns a new UI element of the specified type. ----@param type string The type of element to create (e.g. "Button", "Label", "BaseFrame") ----@return table element The created element instance -function basalt.create(type) end - ----Removes a callback function for a specific event ----@param eventName string The name of the event ----@param callback function The callback function to remove ----@return boolean success Whether the callback was found and removed -function basalt.removeEvent(eventName, callback) end - ----Returns the error manager instance ----@return table ErrorManager The error manager -function basalt.getErrorManager() end - ----Creates and returns a new BaseFrame ----@return BaseFrame BaseFrame The created frame instance -function basalt.createFrame() end - ----Registers a callback function for a specific event ----@param eventName string The name of the event to listen for (e.g. "mouse_click", "key", "timer") ----@param callback function The callback function to execute when the event occurs -function basalt.onEvent(eventName, callback) end - ----Returns the element manager instance ----@return table ElementManager The element manager -function basalt.getElementManager() end - ----Gets or creates the main frame ----@return BaseFrame BaseFrame The main frame instance -function basalt.getMainFrame() end - ----Runs basalt once, can be used to update the UI manually, but you have to feed it the events -function basalt.update() end - ----Returns the focused frame ----@return BaseFrame ? BaseFrame The focused frame -function basalt.getFocus() end - ----@class LineChart : Graph -local LineChart = {} - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return LineChart self The initialized instance ----@protected -function LineChart:init(props, basalt) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function LineChart:render() end - ----@class VisualElement : BaseElement ----@field foreground color The text/foreground color ----@field visible boolean Whether the element is visible ----@field x number The horizontal position relative to parent ----@field ignoreOffset boolean Whether to ignore the parent's offset ----@field backgroundEnabled boolean Whether to render the background ----@field z number The z-index for layering elements ----@field y number The vertical position relative to parent ----@field height number The height of the element ----@field width number The width of the element ----@field focused boolean Whether the element has input focus ----@field clicked boolean Whether the element is currently clicked ----@field hover boolean Whether the mouse is currently hover over the element (Craftos-PC only) ----@field background color The background color -local VisualElement = {} - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function VisualElement:blur() end - ----Sets the value of the Hover property. ----@param self VisualElement self ----@param Hover boolean Whether the mouse is currently hover over the element (Craftos-PC only) -function VisualElement:setHover(self, Hover) end - -function VisualElement:drawText() end - ----Sets the value of the Focused property. ----@param self VisualElement self ----@param Focused boolean Whether the element has input focus -function VisualElement:setFocused(self, Focused) end - ----This function is used to prioritize the element by moving it to the top of its parent's children. It removes the element from its parent and adds it back, effectively changing its order. ----@return VisualElement self The VisualElement instance -function VisualElement:prioritize() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param _ number unknown ----@param x number The x position of the mouse ----@param y number The y position of the mouse ----@return boolean hover Whether the mouse has moved over the element ----@protected -function VisualElement:mouse_move(_, x, y) end - ----Registers a function to handle the onScroll event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnScroll(self, func) end - ----Gets the value of the BackgroundEnabled property. ----@param self VisualElement self ----@return boolean true Whether to render the background -function VisualElement:getBackgroundEnabled(self) end - ----Sets the value of the Width property. ----@param self VisualElement self ----@param Width number The width of the element -function VisualElement:setWidth(self, Width) end - ----Sets the value of the X property. ----@param self VisualElement self ----@param X number The horizontal position relative to parent -function VisualElement:setX(self, X) end - ----Gets the value of the Height property. ----@param self VisualElement self ----@return number 1 The height of the element -function VisualElement:getHeight(self) end - ----Registers a function to handle the onBlur event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnBlur(self, func) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to draw ----@param y number The y position to draw ----@param width number The width of the area to draw ----@param height number The height of the area to draw ----@param text string The text to draw ----@param fg string The foreground color ----@param bg string The background color ----@protected -function VisualElement:multiBlit(x, y, width, height, text, fg, bg) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position of the cursor ----@param y number The y position of the cursor ----@param blink boolean Whether the cursor should blink ----@param color number The color of the cursor ----@return VisualElement self The VisualElement instance ----@protected -function VisualElement:setCursor(x, y, blink, color) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param key number The key that was pressed ----@protected -function VisualElement:key(key) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param direction number The scroll direction ----@param x number The x position of the scroll ----@param y number The y position of the scroll ----@return boolean scroll Whether the element was scrolled ----@protected -function VisualElement:mouse_scroll(direction, x, y) end - ----Sets the value of the Foreground property. ----@param self VisualElement self ----@param Foreground color The text/foreground color -function VisualElement:setForeground(self, Foreground) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to draw ----@param y number The y position to draw ----@param text string The text char to draw ----@param fg color The foreground color ----@protected -function VisualElement:textFg(x, y, text, fg) end - ----Gets the value of the Clicked property. ----@param self VisualElement self ----@return boolean false Whether the element is currently clicked -function VisualElement:getClicked(self) end - ----Registers a function to handle the onChar event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnChar(self, func) end - ----Creates a new Animation Object ----@return Animation animation The new animation -function VisualElement:animate() end - ----Gets the value of the Background property. ----@param self VisualElement self ----@return color black The background color -function VisualElement:getBackground(self) end - ----Registers a function to handle the onDrag event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnDrag(self, func) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to draw ----@param y number The y position to draw ----@param text string The text char to draw ----@param bg color The background color ----@protected -function VisualElement:textBg(x, y, text, bg) end - ----Registers a function to handle the onEnter event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnEnter(self, func) end - ----Gets the value of the Visible property. ----@param self VisualElement self ----@return boolean true Whether the element is visible -function VisualElement:getVisible(self) end - -function VisualElement:destroy() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param char string The character that was pressed ----@protected -function VisualElement:char(char) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to draw ----@param y number The y position to draw ----@param text string The text char to draw ----@param fg string The foreground color ----@param bg string The background color ----@protected -function VisualElement:blit(x, y, text, fg, bg) end - ----Sets the value of the Background property. ----@param self VisualElement self ----@param Background color The background color -function VisualElement:setBackground(self, Background) end - ----Registers a function to handle the onClick event. ----@param button string ----@param x number ----@param y number ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnClick(self, func) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function VisualElement:focus() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean clicked Whether the element was clicked ----@protected -function VisualElement:mouse_click(button, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@protected -function VisualElement:init(props, basalt) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function VisualElement:postRender() end - ----Sets the value of the Height property. ----@param self VisualElement self ----@param Height number The height of the element -function VisualElement:setHeight(self, Height) end - -function VisualElement:drawFg() end - ----Sets the value of the BackgroundEnabled property. ----@param self VisualElement self ----@param BackgroundEnabled boolean Whether to render the background -function VisualElement:setBackgroundEnabled(self, BackgroundEnabled) end - ----Sets the value of the Z property. ----@param self VisualElement self ----@param Z number The z-index for layering elements -function VisualElement:setZ(self, Z) end - ----Sets the value of the Y property. ----@param self VisualElement self ----@param Y number The vertical position relative to parent -function VisualElement:setY(self, Y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was released ----@param x number The x position of the release ----@param y number The y position of the release ----@protected -function VisualElement:mouse_release(button, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked while dragging ----@param x number The x position of the drag ----@param y number The y position of the drag ----@return boolean drag Whether the element was dragged ----@protected -function VisualElement:mouse_drag(button, x, y) end - ----Registers a function to handle the onKeyUp event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnKeyUp(self, func) end - ----Gets the value of the Hover property. ----@param self VisualElement self ----@return boolean false Whether the mouse is currently hover over the element (Craftos-PC only) -function VisualElement:getHover(self) end - ----Gets the value of the Foreground property. ----@param self VisualElement self ----@return color white The text/foreground color -function VisualElement:getForeground(self) end - ----Registers a function to handle the onMouseUp event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnMouseUp(self, func) end - ----Gets the value of the Width property. ----@param self VisualElement self ----@return number 1 The width of the element -function VisualElement:getWidth(self) end - ----Convenience to stop animations from the element -function VisualElement.stopAnimation() end - ----Registers a function to handle the onRelease event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnRelease(self, func) end - ----Gets the value of the X property. ----@param self VisualElement self ----@return number 1 The horizontal position relative to parent -function VisualElement:getX(self) end - ----Registers a function to handle the onLeave event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnLeave(self, func) end - ----Returns the absolute position of the element or the given coordinates. ----@return number x The absolute x position ----@return number y The absolute y position -function VisualElement:getAbsolutePosition() end - -function VisualElement:drawBg() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function VisualElement:render() end - ----Gets the value of the Y property. ----@param self VisualElement self ----@return number 1 The vertical position relative to parent -function VisualElement:getY(self) end - ----Sets the value of the Visible property. ----@param self VisualElement self ----@param Visible boolean Whether the element is visible -function VisualElement:setVisible(self, Visible) end - ----Checks if the specified coordinates are within the bounds of the element ----@param x number The x position to check ----@param y number The y position to check ----@return boolean isInBounds Whether the coordinates are within the bounds of the element -function VisualElement:isInBounds(x, y) end - ----Gets the value of the IgnoreOffset property. ----@param self VisualElement self ----@return boolean false Whether to ignore the parent's offset -function VisualElement:getIgnoreOffset(self) end - ----Sets the value of the Clicked property. ----@param self VisualElement self ----@param Clicked boolean Whether the element is currently clicked -function VisualElement:setClicked(self, Clicked) end - ----Gets the value of the Z property. ----@param self VisualElement self ----@return number 1 The z-index for layering elements -function VisualElement:getZ(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was released ----@param x number The x position of the release ----@param y number The y position of the release ----@return boolean release Whether the element was released on the element ----@protected -function VisualElement:mouse_up(button, x, y) end - ----Sets the value of the IgnoreOffset property. ----@param self VisualElement self ----@param IgnoreOffset boolean Whether to ignore the parent's offset -function VisualElement:setIgnoreOffset(self, IgnoreOffset) end - ----Registers a function to handle the onFocus event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnFocus(self, func) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param key number The key that was released ----@protected -function VisualElement:key_up(key) end - ----Gets the value of the Focused property. ----@param self VisualElement self ----@return boolean false Whether the element has input focus -function VisualElement:getFocused(self) end - ----Calculates the position of the element relative to its parent ----@return number x The x position ----@return number y The y position -function VisualElement:calculatePosition() end - ----Returns the relative position of the element or the given coordinates. ----@return number x The relative x position ----@return number y The relative y position -function VisualElement:getRelativePosition() end - ----Registers a function to handle the onKey event. ----@param self VisualElement self ----@param func function The function to be called when the event fires -function VisualElement:onOnKey(self, func) end - ----@class BigFont : VisualElement ----@field text string BigFont text ----@field fontSize number The font size of the BigFont -local BigFont = {} - ----Gets the value of the Text property. ----@param self BigFont self ----@return string BigFont BigFont text -function BigFont:getText(self) end - ----Sets the value of the FontSize property. ----@param self BigFont self ----@param FontSize number The font size of the BigFont -function BigFont:setFontSize(self, FontSize) end - ----Gets the value of the FontSize property. ----@param self BigFont self ----@return number 1 The font size of the BigFont -function BigFont:getFontSize(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function BigFont:render() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@protected -function BigFont:init(props, basalt) end - ----Sets the value of the Text property. ----@param self BigFont self ----@param Text string BigFont text -function BigFont:setText(self, Text) end +---Sets the current theme +---@param newTheme table The theme configuration to set +function ThemeAPI.setTheme(newTheme) end ---@class BarChart : Graph local BarChart = {} ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function BarChart:render() end - ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ---@param props table The properties to initialize the element with ---@param basalt table The basalt instance @@ -1632,2502 +4127,7 @@ function BarChart:render() end ---@protected function BarChart:init(props, basalt) end ----@class BaseElement : PropertySystem ----@field name string The name of the element ----@field eventCallbacks table The event callbacks for the element ----@field id string The unique identifier for the element ----@field enabled boolean Whether the element is enabled or not ----@field type string The type identifier of the element -local BaseElement = {} - ----Applies the current theme to this element ----@param self BaseElement The element to apply theme to ----@param applyToChildren boolean ? Whether to apply theme to child elements (default: true) ----@return BaseElement self The element instance -function BaseElement:applyTheme(self, applyToChildren) end - ----Sets the value of the Type property. ----@param self BaseElement self ----@param Type string The type identifier of the element -function BaseElement:setType(self, Type) end - ----Enables benchmarking for a method ----@param methodName string The name of the method to benchmark ----@return BaseElement self The element instance -function BaseElement:benchmark(methodName) end - ----Removes a state change observer ----@param self BaseElement The element to remove observer from ----@param stateName string The state to remove observer from ----@param callback function The callback function to remove ----@return BaseElement self The element instance -function BaseElement:removeStateChange(self, stateName, callback) end - ----Sets the value of a state ----@param self BaseElement The element to set state for ----@param name string The name of the state ----@param value any The new value for the state ----@return BaseElement self The element instance -function BaseElement:setState(self, name, value) end - ----Logs benchmark statistics for a method ----@param methodName string The name of the method to log ----@return BaseElement self The element instance -function BaseElement:logBenchmark(methodName) end - ----Gets the theme properties for this element ----@param self BaseElement The element to get theme for ----@return table styles The theme properties -function BaseElement:getTheme(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param event string The event to handle ----@return boolean ? handled Whether the event was handled ----@protected -function BaseElement:dispatchEvent(event) end - ----Registers a new event listener for the element (on class level) ----@param class table The class to register ----@param eventName string The name of the event to register -function BaseElement.defineEvent(class, eventName) end - ----Gets the value of a state ----@param self BaseElement The element to get state from ----@param name string The name of the state ----@return any value The current state value -function BaseElement:getState(self, name) end - ----Stops benchmarking for a method ----@param methodName string The name of the method to stop benchmarking ----@return BaseElement self The element instance -function BaseElement:stopBenchmark(methodName) end - ----Gets benchmark statistics for a method ----@param methodName string The name of the method to get statistics for ----@return table ? stats The benchmark statistics or nil -function BaseElement:getBenchmarkStats(methodName) end - ----Sets the value of the Enabled property. ----@param self BaseElement self ----@param Enabled boolean Whether the element is enabled or not -function BaseElement:setEnabled(self, Enabled) end - ----Observes a property and calls a callback when it changes ----@param property string The property to observe ----@param callback function The callback to call when the property changes ----@return table self The BaseElement instance -function BaseElement:onChange(property, callback) end - ----Gets the value of the EventCallbacks property. ----@param self BaseElement self ----@return table BaseElement The event callbacks for the element -function BaseElement:getEventCallbacks(self) end - ----Sets the value of the Name property. ----@param self BaseElement self ----@param Name string The name of the element -function BaseElement:setName(self, Name) end - ----Gets the value of the Enabled property. ----@param self BaseElement self ----@return boolean BaseElement Whether the element is enabled or not -function BaseElement:getEnabled(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@return table self The BaseElement instance ----@protected -function BaseElement:postInit() end - ----Gets the value of the Type property. ----@param self BaseElement self ----@return string BaseElement The type identifier of the element -function BaseElement:getType(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return table self The initialized instance ----@protected -function BaseElement:init(props, basalt) end - ----Enables or disables event listening for a specific event ----@param eventName string The name of the event to listen for ----@return table self The BaseElement instance -function BaseElement:listenEvent(eventName) end - ----Sets the value of the Id property. ----@param self BaseElement self ----@param Id string The unique identifier for the element -function BaseElement:setId(self, Id) end - -function BaseElement:computed() end - ----Registers a new event callback for the element (on class level) ----@param class table The class to register ----@param callbackName string The name of the callback to register -function BaseElement.registerEventCallback(class, callbackName) end - ----Binds a property to a state ----@param self BaseElement The element to bind ----@param propertyName string The property to bind ----@param stateName string The state to bind to (optional, uses propertyName if not provided) ----@return BaseElement self The element instance -function BaseElement:bind(self, propertyName, stateName) end - ----Requests a render update for this element ----@return table self The BaseElement instance -function BaseElement:updateRender() end - ----Sets the value of the EventCallbacks property. ----@param self BaseElement self ----@param EventCallbacks table The event callbacks for the element -function BaseElement:setEventCallbacks(self, EventCallbacks) end - ----Registers a callback function for an event ----@param event string The event to register the callback for ----@param callback function The callback function to register ----@return table self The BaseElement instance -function BaseElement:registerCallback(event, callback) end - ----Gets the value of the Id property. ----@param self BaseElement self ----@return string BaseElement The unique identifier for the element -function BaseElement:getId(self) end - ----Dumps debug information for this element ----@param self BaseElement The element to dump debug info for -function BaseElement.dumpDebug(self) end - ----Ends profiling a method ----@param methodName string The name of the method to stop profiling ----@return BaseElement self The element instance -function BaseElement:endProfile(methodName) end - ----Starts profiling a method ----@param methodName string The name of the method to profile ----@return BaseElement self The element instance -function BaseElement:startProfile(methodName) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param event string The event to handle ----@return boolean ? handled Whether the event was handled ----@protected -function BaseElement:handleEvent(event) end - ----Gets the value of the Name property. ----@param self BaseElement self ----@return string BaseElement The name of the element -function BaseElement:getName(self) end - ----Triggers an event and calls all registered callbacks ----@param event string The event to fire ----@return table self The BaseElement instance -function BaseElement:fireEvent(event) end - ----Registers a callback for state changes ----@param self BaseElement The element to watch ----@param stateName string The state to watch ----@param callback function Called with (element, newValue, oldValue) ----@return BaseElement self The element instance -function BaseElement:onStateChange(self, stateName, callback) end - ----Destroys the element and cleans up all references -function BaseElement:destroy() end - ----Checks if the element is a specific type ----@param type string The type to check for ----@return boolean isType Whether the element is of the specified type -function BaseElement:isType(type) end - ----Returns the base frame of the element ----@return BaseFrame BaseFrame The base frame of the element -function BaseElement:getBaseFrame() end - ----Enables debugging for this element ----@param self BaseElement The element to debug ----@param level number The debug level -function BaseElement.debug(self, level) end - ----@class ComboBox : Dropdown ----@field viewOffset number The horizontal scroll offset for viewing long text ----@field placeholder string Text to display when input is empty ----@field text string The current text content of the ComboBox ----@field autoComplete boolean Whether to enable auto-complete filtering when typing ----@field focusedBackground color Background color when ComboBox is focused ----@field cursorPos number The current cursor position in the text ----@field editable boolean Whether the ComboBox allows text input ----@field placeholderColor color Color of the placeholder text ----@field manuallyOpened boolean Whether the dropdown was manually opened (not by auto-complete) ----@field focusedForeground color Foreground color when ComboBox is focused -local ComboBox = {} - ----Called when the ComboBox gains focus -function ComboBox:focus() end - ----Creates a new ComboBox instance ----@return ComboBox self The newly created ComboBox instance -function ComboBox.new() end - ----Gets the value of the FocusedForeground property. ----@param self ComboBox self ----@return color white Foreground color when ComboBox is focused -function ComboBox:getFocusedForeground(self) end - ----Gets the value of the Editable property. ----@param self ComboBox self ----@return boolean true Whether the ComboBox allows text input -function ComboBox:getEditable(self) end - ----Sets the value of the ViewOffset property. ----@param self ComboBox self ----@param ViewOffset number The horizontal scroll offset for viewing long text -function ComboBox:setViewOffset(self, ViewOffset) end - ----Sets the value of the FocusedForeground property. ----@param self ComboBox self ----@param FocusedForeground color Foreground color when ComboBox is focused -function ComboBox:setFocusedForeground(self, FocusedForeground) end - ----Gets the value of the FocusedBackground property. ----@param self ComboBox self ----@return color blue Background color when ComboBox is focused -function ComboBox:getFocusedBackground(self) end - ----Gets the value of the PlaceholderColor property. ----@param self ComboBox self ----@return color gray Color of the placeholder text -function ComboBox:getPlaceholderColor(self) end - ----Gets the value of the Placeholder property. ----@param self ComboBox self ----@return string "..." Text to display when input is empty -function ComboBox:getPlaceholder(self) end - ----Handles character input when editable ----@param char string The character that was typed -function ComboBox:char(char) end - ----Sets the value of the AutoComplete property. ----@param self ComboBox self ----@param AutoComplete boolean Whether to enable auto-complete filtering when typing -function ComboBox:setAutoComplete(self, AutoComplete) end - ----Handles key input when editable ----@param key number The key code that was pressed ----@param held boolean Whether the key is being held -function ComboBox:key(key, held) end - ----Sets the text content of the ComboBox ----@param text string The text to set ----@return ComboBox self -function ComboBox:setText(text) end - ----Sets the value of the PlaceholderColor property. ----@param self ComboBox self ----@param PlaceholderColor color Color of the placeholder text -function ComboBox:setPlaceholderColor(self, PlaceholderColor) end - ----Sets the value of the FocusedBackground property. ----@param self ComboBox self ----@param FocusedBackground color Background color when ComboBox is focused -function ComboBox:setFocusedBackground(self, FocusedBackground) end - ----Called when the ComboBox loses focus -function ComboBox:blur() end - ----Renders the ComboBox -function ComboBox:render() end - ----Gets the value of the AutoComplete property. ----@param self ComboBox self ----@return boolean false Whether to enable auto-complete filtering when typing -function ComboBox:getAutoComplete(self) end - ----Handles mouse clicks ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The mouse button (1 = left, 2 = right, 3 = middle) ----@param x number The x coordinate of the click ----@param y number The y coordinate of the click ----@return boolean handled Whether the event was handled ----@protected -function ComboBox:mouse_click(button, x, y) end - ----Gets the value of the ViewOffset property. ----@param self ComboBox self ----@return number 0 The horizontal scroll offset for viewing long text -function ComboBox:getViewOffset(self) end - ----Sets whether the ComboBox is editable ----@param editable boolean Whether the ComboBox should be editable ----@return ComboBox self -function ComboBox:setEditable(editable) end - ----Sets the value of the ManuallyOpened property. ----@param self ComboBox self ----@param ManuallyOpened boolean Whether the dropdown was manually opened (not by auto-complete) -function ComboBox:setManuallyOpened(self, ManuallyOpened) end - ----Gets the value of the CursorPos property. ----@param self ComboBox self ----@return number 1 The current cursor position in the text -function ComboBox:getCursorPos(self) end - ----Sets the value of the Placeholder property. ----@param self ComboBox self ----@param Placeholder string Text to display when input is empty -function ComboBox:setPlaceholder(self, Placeholder) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return ComboBox self The initialized instance ----@protected -function ComboBox:init(props, basalt) end - ----Gets the current text content ----@return string text The current text -function ComboBox:getText() end - ----Sets the value of the CursorPos property. ----@param self ComboBox self ----@param CursorPos number The current cursor position in the text -function ComboBox:setCursorPos(self, CursorPos) end - ----Gets the value of the ManuallyOpened property. ----@param self ComboBox self ----@return boolean false Whether the dropdown was manually opened (not by auto-complete) -function ComboBox:getManuallyOpened(self) end - ----@class ScrollBar : VisualElement ----@field dragMultiplier number How fast the ScrollBar moves when dragging ----@field orientation string Orientation of the ScrollBar ("vertical" or "horizontal") ----@field value number Current scroll value ----@field handleSize number Size of the ScrollBar handle in characters ----@field maxValue number 100 Maximum value or function that returns it ----@field minValue number 0 Minimum value or function that returns it ----@field step number Step size for scroll operations ----@field backgroundSymbol string Symbol used for the ScrollBar background ----@field min number Minimum scroll value ----@field max number Maximum scroll value ----@field attachedProperty string nil The property being controlled ----@field symbolBackgroundColor color Background color of the ScrollBar handle ----@field attachedElement table nil The element this ScrollBar is attached to ----@field symbol string " Symbol used for the ScrollBar handle -local ScrollBar = {} - ----Updates the attached element's property based on the ScrollBar value ----@return ScrollBar self The ScrollBar instance -function ScrollBar:updateAttachedElement() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param direction number The scroll direction (1 for up, -1 for down) ----@param x number The x position of the scroll ----@param y number The y position of the scroll ----@return boolean Whether the event was handled ----@protected -function ScrollBar:mouse_scroll(direction, x, y) end - ----Gets the value of the Step property. ----@param self ScrollBar self ----@return number 1 Step size for scroll operations -function ScrollBar:getStep(self) end - ----Sets the value of the Step property. ----@param self ScrollBar self ----@param Step number Step size for scroll operations -function ScrollBar:setStep(self, Step) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return ScrollBar self The initialized instance ----@protected -function ScrollBar:init(props, basalt) end - ----Gets the value of the HandleSize property. ----@param self ScrollBar self ----@return number 2 Size of the ScrollBar handle in characters -function ScrollBar:getHandleSize(self) end - ----Sets the value of the MaxValue property. ----@param self ScrollBar self ----@param MaxValue number 100 Maximum value or function that returns it -function ScrollBar:setMaxValue(self, MaxValue) end - ----Sets the value of the Value property. ----@param self ScrollBar self ----@param Value number Current scroll value -function ScrollBar:setValue(self, Value) end - ----Gets the value of the AttachedElement property. ----@param self ScrollBar self ----@return table ? nil The element this ScrollBar is attached to -function ScrollBar:getAttachedElement(self) end - ----Sets the value of the Symbol property. ----@param self ScrollBar self ----@param Symbol string " Symbol used for the ScrollBar handle -function ScrollBar:setSymbol(self, Symbol) end - ----Gets the value of the AttachedProperty property. ----@param self ScrollBar self ----@return string ? nil The property being controlled -function ScrollBar:getAttachedProperty(self) end - ----Sets the value of the HandleSize property. ----@param self ScrollBar self ----@param HandleSize number Size of the ScrollBar handle in characters -function ScrollBar:setHandleSize(self, HandleSize) end - ----Sets the value of the SymbolBackgroundColor property. ----@param self ScrollBar self ----@param SymbolBackgroundColor color Background color of the ScrollBar handle -function ScrollBar:setSymbolBackgroundColor(self, SymbolBackgroundColor) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The mouse button clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean Whether the event was handled ----@protected -function ScrollBar:mouse_click(button, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The mouse button being dragged ----@param x number The x position of the drag ----@param y number The y position of the drag ----@return boolean Whether the event was handled ----@protected -function ScrollBar:mouse_drag(button, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function ScrollBar:render() end - ----Gets the value of the Symbol property. ----@param self ScrollBar self ----@return string " " Symbol used for the ScrollBar handle -function ScrollBar:getSymbol(self) end - ----Attaches the ScrollBar to an element's property ----@param element BaseElement The element to attach to ----@param config table Configuration {property = "propertyName", min = number|function, max = number|function} ----@return ScrollBar self The ScrollBar instance -function ScrollBar:attach(element, config) end - ----Sets the value of the BackgroundSymbol property. ----@param self ScrollBar self ----@param BackgroundSymbol string Symbol used for the ScrollBar background -function ScrollBar:setBackgroundSymbol(self, BackgroundSymbol) end - ----Gets the value of the DragMultiplier property. ----@param self ScrollBar self ----@return number 1 How fast the ScrollBar moves when dragging -function ScrollBar:getDragMultiplier(self) end - ----Sets the value of the Orientation property. ----@param self ScrollBar self ----@param Orientation string Orientation of the ScrollBar ("vertical" or "horizontal") -function ScrollBar:setOrientation(self, Orientation) end - ----Gets the value of the SymbolBackgroundColor property. ----@param self ScrollBar self ----@return color black Background color of the ScrollBar handle -function ScrollBar:getSymbolBackgroundColor(self) end - ----Gets the value of the Orientation property. ----@param self ScrollBar self ----@return string vertical Orientation of the ScrollBar ("vertical" or "horizontal") -function ScrollBar:getOrientation(self) end - ----Gets the value of the Value property. ----@param self ScrollBar self ----@return number 0 Current scroll value -function ScrollBar:getValue(self) end - ----Gets the value of the MinValue property. ----@param self ScrollBar self ----@return number |function 0 Minimum value or function that returns it -function ScrollBar:getMinValue(self) end - ----Gets the value of the BackgroundSymbol property. ----@param self ScrollBar self ----@return string "\127" Symbol used for the ScrollBar background -function ScrollBar:getBackgroundSymbol(self) end - ----Sets the value of the Min property. ----@param self ScrollBar self ----@param Min number Minimum scroll value -function ScrollBar:setMin(self, Min) end - ----Sets the value of the MinValue property. ----@param self ScrollBar self ----@param MinValue number 0 Minimum value or function that returns it -function ScrollBar:setMinValue(self, MinValue) end - ----Sets the value of the DragMultiplier property. ----@param self ScrollBar self ----@param DragMultiplier number How fast the ScrollBar moves when dragging -function ScrollBar:setDragMultiplier(self, DragMultiplier) end - ----Sets the value of the Max property. ----@param self ScrollBar self ----@param Max number Maximum scroll value -function ScrollBar:setMax(self, Max) end - ----Sets the value of the AttachedElement property. ----@param self ScrollBar self ----@param AttachedElement table nil The element this ScrollBar is attached to -function ScrollBar:setAttachedElement(self, AttachedElement) end - ----Gets the value of the MaxValue property. ----@param self ScrollBar self ----@return number |function 100 Maximum value or function that returns it -function ScrollBar:getMaxValue(self) end - ----Gets the value of the Min property. ----@param self ScrollBar self ----@return number 0 Minimum scroll value -function ScrollBar:getMin(self) end - ----Sets the value of the AttachedProperty property. ----@param self ScrollBar self ----@param AttachedProperty string nil The property being controlled -function ScrollBar:setAttachedProperty(self, AttachedProperty) end - ----Gets the value of the Max property. ----@param self ScrollBar self ----@return number 100 Maximum scroll value -function ScrollBar:getMax(self) end - ----@class Tree : VisualElement ----@field expandedNodes table Table of nodes that are currently expanded ----@field horizontalOffset number Current horizontal scroll position ----@field nodeColor color Color of unselected nodes ----@field scrollOffset number Current vertical scroll position ----@field selectedNode table nil Currently selected node ----@field selectedColor color Background color of selected node ----@field nodes table The tree structure containing node objects with {text, children} properties -local Tree = {} - ----Gets the value of the SelectedColor property. ----@param self Tree self ----@return color lightBlue Background color of selected node -function Tree:getSelectedColor(self) end - ----Sets the value of the ExpandedNodes property. ----@param self Tree self ----@param ExpandedNodes table Table of nodes that are currently expanded -function Tree:setExpandedNodes(self, ExpandedNodes) end - ----Gets the value of the Nodes property. ----@param self Tree self ----@return table {} The tree structure containing node objects with {text, children} properties -function Tree:getNodes(self) end - ----Sets the value of the SelectedColor property. ----@param self Tree self ----@param SelectedColor color Background color of selected node -function Tree:setSelectedColor(self, SelectedColor) end - ----Gets the value of the NodeColor property. ----@param self Tree self ----@return color white Color of unselected nodes -function Tree:getNodeColor(self) end - ----Toggles a node's expanded state ----@param node table The node to toggle ----@return Tree self The Tree instance -function Tree:toggleNode(node) end - ----Initializes the Tree instance ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Tree self The initialized instance ----@protected -function Tree:init(props, basalt) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Tree:render() end - ----Sets the value of the ScrollOffset property. ----@param self Tree self ----@param ScrollOffset number Current vertical scroll position -function Tree:setScrollOffset(self, ScrollOffset) end - ----Sets the value of the SelectedNode property. ----@param self Tree self ----@param SelectedNode table nil Currently selected node -function Tree:setSelectedNode(self, SelectedNode) end - ----Gets the size of the tree ----@return number width The width of the tree ----@return number height The height of the tree -function Tree:getNodeSize() end - ----Expands a node ----@param node table The node to expand ----@return Tree self The Tree instance -function Tree:expandNode(node) end - ----Handles mouse click events ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Tree:mouse_click(button, x, y) end - ----Gets the value of the ScrollOffset property. ----@param self Tree self ----@return number 0 Current vertical scroll position -function Tree:getScrollOffset(self) end - ----Registers a callback for when a node is selected ----@param callback function The callback function ----@return Tree self The Tree instance -function Tree:onSelect(callback) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param direction number The scroll direction (1 for up, -1 for down) ----@param x number The x position of the scroll ----@param y number The y position of the scroll ----@return boolean handled Whether the event was handled ----@protected -function Tree:mouse_scroll(direction, x, y) end - ----Collapses a node ----@param node table The node to collapse ----@return Tree self The Tree instance -function Tree:collapseNode(node) end - ----Sets the value of the NodeColor property. ----@param self Tree self ----@param NodeColor color Color of unselected nodes -function Tree:setNodeColor(self, NodeColor) end - ----Sets the value of the HorizontalOffset property. ----@param self Tree self ----@param HorizontalOffset number Current horizontal scroll position -function Tree:setHorizontalOffset(self, HorizontalOffset) end - ----Gets the value of the SelectedNode property. ----@param self Tree self ----@return table ? nil Currently selected node -function Tree:getSelectedNode(self) end - ----Gets the value of the HorizontalOffset property. ----@param self Tree self ----@return number 0 Current horizontal scroll position -function Tree:getHorizontalOffset(self) end - ----Sets the value of the Nodes property. ----@param self Tree self ----@param Nodes table The tree structure containing node objects with {text, children} properties -function Tree:setNodes(self, Nodes) end - ----Gets the value of the ExpandedNodes property. ----@param self Tree self ----@return table {} Table of nodes that are currently expanded -function Tree:getExpandedNodes(self) end - ----@class BigFontText -local BigFontText = {} - ----@class AnimationInstance -local AnimationInstance = {} - ----Creates a new AnimationInstance ----@param element VisualElement The element to animate ----@param animType string The type of animation ----@param args table The animation arguments ----@param duration number Duration in seconds ----@param easing string The easing function name ----@return AnimationInstance The new animation instance -function AnimationInstance.new(element, animType, args, duration, easing) end - ----Updates the animation ----@param elapsed number The elapsed time in seconds ----@return boolean Whether the animation is finished -function AnimationInstance:update(elapsed) end - ----Gets called when the animation is completed -function AnimationInstance:complete() end - ----Starts the animation ----@return AnimationInstance self The animation instance -function AnimationInstance:start() end - ----@class Slider : VisualElement ----@field step number Current position of the slider handle (1 to width/height) ----@field sliderColor color Color of the slider handle ----@field barColor color Color of the slider track ----@field max number Maximum value for value conversion (maps slider position to this range) ----@field horizontal boolean Whether the slider is horizontal (false for vertical) -local Slider = {} - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Slider:render() end - ----Gets the value of the Max property. ----@param self Slider self ----@return number 100 Maximum value for value conversion (maps slider position to this range) -function Slider:getMax(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Slider self The initialized instance ----@protected -function Slider:init(props, basalt) end - ----Gets the value of the Horizontal property. ----@param self Slider self ----@return boolean true Whether the slider is horizontal (false for vertical) -function Slider:getHorizontal(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The mouse button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Slider:mouse_click(button, x, y) end - ----Sets the value of the SliderColor property. ----@param self Slider self ----@param SliderColor color Color of the slider handle -function Slider:setSliderColor(self, SliderColor) end - ----Sets the value of the Horizontal property. ----@param self Slider self ----@param Horizontal boolean Whether the slider is horizontal (false for vertical) -function Slider:setHorizontal(self, Horizontal) end - ----Gets the current value of the slider ----@return number value The current value (0 to max) -function Slider:getValue() end - ----Registers a function to handle the onChange event. ----@param value number ----@param self Slider self ----@param func function The function to be called when the event fires -function Slider:onOnChange(self, func) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The mouse button that was released ----@param x number The x position of the release ----@param y number The y position of the release ----@return boolean handled Whether the event was handled ----@protected -function Slider:mouse_scroll(button, x, y) end - ----Sets the value of the BarColor property. ----@param self Slider self ----@param BarColor color Color of the slider track -function Slider:setBarColor(self, BarColor) end - ----Gets the value of the SliderColor property. ----@param self Slider self ----@return color blue Color of the slider handle -function Slider:getSliderColor(self) end - ----Gets the value of the BarColor property. ----@param self Slider self ----@return color gray Color of the slider track -function Slider:getBarColor(self) end - ----Gets the value of the Step property. ----@param self Slider self ----@return number 1 Current position of the slider handle (1 to width/height) -function Slider:getStep(self) end - ----Sets the value of the Step property. ----@param self Slider self ----@param Step number Current position of the slider handle (1 to width/height) -function Slider:setStep(self, Step) end - ----Sets the value of the Max property. ----@param self Slider self ----@param Max number Maximum value for value conversion (maps slider position to this range) -function Slider:setMax(self, Max) end - ----@class ProgressBar : VisualElement ----@field progressColor color The color used for the filled portion of the progress bar ----@field direction string The direction of the progress bar ("up", "down", "left", "right") ----@field showPercentage boolean Whether to show the percentage text in the center ----@field progress number Current progress value (0-100) -local ProgressBar = {} - ----Sets the value of the ProgressColor property. ----@param self ProgressBar self ----@param ProgressColor color The color used for the filled portion of the progress bar -function ProgressBar:setProgressColor(self, ProgressColor) end - ----Gets the value of the Direction property. ----@param self ProgressBar self ----@return string right The direction of the progress bar ("up", "down", "left", "right") -function ProgressBar:getDirection(self) end - ----Gets the value of the ProgressColor property. ----@param self ProgressBar self ----@return color lime The color used for the filled portion of the progress bar -function ProgressBar:getProgressColor(self) end - ----Sets the value of the Progress property. ----@param self ProgressBar self ----@param Progress number Current progress value (0-100) -function ProgressBar:setProgress(self, Progress) end - ----Gets the value of the Progress property. ----@param self ProgressBar self ----@return number 0 Current progress value (0-100) -function ProgressBar:getProgress(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return ProgressBar self The initialized instance ----@protected -function ProgressBar:init(props, basalt) end - ----Sets the value of the Direction property. ----@param self ProgressBar self ----@param Direction string The direction of the progress bar ("up", "down", "left", "right") -function ProgressBar:setDirection(self, Direction) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function ProgressBar:render() end - ----Gets the value of the ShowPercentage property. ----@param self ProgressBar self ----@return boolean false Whether to show the percentage text in the center -function ProgressBar:getShowPercentage(self) end - ----Sets the value of the ShowPercentage property. ----@param self ProgressBar self ----@param ShowPercentage boolean Whether to show the percentage text in the center -function ProgressBar:setShowPercentage(self, ShowPercentage) end - ----@class Table : VisualElement ----@field data table The table data as array of row arrays ----@field gridColor color Color of grid lines ----@field selectedColor color Background color of selected row ----@field columns table List of column definitions with {name, width} properties ----@field sortColumn number nil Currently sorted column index ----@field headerColor color Color of the column headers ----@field selectedRow number nil Currently selected row index ----@field scrollOffset number Current scroll position ----@field customSortFunction table Custom sort functions for columns ----@field sortDirection string Sort direction ("asc" or "desc") -local Table = {} - ----Sets the value of the GridColor property. ----@param self Table self ----@param GridColor color Color of grid lines -function Table:setGridColor(self, GridColor) end - ----Sets a custom sort function for a specific column ----@param columnIndex number The index of the column ----@param sortFn function Function that takes (rowA, rowB) and returns comparison result ----@return Table self The Table instance -function Table:setColumnSortFunction(columnIndex, sortFn) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Table:render() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param direction number The scroll direction (-1 up, 1 down) ----@param x number The x position of the scroll ----@param y number The y position of the scroll ----@return boolean handled Whether the event was handled ----@protected -function Table:mouse_scroll(direction, x, y) end - ----Sets the value of the SortDirection property. ----@param self Table self ----@param SortDirection string Sort direction ("asc" or "desc") -function Table:setSortDirection(self, SortDirection) end - ----Sets the value of the SelectedRow property. ----@param self Table self ----@param SelectedRow number nil Currently selected row index -function Table:setSelectedRow(self, SelectedRow) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Table:mouse_click(button, x, y) end - ----Adds data with both display and sort values ----@param displayData table The formatted data for display ----@param sortData table The raw data for sorting (optional) ----@return Table self The Table instance -function Table:setFormattedData(displayData, sortData) end - ----Gets the value of the HeaderColor property. ----@param self Table self ----@return color blue Color of the column headers -function Table:getHeaderColor(self) end - ----Gets the value of the SortDirection property. ----@param self Table self ----@return string "asc" Sort direction ("asc" or "desc") -function Table:getSortDirection(self) end - ----Gets the value of the GridColor property. ----@param self Table self ----@return color gray Color of grid lines -function Table:getGridColor(self) end - ----Gets the value of the SelectedColor property. ----@param self Table self ----@return color lightBlue Background color of selected row -function Table:getSelectedColor(self) end - ----Sorts the table data by column ----@param columnIndex number The index of the column to sort by ----@param fn function ? Optional custom sorting function ----@return Table self The Table instance -function Table:sortData(columnIndex, fn) end - ----Adds a new row of data to the table ----@return Table self The Table instance -function Table:addData() end - ----Adds a new column to the table ----@param name string The name of the column ----@param width number The width of the column ----@return Table self The Table instance -function Table:addColumn(name, width) end - ----Gets the value of the CustomSortFunction property. ----@param self Table self ----@return table {} Custom sort functions for columns -function Table:getCustomSortFunction(self) end - ----Sets the value of the CustomSortFunction property. ----@param self Table self ----@param CustomSortFunction table Custom sort functions for columns -function Table:setCustomSortFunction(self, CustomSortFunction) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Table self The initialized instance ----@protected -function Table:init(props, basalt) end - ----Gets the value of the ScrollOffset property. ----@param self Table self ----@return number 0 Current scroll position -function Table:getScrollOffset(self) end - ----Set data with automatic formatting ----@param rawData table The raw data array ----@param formatters table Optional formatter functions for columns {[2] = function(value) return value end} ----@return Table self The Table instance -function Table:setData(rawData, formatters) end - ----Sets the value of the Columns property. ----@param self Table self ----@param Columns table List of column definitions with {name, width} properties -function Table:setColumns(self, Columns) end - ----Gets the value of the SortColumn property. ----@param self Table self ----@return number ? nil Currently sorted column index -function Table:getSortColumn(self) end - ----Gets the value of the Columns property. ----@param self Table self ----@return table {} List of column definitions with {name, width} properties -function Table:getColumns(self) end - ----Gets the value of the SelectedRow property. ----@param self Table self ----@return number ? nil Currently selected row index -function Table:getSelectedRow(self) end - ----Sets the value of the SelectedColor property. ----@param self Table self ----@param SelectedColor color Background color of selected row -function Table:setSelectedColor(self, SelectedColor) end - ----Gets the value of the Data property. ----@param self Table self ----@return table {} The table data as array of row arrays -function Table:getData(self) end - ----Sets the value of the HeaderColor property. ----@param self Table self ----@param HeaderColor color Color of the column headers -function Table:setHeaderColor(self, HeaderColor) end - ----Sets the value of the ScrollOffset property. ----@param self Table self ----@param ScrollOffset number Current scroll position -function Table:setScrollOffset(self, ScrollOffset) end - ----Sets the value of the SortColumn property. ----@param self Table self ----@param SortColumn number nil Currently sorted column index -function Table:setSortColumn(self, SortColumn) end - ----@class Image : VisualElement ----@field autoResize boolean Whether to automatically resize the image when content exceeds bounds ----@field offsetX number Horizontal offset for viewing larger images ----@field currentFrame number Current animation frame ----@field bimg table The bimg image data ----@field offsetY number Vertical offset for viewing larger images -local Image = {} - ----Sets the value of the Bimg property. ----@param self Image self ----@param Bimg table The bimg image data -function Image:setBimg(self, Bimg) end - ----Gets the text at the specified position ----@param x number The x position ----@param y number The y position ----@param length number The length of the text to get ----@return string text The text at the specified position -function Image:getText(x, y, length) end - ----Updates the specified frame with the provided data ----@param frameIndex number The index of the frame to update ----@param frame table The new frame data ----@return Image self The Image instance -function Image:updateFrame(frameIndex, frame) end - ----Gets the value of the CurrentFrame property. ----@param self Image self ----@return number 1 Current animation frame -function Image:getCurrentFrame(self) end - ----Sets the metadata of the image ----@param key string The key of the metadata to set ----@param value string The value of the metadata to set ----@return Image self The Image instance -function Image:setMetadata(key, value) end - ----Gets the value of the AutoResize property. ----@param self Image self ----@return boolean false Whether to automatically resize the image when content exceeds bounds -function Image:getAutoResize(self) end - ----Gets the value of the Bimg property. ----@param self Image self ----@return table {} The bimg image data -function Image:getBimg(self) end - ----Gets the background color at the specified position ----@param x number The x position ----@param y number The y position ----@param length number The length of the background color pattern to get ----@return string bg The background color pattern -function Image:getBg(x, y, length) end - ----Sets the value of the CurrentFrame property. ----@param self Image self ----@param CurrentFrame number Current animation frame -function Image:setCurrentFrame(self, CurrentFrame) end - ----Resizes the image to the specified width and height ----@param width number The new width of the image ----@param height number The new height of the image ----@return Image self The Image instance -function Image:resizeImage(width, height) end - ----Gets the metadata of the image ----@return table metadata The metadata of the image -function Image:getMetadata() end - ----Gets the value of the OffsetX property. ----@param self Image self ----@return number 0 Horizontal offset for viewing larger images -function Image:getOffsetX(self) end - ----Sets the pixel at the specified position ----@param x number The x position ----@param y number The y position ----@param char string The character to set ----@param fg string The foreground color pattern ----@param bg string The background color pattern ----@return Image self The Image instance -function Image:setPixel(x, y, char, fg, bg) end - ----Sets the foreground color at the specified position ----@param x number The x position ----@param y number The y position ----@param pattern string The foreground color pattern ----@return Image self The Image instance -function Image:setFg(x, y, pattern) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Image:render() end - ----Sets the text at the specified position ----@param x number The x position ----@param y number The y position ----@param text string The text to set ----@return Image self The Image instance -function Image:setText(x, y, text) end - ----Adds a new frame to the image ----@return Image self The Image instance -function Image:addFrame() end - ----Advances to the next frame in the animation ----@return Image self The Image instance -function Image:nextFrame() end - ----Gets pixel information at position ----@param x number X position ----@param y number Y position ----@return number ? fg Foreground color ----@return number ? bg Background color ----@return string ? char Character at position -function Image:getPixelData(x, y) end - ----Sets the value of the AutoResize property. ----@param self Image self ----@param AutoResize boolean Whether to automatically resize the image when content exceeds bounds -function Image:setAutoResize(self, AutoResize) end - ----Gets the specified frame ----@param frameIndex number The index of the frame to get ----@return table frame The frame data -function Image:getFrame(frameIndex) end - ----Gets the size of the image ----@return number width The width of the image ----@return number height The height of the image -function Image:getImageSize() end - ----Sets the background color at the specified position ----@param x number The x position ----@param y number The y position ----@param pattern string The background color pattern ----@return Image self The Image instance -function Image:setBg(x, y, pattern) end - ----Gets the foreground color at the specified position ----@param x number The x position ----@param y number The y position ----@param length number The length of the foreground color pattern to get ----@return string fg The foreground color pattern -function Image:getFg(x, y, length) end - ----Sets the value of the OffsetX property. ----@param self Image self ----@param OffsetX number Horizontal offset for viewing larger images -function Image:setOffsetX(self, OffsetX) end - ----Gets the value of the OffsetY property. ----@param self Image self ----@return number 0 Vertical offset for viewing larger images -function Image:getOffsetY(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Image self The initialized instance ----@protected -function Image:init(props, basalt) end - ----Sets the value of the OffsetY property. ----@param self Image self ----@param OffsetY number Vertical offset for viewing larger images -function Image:setOffsetY(self, OffsetY) end - ----@class BaseFrame : Container ----@field term term term.current() The terminal or (monitor) peripheral object to render to -local BaseFrame = {} - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to render to ----@param y number The y position to render to ----@param text string The text to render ----@param bg colors The background color ----@protected -function BaseFrame:textBg(x, y, text, bg) end - -function BaseFrame:drawBg() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function BaseFrame:render() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param key number The key that was pressed ----@protected -function BaseFrame:key(key) end - -function BaseFrame:dispatchEvent() end - -function BaseFrame.setup() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param name string The name of the monitor that was touched ----@param x number The x position of the mouse ----@param y number The y position of the mouse ----@protected -function BaseFrame:monitor_touch(name, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param char string The character that was pressed ----@protected -function BaseFrame:char(char) end - ----Hides the debug log frame ----@param self BaseFrame The frame to hide debug log for -function BaseFrame.closeConsole(self) end - ----Initializes a new state for this element ----@param self BaseFrame The element to initialize state for ----@param name string The name of the state ----@param default any The default value of the state ----@return BaseFrame self The element instance -function BaseFrame:initializeState(self, name, default) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was released ----@param x number The x position of the mouse ----@param y number The y position of the mouse ----@protected -function BaseFrame:mouse_up(button, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return table self The initialized instance ----@protected -function BaseFrame:init(props, basalt) end - ----Gets the value of the Term property. ----@param self BaseFrame self ----@return term |peripheral term.current() The terminal or (monitor) peripheral object to render to -function BaseFrame:getTerm(self) end - ----Toggles the debug log frame ----@param self BaseFrame The frame to toggle debug log for -function BaseFrame.toggleConsole(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to render to ----@param y number The y position to render to ----@param text string The text to render ----@param fg colors The foreground color ----@protected -function BaseFrame:textFg(x, y, text, fg) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to render to ----@param y number The y position to render to ----@param width number The width of the text ----@param height number The height of the text ----@param text string The text to render ----@param fg string The foreground color ----@param bg string The background color ----@protected -function BaseFrame:multiBlit(x, y, width, height, text, fg, bg) end - -function BaseFrame:drawFg() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to render to ----@param y number The y position to render to ----@param text string The text to render ----@param bg colors The background color ----@protected -function BaseFrame:drawText(x, y, text, bg) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the mouse ----@param y number The y position of the mouse ----@protected -function BaseFrame:mouse_click(button, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to render to ----@param y number The y position to render to ----@param text string The text to render ----@param fg string The foreground color ----@param bg string The background color ----@protected -function BaseFrame:blit(x, y, text, fg, bg) end - ----Sets the value of the Term property. ----@param self BaseFrame self ----@param Term term term.current() The terminal or (monitor) peripheral object to render to -function BaseFrame:setTerm(self, Term) end - ----Shows the debug log frame ----@param self BaseFrame The frame to show debug log in -function BaseFrame.openConsole(self) end - ----Sets the cursor position ----@param x number The x position to set the cursor to ----@param y number The y position to set the cursor to ----@param blink boolean Whether the cursor should blink -function BaseFrame:setCursor(x, y, blink) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param key number The key that was released ----@protected -function BaseFrame:key_up(key) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function BaseFrame:term_resize() end - ----@class DropDown : List ----@field selectedText string The text to show when no item is selected ----@field dropdownHeight number Maximum height of the DropDown menu when open ----@field isOpen boolean Whether the DropDown menu is currently open ----@field dropSymbol string The symbol to show for DropDown indication -local DropDown = {} - ----Sets the value of the DropSymbol property. ----@param self DropDown self ----@param DropSymbol string The symbol to show for DropDown indication -function DropDown:setDropSymbol(self, DropSymbol) end - ----Sets the value of the DropdownHeight property. ----@param self DropDown self ----@param DropdownHeight number Maximum height of the DropDown menu when open -function DropDown:setDropdownHeight(self, DropdownHeight) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return DropDown self The initialized instance ----@protected -function DropDown:init(props, basalt) end - ----Gets the value of the DropSymbol property. ----@param self DropDown self ----@return string "\31" The symbol to show for DropDown indication -function DropDown:getDropSymbol(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function DropDown:mouse_click(button, x, y) end - ----Gets the value of the IsOpen property. ----@param self DropDown self ----@return boolean false Whether the DropDown menu is currently open -function DropDown:getIsOpen(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function DropDown:render() end - ----Sets the value of the IsOpen property. ----@param self DropDown self ----@param IsOpen boolean Whether the DropDown menu is currently open -function DropDown:setIsOpen(self, IsOpen) end - ----Gets the value of the DropdownHeight property. ----@param self DropDown self ----@return number 5 Maximum height of the DropDown menu when open -function DropDown:getDropdownHeight(self) end - ----Sets the value of the SelectedText property. ----@param self DropDown self ----@param SelectedText string The text to show when no item is selected -function DropDown:setSelectedText(self, SelectedText) end - ----Gets the value of the SelectedText property. ----@param self DropDown self ----@return string "" The text to show when no item is selected -function DropDown:getSelectedText(self) end - ----@class Input : VisualElement ----@field viewOffset number The horizontal scroll offset for viewing long text ----@field placeholder string Text to display when input is empty ----@field focusedForeground color Foreground color when input is focused ----@field focusedBackground color Background color when input is focused ----@field cursorPos number The current cursor position in the text ----@field replaceChar string Character to replace the input with (for password fields) ----@field placeholderColor color Color of the placeholder text ----@field cursorColor number Color of the cursor ----@field pattern string nil Regular expression pattern for input validation ----@field text string The current text content of the input ----@field maxLength number nil Maximum length of input text (optional) -local Input = {} - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Input:render() end - ----Gets the value of the CursorPos property. ----@param self Input self ----@return number 1 The current cursor position in the text -function Input:getCursorPos(self) end - ----Sets the value of the ReplaceChar property. ----@param self Input self ----@param ReplaceChar string Character to replace the input with (for password fields) -function Input:setReplaceChar(self, ReplaceChar) end - ----Sets the value of the ViewOffset property. ----@param self Input self ----@param ViewOffset number The horizontal scroll offset for viewing long text -function Input:setViewOffset(self, ViewOffset) end - ----Gets the value of the FocusedForeground property. ----@param self Input self ----@return color white Foreground color when input is focused -function Input:getFocusedForeground(self) end - ----Gets the value of the ReplaceChar property. ----@param self Input self ----@return string nil Character to replace the input with (for password fields) -function Input:getReplaceChar(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Input:paste() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param key number The key that was pressed ----@return boolean handled Whether the event was handled ----@protected -function Input:key(key) end - ----Sets the value of the CursorPos property. ----@param self Input self ----@param CursorPos number The current cursor position in the text -function Input:setCursorPos(self, CursorPos) end - ----Sets the value of the Text property. ----@param self Input self ----@param Text string The current text content of the input -function Input:setText(self, Text) end - ----Sets the value of the Placeholder property. ----@param self Input self ----@param Placeholder string Text to display when input is empty -function Input:setPlaceholder(self, Placeholder) end - ----Updates the input's viewport ----@return Input self The updated instance -function Input:updateViewport() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Input:mouse_click(button, x, y) end - ----Gets the value of the PlaceholderColor property. ----@param self Input self ----@return color gray Color of the placeholder text -function Input:getPlaceholderColor(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Input:blur() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param char string The character that was typed ----@return boolean handled Whether the event was handled ----@protected -function Input:char(char) end - ----Gets the value of the Text property. ----@param self Input self ----@return string - The current text content of the input -function Input:getText(self) end - ----Sets the cursor position and color ----@param x number The x position of the cursor ----@param y number The y position of the cursor ----@param blink boolean Whether the cursor should blink ----@param color number The color of the cursor -function Input:setCursor(x, y, blink, color) end - ----Sets the value of the Pattern property. ----@param self Input self ----@param Pattern string nil Regular expression pattern for input validation -function Input:setPattern(self, Pattern) end - ----Sets the value of the PlaceholderColor property. ----@param self Input self ----@param PlaceholderColor color Color of the placeholder text -function Input:setPlaceholderColor(self, PlaceholderColor) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Input self The initialized instance ----@protected -function Input:init(props, basalt) end - ----Sets the value of the CursorColor property. ----@param self Input self ----@param CursorColor number Color of the cursor -function Input:setCursorColor(self, CursorColor) end - ----Sets the value of the FocusedForeground property. ----@param self Input self ----@param FocusedForeground color Foreground color when input is focused -function Input:setFocusedForeground(self, FocusedForeground) end - ----Sets the value of the FocusedBackground property. ----@param self Input self ----@param FocusedBackground color Background color when input is focused -function Input:setFocusedBackground(self, FocusedBackground) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Input:focus() end - ----Gets the value of the Pattern property. ----@param self Input self ----@return string ? nil Regular expression pattern for input validation -function Input:getPattern(self) end - ----Sets the value of the MaxLength property. ----@param self Input self ----@param MaxLength number nil Maximum length of input text (optional) -function Input:setMaxLength(self, MaxLength) end - ----Gets the value of the Placeholder property. ----@param self Input self ----@return string ... Text to display when input is empty -function Input:getPlaceholder(self) end - ----Gets the value of the ViewOffset property. ----@param self Input self ----@return number 0 The horizontal scroll offset for viewing long text -function Input:getViewOffset(self) end - ----Gets the value of the MaxLength property. ----@param self Input self ----@return number ? nil Maximum length of input text (optional) -function Input:getMaxLength(self) end - ----Gets the value of the CursorColor property. ----@param self Input self ----@return number nil Color of the cursor -function Input:getCursorColor(self) end - ----Gets the value of the FocusedBackground property. ----@param self Input self ----@return color blue Background color when input is focused -function Input:getFocusedBackground(self) end - ----@class Label : VisualElement ----@field text string The text content to display. Can be a string or a function that returns a string ----@field autoSize boolean Whether the label should automatically resize its width based on the text content -local Label = {} - ----Gets the value of the Text property. ----@param self Label self ----@return string Label The text content to display. Can be a string or a function that returns a string -function Label:getText(self) end - ----Sets the value of the AutoSize property. ----@param self Label self ----@param AutoSize boolean Whether the label should automatically resize its width based on the text content -function Label:setAutoSize(self, AutoSize) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Label:render() end - ----Sets the value of the Text property. ----@param self Label self ----@param Text string The text content to display. Can be a string or a function that returns a string -function Label:setText(self, Text) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Label self The initialized instance ----@protected -function Label:init(props, basalt) end - ----Gets the wrapped lines of the Label ----@return table wrappedText The wrapped lines of the Label -function Label:getWrappedText() end - ----Gets the value of the AutoSize property. ----@param self Label self ----@return boolean true Whether the label should automatically resize its width based on the text content -function Label:getAutoSize(self) end - ----@class TextBox : VisualElement ----@field cursorX number Cursor X position ----@field editable boolean Whether text can be edited ----@field scrollX number Horizontal scroll offset ----@field cursorColor number Color of the cursor ----@field cursorY number Cursor Y position (line number) ----@field syntaxPatterns table Syntax highlighting patterns ----@field lines table Array of text lines ----@field scrollY number Vertical scroll offset -local TextBox = {} - ----Sets the value of the CursorColor property. ----@param self TextBox self ----@param CursorColor number Color of the cursor -function TextBox:setCursorColor(self, CursorColor) end - ----Sets the value of the SyntaxPatterns property. ----@param self TextBox self ----@param SyntaxPatterns table Syntax highlighting patterns -function TextBox:setSyntaxPatterns(self, SyntaxPatterns) end - ----Sets the value of the CursorX property. ----@param self TextBox self ----@param CursorX number Cursor X position -function TextBox:setCursorX(self, CursorX) end - ----Gets the value of the ScrollX property. ----@param self TextBox self ----@return number 0 Horizontal scroll offset -function TextBox:getScrollX(self) end - ----Sets the value of the ScrollY property. ----@param self TextBox self ----@param ScrollY number Vertical scroll offset -function TextBox:setScrollY(self, ScrollY) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function TextBox:mouse_click(button, x, y) end - ----Gets the value of the CursorX property. ----@param self TextBox self ----@return number 1 Cursor X position -function TextBox:getCursorX(self) end - ----Gets the value of the CursorY property. ----@param self TextBox self ----@return number 1 Cursor Y position (line number) -function TextBox:getCursorY(self) end - ----Sets the text of the TextBox ----@param text string The text to set ----@return TextBox self The TextBox instance -function TextBox:setText(text) end - ----Sets the value of the Lines property. ----@param self TextBox self ----@param Lines table Array of text lines -function TextBox:setLines(self, Lines) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function TextBox:render() end - ----Gets the text of the TextBox ----@return string text The text of the TextBox -function TextBox:getText() end - ----Adds a new syntax highlighting pattern ----@param pattern string The regex pattern to match ----@param color number The color to apply ----@return TextBox self The TextBox instance -function TextBox:addSyntaxPattern(pattern, color) end - ----Gets the value of the SyntaxPatterns property. ----@param self TextBox self ----@return table {} Syntax highlighting patterns -function TextBox:getSyntaxPatterns(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function TextBox:paste() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param char string The character that was typed ----@return boolean handled Whether the event was handled ----@protected -function TextBox:char(char) end - ----Sets the value of the ScrollX property. ----@param self TextBox self ----@param ScrollX number Horizontal scroll offset -function TextBox:setScrollX(self, ScrollX) end - ----Clears all syntax highlighting patterns ----@return TextBox self -function TextBox:clearSyntaxPatterns() end - ----Sets the value of the CursorY property. ----@param self TextBox self ----@param CursorY number Cursor Y position (line number) -function TextBox:setCursorY(self, CursorY) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param key number The key that was pressed ----@return boolean handled Whether the event was handled ----@protected -function TextBox:key(key) end - ----Removes a syntax pattern by index (1-based) ----@param index number The index of the pattern to remove ----@return TextBox self -function TextBox:removeSyntaxPattern(index) end - ----Updates the viewport to keep the cursor in view ----@return TextBox self The TextBox instance -function TextBox:updateViewport() end - ----Gets the value of the Lines property. ----@param self TextBox self ----@return table {} Array of text lines -function TextBox:getLines(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return TextBox self The initialized instance ----@protected -function TextBox:init(props, basalt) end - ----Gets the value of the Editable property. ----@param self TextBox self ----@return boolean true Whether text can be edited -function TextBox:getEditable(self) end - ----Gets the value of the ScrollY property. ----@param self TextBox self ----@return number 0 Vertical scroll offset -function TextBox:getScrollY(self) end - ----Sets the value of the Editable property. ----@param self TextBox self ----@param Editable boolean Whether text can be edited -function TextBox:setEditable(self, Editable) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param direction number The scroll direction ----@param x number The x position of the scroll ----@param y number The y position of the scroll ----@return boolean handled Whether the event was handled ----@protected -function TextBox:mouse_scroll(direction, x, y) end - ----Gets the value of the CursorColor property. ----@param self TextBox self ----@return number nil Color of the cursor -function TextBox:getCursorColor(self) end - ----@class Menu : List ----@field separatorColor color The color used for separator items in the menu -local Menu = {} - ----Gets the value of the SeparatorColor property. ----@param self Menu self ----@return color gray The color used for separator items in the menu -function Menu:getSeparatorColor(self) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Menu:render() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean Whether the event was handled ----@protected -function Menu:mouse_click(button, x, y) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Menu self The initialized instance ----@protected -function Menu:init(props, basalt) end - ----Sets the value of the SeparatorColor property. ----@param self Menu self ----@param SeparatorColor color The color used for separator items in the menu -function Menu:setSeparatorColor(self, SeparatorColor) end - ----Sets the menu items ----@param items table [] List of items with {text, separator, callback, foreground, background} properties ----@return Menu self The Menu instance -function Menu:setItems(items) end - ----@class PropertySystem -local PropertySystem = {} - ----Removes all observers from a property ----@return table self The PropertySystem -function PropertySystem:removeAllObservers() end - ----Observers a property ----@param name string The name of the property ----@param callback function The callback function to call when the property changes ----@return table self The PropertySystem -function PropertySystem:observe(name, callback) end - ----Removes a property from the PropertySystem on instance level ----@param name string The name of the property ----@return table self The PropertySystem -function PropertySystem:removeProperty(name) end - ----Update call for a property IS USED INTERNALLY ----@param name string The name of the property ----@param value any The value of the property ----@return table self The PropertySystem -function PropertySystem:_updateProperty(name, value) end - ----Initializes the PropertySystem IS USED INTERNALLY ----@return table self The PropertySystem -function PropertySystem:__init() end - ----Creates an element from a blueprint ----@param elementClass table The element class to create from the blueprint ----@param blueprint table The blueprint to create the element from ----@return table element The created element -function PropertySystem.createFromBlueprint(elementClass, blueprint) end - ----Gets a property configuration ----@param name string The name of the property ----@return table config The configuration of the property -function PropertySystem:getPropertyConfig(name) end - ----Adds a property to the PropertySystem on instance level ----@param name string The name of the property ----@param config table The configuration of the property ----@return table self The PropertySystem -function PropertySystem:instanceProperty(name, config) end - ----Removes an observer from a property ----@param name string The name of the property ----@param callback function The callback function to remove ----@return table self The PropertySystem -function PropertySystem:removeObserver(name, callback) end - ----Creates a blueprint of an element class with all its properties ----@param elementClass table The element class to create a blueprint from ----@return table blueprint A table containing all property definitions -function PropertySystem.blueprint(elementClass) end - ----Adds a setter hook to the PropertySystem. Setter hooks are functions that are called before a property is set. ----@param hook function The hook function to add -function PropertySystem.addSetterHook(hook) end - ----Defines a property for an element class ----@param class table The element class to define the property for ----@param name string The name of the property ----@param config table The configuration of the property -function PropertySystem.defineProperty(class, name, config) end - ----Combines multiple properties into a single getter and setter ----@param class table The element class to combine the properties for ----@param name string The name of the combined property -function PropertySystem.combineProperties(class, name) end - ----@class Container : VisualElement ----@field visibleChildrenEvents table The visible children events of the container ----@field eventListenerCount table The event listener count of the container ----@field childrenEvents table The children events of the container ----@field offsetY number Vertical content offset ----@field children table The children of the container ----@field childrenSorted boolean Whether the children are sorted ----@field focusedChild table The focused child of the container ----@field offsetX number Horizontal content offset ----@field visibleChildren table The visible children of the container ----@field childrenEventsSorted boolean Whether the children events are sorted -local Container = {} - ----Creates a new BigFont element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return BigFont element A new BigFont element. -function Container:addBigFont(self, props) end - ----Creates a new Scrollbar element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Scrollbar element A new Scrollbar element. -function Container:addScrollbar(self, props) end - ----Creates a new Container element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Container element A new Container element. -function Container:addContainer(self, props) end - ----Creates a new List element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return List element A new List element. -function Container:addList(self, props) end - ----Gets the value of the OffsetX property. ----@param self Container self ----@return number 0 Horizontal content offset -function Container:getOffsetX(self) end - ----Stops benchmarking for a container and all its children ----@param methodName string The method to stop benchmarking ----@return Container self The container instance -function Container:stopContainerBenchmark(methodName) end - ---This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to draw the text ----@param y number The y position to draw the text ----@param text string The text to draw ----@param bg color The background color of the text ----@return Container self The container instance ---@protected -function Container:textBg(x, y, text, bg) end - ----Creates a new ComboBox element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return ComboBox element A new ComboBox element. -function Container:addComboBox(self, props) end - ----Creates a new Flexbox element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Flexbox element A new Flexbox element. -function Container:addFlexbox(self, props) end - ----Creates a new VisualElement element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return VisualElement element A new VisualElement element. -function Container:addVisualElement(self, props) end - ----Registers the children events of the container ----@param child table The child to register events for ----@return Container self The container instance -function Container:registerChildrenEvents(child) end - ----Creates a new TextBox element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return TextBox element A new TextBox element. -function Container:addTextBox(self, props) end - ----Clears the container ----@return Container self The container instance -function Container:clear() end - ----Enables benchmarking for a container and all its children ----@param methodName string The method to benchmark ----@return Container self The container instance -function Container:benchmarkContainer(methodName) end - ----Creates a new Frame element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Frame element A new Frame element. -function Container:addFrame(self, props) end - ----Gets the value of the EventListenerCount property. ----@param self Container self ----@return table {} The event listener count of the container -function Container:getEventListenerCount(self) end - ----Gets the value of the ChildrenSorted property. ----@param self Container self ----@return boolean true Whether the children are sorted -function Container:getChildrenSorted(self) end - ----Sets the value of the OffsetX property. ----@param self Container self ----@param OffsetX number Horizontal content offset -function Container:setOffsetX(self, OffsetX) end - ----Creates a new Tree element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Tree element A new Tree element. -function Container:addTree(self, props) end - ----Sets the value of the EventListenerCount property. ----@param self Container self ----@param EventListenerCount table The event listener count of the container -function Container:setEventListenerCount(self, EventListenerCount) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to draw the text ----@param y number The y position to draw the text ----@param text string The text to draw ----@param fg string The foreground color of the text ----@param bg string The background color of the text ----@return Container self The container instance ----@protected -function Container:blit(x, y, text, fg, bg) end - -function Container:drawText() end - -function Container:drawFg() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to draw the text ----@param y number The y position to draw the text ----@param width number The width of the text ----@param height number The height of the text ----@param text string The text to draw ----@param fg string The foreground color of the text ----@param bg string The background color of the text ----@return Container self The container instance ----@protected -function Container:multiBlit(x, y, width, height, text, fg, bg) end - ----Creates a new BaseElement element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return BaseElement element A new BaseElement element. -function Container:addBaseElement(self, props) end - ----Gets the value of the FocusedChild property. ----@param self Container self ----@return table nil The focused child of the container -function Container:getFocusedChild(self) end - ----Creates a new Checkbox element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Checkbox element A new Checkbox element. -function Container:addCheckbox(self, props) end - ----Adds a child to the container ----@param child table The child to add ----@return Container self The container instance -function Container:addChild(child) end - ----Sorts the children of the container ----@return Container self The container instance -function Container:sortChildren() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Container:mouse_click(button, x, y) end - ----Creates a new Program element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Program element A new Program element. -function Container:addProgram(self, props) end - ----Creates a new Label element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Label element A new Label element. -function Container:addLabel(self, props) end - ----Creates a new Button element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Button element A new Button element. -function Container:addButton(self, props) end - ----Removes a child from the container ----@param path string The path to the child to remove ----@return Container ? self The container instance -function Container:getChild(path) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@protected -function Container:init(props, basalt) end - ----Removes a child from the container ----@param child table The child to remove ----@return Container self The container instance -function Container:removeChild(child) end - ----Creates a new LineChart element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return LineChart element A new LineChart element. -function Container:addLineChart(self, props) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@protected -function Container:mouse_release(button, x, y) end - ----Gets the value of the OffsetY property. ----@param self Container self ----@return number 0 Vertical content offset -function Container:getOffsetY(self) end - ----Creates a new BarChart element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return BarChart element A new BarChart element. -function Container:addBarChart(self, props) end - ----Creates a new ProgressBar element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return ProgressBar element A new ProgressBar element. -function Container:addProgressBar(self, props) end - ----Returns whether a child is visible ----@param child table The child to check ----@return boolean boolean the child is visible -function Container:isChildVisible(child) end - ----Creates a new Menu element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Menu element A new Menu element. -function Container:addMenu(self, props) end - -function Container:drawBg() end - ----Gets the value of the VisibleChildrenEvents property. ----@param self Container self ----@return table {} The visible children events of the container -function Container:getVisibleChildrenEvents(self) end - ----Gets the value of the Children property. ----@param self Container self ----@return table {} The children of the container -function Container:getChildren(self) end - ----Sets the value of the OffsetY property. ----@param self Container self ----@param OffsetY number Vertical content offset -function Container:setOffsetY(self, OffsetY) end - ----Sets the value of the ChildrenEventsSorted property. ----@param self Container self ----@param ChildrenEventsSorted boolean Whether the children events are sorted -function Container:setChildrenEventsSorted(self, ChildrenEventsSorted) end - ----Sets the value of the VisibleChildren property. ----@param self Container self ----@param VisibleChildren table The visible children of the container -function Container:setVisibleChildren(self, VisibleChildren) end - ----Unregisters the children events of the container ----@param child table The child to unregister events for ----@param eventName string The event name to unregister ----@return Container self The container instance -function Container:unregisterChildEvent(child, eventName) end - ----Sets the value of the VisibleChildrenEvents property. ----@param self Container self ----@param VisibleChildrenEvents table The visible children events of the container -function Container:setVisibleChildrenEvents(self, VisibleChildrenEvents) end - ----Gets the value of the VisibleChildren property. ----@param self Container self ----@return table {} The visible children of the container -function Container:getVisibleChildren(self) end - ----Creates a new Dropdown element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Dropdown element A new Dropdown element. -function Container:addDropdown(self, props) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param x number The x position to draw the text ----@param y number The y position to draw the text ----@param text string The text to draw ----@param fg color The foreground color of the text ----@return Container self The container instance ----@protected -function Container:textFg(x, y, text, fg) end - ----Sets the value of the FocusedChild property. ----@param self Container self ----@param FocusedChild table The focused child of the container -function Container:setFocusedChild(self, FocusedChild) end - ----Gets the value of the ChildrenEventsSorted property. ----@param self Container self ----@return boolean true Whether the children events are sorted -function Container:getChildrenEventsSorted(self) end - ----Logs benchmark statistics for a container and all its children ----@param methodName string The method to log ----@return Container self The container instance -function Container:logContainerBenchmarks(methodName) end - ----Enables debugging for this container and all its children ----@param self Container The container to debug ----@param level number The debug level -function Container.debugChildren(self, level) end - ----Gets the value of the ChildrenEvents property. ----@param self Container self ----@return table {} The children events of the container -function Container:getChildrenEvents(self) end - ----Creates a new TabControl element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return TabControl element A new TabControl element. -function Container:addTabControl(self, props) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param key number The key that was pressed ----@return boolean handled Whether the event was handled ----@protected -function Container:key(key) end - ----Sets the value of the Children property. ----@param self Container self ----@param Children table The children of the container -function Container:setChildren(self, Children) end - ----Unregisters the children events of the container ----@param child table The child to unregister events for ----@return Container self The container instance -function Container:removeChildrenEvents(child) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param _ number unknown ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Container:mouse_move(_, x, y) end - ----Creates a new Input element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Input element A new Input element. -function Container:addInput(self, props) end - ----Sorts the children events of the container ----@param eventName string The event name to sort ----@return Container self The container instance -function Container:sortChildrenEvents(eventName) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param event string The event to handle ----@return boolean handled Whether the event was handled ----@protected -function Container:handleEvent(event) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Container:mouse_up(button, x, y) end - ----Sets the value of the ChildrenSorted property. ----@param self Container self ----@param ChildrenSorted boolean Whether the children are sorted -function Container:setChildrenSorted(self, ChildrenSorted) end - ----Creates a new BaseFrame element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return BaseFrame element A new BaseFrame element. -function Container:addBaseFrame(self, props) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param button number The button that was clicked ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Container:mouse_drag(button, x, y) end - ----Calls a event on all children ----@param visibleOnly boolean Whether to only call the event on visible children ----@param event string The event to call ----@return boolean handled Whether the event was handled ----@return table ? child The child that handled the event -function Container:callChildrenEvent(visibleOnly, event) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Container:render() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param direction number The direction of the scroll ----@param x number The x position of the click ----@param y number The y position of the click ----@return boolean handled Whether the event was handled ----@protected -function Container:mouse_scroll(direction, x, y) end - ----Creates a new Slider element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Slider element A new Slider element. -function Container:addSlider(self, props) end - ----Creates a new Image element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Image element A new Image element. -function Container:addImage(self, props) end - ----Creates a new Switch element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Switch element A new Switch element. -function Container:addSwitch(self, props) end - ----Creates a new Display element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Display element A new Display element. -function Container:addDisplay(self, props) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param char string The character that was pressed ----@return boolean handled Whether the event was handled ----@protected -function Container:char(char) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param key number The key that was released ----@return boolean handled Whether the event was handled ----@protected -function Container:key_up(key) end - ----Sets the value of the ChildrenEvents property. ----@param self Container self ----@param ChildrenEvents table The children events of the container -function Container:setChildrenEvents(self, ChildrenEvents) end - ----Creates a new Graph element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Graph element A new Graph element. -function Container:addGraph(self, props) end - ----Creates a new Table element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Table element A new Table element. -function Container:addTable(self, props) end - ----Creates a new Timer element. ----@param self Container self ----@param props? table Optional: properties for the element. ----@return Timer element A new Timer element. -function Container:addTimer(self, props) end - ----Registers the children events of the container ----@param child table The child to register events for ----@param eventName string The event name to register ----@return Container self The container instance -function Container:registerChildEvent(child, eventName) end - ----@class Graph : VisualElement ----@field series table The series of the graph ----@field maxValue number The maximum value of the graph ----@field minValue number The minimum value of the graph -local Graph = {} - ----@param name string The name of the series ----@param value number The value of the point ----@return Graph self The graph instance -function Graph:addPoint(name, value) end - ----@param name string The name of the series ----@return Graph self The graph instance -function Graph:focusSeries(name) end - ----@param name string The name of the series ----@param symbol string The symbol of the series ----@param bgCol number The background color of the series ----@param fgCol number The foreground color of the series ----@param pointCount number The number of points in the series ----@return Graph self The graph instance -function Graph:addSeries(name, symbol, bgCol, fgCol, pointCount) end - ----@param name string The name of the series ----@return Graph self The graph instance -function Graph:removeSeries(name) end - ----Clears all points from a series ----@return Graph self The graph instance -function Graph:clear() end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@param props table The properties to initialize the element with ----@param basalt table The basalt instance ----@return Graph self The initialized instance ----@protected -function Graph:init(props, basalt) end - ----@param name string The name of the series ----@param count number The number of points in the series ----@return Graph self The graph instance -function Graph:setSeriesPointCount(name, count) end - ----Gets the value of the MinValue property. ----@param self Graph self ----@return number 0 The minimum value of the graph -function Graph:getMinValue(self) end - ----@param name string The name of the series ----@param visible boolean Whether the series should be visible ----@return Graph self The graph instance -function Graph:changeSeriesVisibility(name, visible) end - ----Sets the value of the Series property. ----@param self Graph self ----@param Series table The series of the graph -function Graph:setSeries(self, Series) end - ----This function is protected and should not be called outside of basalt, however you can overwrite it if you know what you're doing. ----@protected -function Graph:render() end - ----Gets the value of the MaxValue property. ----@param self Graph self ----@return number 100 The maximum value of the graph -function Graph:getMaxValue(self) end - ----@param name string The name of the series ----@return table ? series The series -function Graph:getSeries(name) end - ----Sets the value of the MaxValue property. ----@param self Graph self ----@param MaxValue number The maximum value of the graph -function Graph:setMaxValue(self, MaxValue) end - ----Sets the value of the MinValue property. ----@param self Graph self ----@param MinValue number The minimum value of the graph -function Graph:setMinValue(self, MinValue) end +function BarChart:render() end diff --git a/config.lua b/config.lua index 52f837c..72c502b 100644 --- a/config.lua +++ b/config.lua @@ -1,440 +1,440 @@ return { + ["metadata"] = { + ["version"] = "2.0", + ["generated"] = "Sun Sep 14 10:34:41 2025", + }, ["categories"] = { ["libraries"] = { - ["description"] = "Libraries", ["files"] = { - ["colorHex"] = { - ["default"] = true, - ["requires"] = { - }, - ["size"] = 132, - ["path"] = "libraries/colorHex.lua", - ["description"] = "", - }, - ["expect"] = { - ["default"] = true, - ["requires"] = { - }, - ["size"] = 846, - ["path"] = "libraries/expect.lua", - ["description"] = "", - }, ["utils"] = { + ["path"] = "libraries/utils.lua", + ["description"] = "", ["default"] = true, ["requires"] = { }, ["size"] = 2661, - ["path"] = "libraries/utils.lua", + }, + ["colorHex"] = { + ["path"] = "libraries/colorHex.lua", ["description"] = "", + ["default"] = true, + ["requires"] = { + }, + ["size"] = 132, + }, + ["expect"] = { + ["path"] = "libraries/expect.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + }, + ["size"] = 846, }, }, + ["description"] = "Libraries", }, ["plugins"] = { - ["description"] = "Plugins", ["files"] = { - ["canvas"] = { - ["default"] = true, - ["requires"] = { - }, - ["size"] = 7873, - ["path"] = "plugins/canvas.lua", - ["description"] = "", - }, - ["reactive"] = { - ["default"] = true, - ["requires"] = { - }, - ["size"] = 7580, - ["path"] = "plugins/reactive.lua", - ["description"] = "", - }, - ["state"] = { - ["default"] = true, - ["requires"] = { - [1] = "Container", - }, - ["size"] = 6896, - ["path"] = "plugins/state.lua", - ["description"] = "", - }, - ["animation"] = { - ["default"] = true, - ["requires"] = { - }, - ["size"] = 18421, - ["path"] = "plugins/animation.lua", - ["description"] = "", - }, ["benchmark"] = { + ["path"] = "plugins/benchmark.lua", + ["description"] = "", ["default"] = true, ["requires"] = { [1] = "VisualElement", }, ["size"] = 12581, - ["path"] = "plugins/benchmark.lua", - ["description"] = "", }, - ["xml"] = { + ["canvas"] = { + ["path"] = "plugins/canvas.lua", + ["description"] = "", ["default"] = true, ["requires"] = { }, - ["size"] = 9940, - ["path"] = "plugins/xml.lua", - ["description"] = "", - }, - ["debug"] = { - ["default"] = true, - ["requires"] = { - }, - ["size"] = 6250, - ["path"] = "plugins/debug.lua", - ["description"] = "", + ["size"] = 7873, }, ["theme"] = { + ["path"] = "plugins/theme.lua", + ["description"] = "", ["default"] = true, ["requires"] = { }, ["size"] = 7042, - ["path"] = "plugins/theme.lua", + }, + ["state"] = { + ["path"] = "plugins/state.lua", ["description"] = "", + ["default"] = true, + ["requires"] = { + [1] = "Container", + }, + ["size"] = 6896, + }, + ["reactive"] = { + ["path"] = "plugins/reactive.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + }, + ["size"] = 7580, + }, + ["debug"] = { + ["path"] = "plugins/debug.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + }, + ["size"] = 6250, + }, + ["xml"] = { + ["path"] = "plugins/xml.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + }, + ["size"] = 9940, + }, + ["animation"] = { + ["path"] = "plugins/animation.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + }, + ["size"] = 18421, }, }, + ["description"] = "Plugins", + }, + ["core"] = { + ["files"] = { + ["propertySystem"] = { + ["path"] = "propertySystem.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + }, + ["size"] = 15524, + }, + ["errorManager"] = { + ["path"] = "errorManager.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + }, + ["size"] = 3789, + }, + ["elementManager"] = { + ["path"] = "elementManager.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + }, + ["size"] = 6297, + }, + ["render"] = { + ["path"] = "render.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + }, + ["size"] = 12422, + }, + ["init"] = { + ["path"] = "init.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + }, + ["size"] = 622, + }, + ["log"] = { + ["path"] = "log.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + }, + ["size"] = 3142, + }, + ["main"] = { + ["path"] = "main.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + }, + ["size"] = 14085, + }, + }, + ["description"] = "Core Files", }, ["elements"] = { - ["description"] = "UI Elements", ["files"] = { - ["Label"] = { - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - ["size"] = 3092, - ["path"] = "elements/Label.lua", - ["description"] = "A simple text display element that automatically resizes its width based on the text content.", - }, - ["Checkbox"] = { - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - ["size"] = 2928, - ["path"] = "elements/Checkbox.lua", - ["description"] = "", - }, - ["Dropdown"] = { - ["default"] = false, - ["requires"] = { - [1] = "List", - }, - ["size"] = 6359, - ["path"] = "elements/Dropdown.lua", - ["description"] = "A DropDown menu that shows a list of selectable items", - }, - ["Tree"] = { - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - ["size"] = 7942, - ["path"] = "elements/Tree.lua", - ["description"] = "", - }, - ["Graph"] = { - ["default"] = false, - ["requires"] = { - }, - ["size"] = 6989, - ["path"] = "elements/Graph.lua", - ["description"] = "A point based graph element", - }, ["Timer"] = { + ["path"] = "elements/Timer.lua", + ["description"] = "", ["default"] = true, ["requires"] = { [1] = "BaseElement", }, ["size"] = 2914, - ["path"] = "elements/Timer.lua", - ["description"] = "", - }, - ["Switch"] = { - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - ["size"] = 3269, - ["path"] = "elements/Switch.lua", - ["description"] = "The Switch is a standard Switch element with click handling and state management.", - }, - ["Button"] = { - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - ["size"] = 1656, - ["path"] = "elements/Button.lua", - ["description"] = "", - }, - ["Table"] = { - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - ["size"] = 16214, - ["path"] = "elements/Table.lua", - ["description"] = "", - }, - ["Frame"] = { - ["default"] = true, - ["requires"] = { - [1] = "Container", - }, - ["size"] = 6508, - ["path"] = "elements/Frame.lua", - ["description"] = "A frame element that serves as a grouping container for other elements.", - }, - ["BaseFrame"] = { - ["default"] = true, - ["requires"] = { - [1] = "Container", - }, - ["size"] = 8466, - ["path"] = "elements/BaseFrame.lua", - ["description"] = "This is the base frame class. It is the root element of all elements and the only element without a parent.", - }, - ["ComboBox"] = { - ["default"] = false, - ["requires"] = { - [1] = "Dropdown", - }, - ["size"] = 14653, - ["path"] = "elements/ComboBox.lua", - ["description"] = "A ComboBox that combines dropdown selection with editable text input", - }, - ["VisualElement"] = { - ["default"] = true, - ["requires"] = { - [1] = "BaseElement", - }, - ["size"] = 18564, - ["path"] = "elements/VisualElement.lua", - ["description"] = "The Visual Element class which is the base class for all visual UI elements", }, ["Input"] = { + ["path"] = "elements/Input.lua", + ["description"] = "A text input field with various features", ["default"] = true, ["requires"] = { [1] = "VisualElement", }, ["size"] = 9558, - ["path"] = "elements/Input.lua", - ["description"] = "A text input field with various features", - }, - ["BaseElement"] = { - ["default"] = true, - ["requires"] = { - }, - ["size"] = 9686, - ["path"] = "elements/BaseElement.lua", - ["description"] = "The base class for all UI elements in Basalt.", - }, - ["BigFont"] = { - ["default"] = false, - ["requires"] = { - [1] = "VisualElement", - }, - ["size"] = 21049, - ["path"] = "elements/BigFont.lua", - ["description"] = "", - }, - ["TextBox"] = { - ["default"] = false, - ["requires"] = { - [1] = "VisualElement", - }, - ["size"] = 12667, - ["path"] = "elements/TextBox.lua", - ["description"] = "A multi-line text editor component with cursor support and text manipulation features", - }, - ["Image"] = { - ["default"] = false, - ["requires"] = { - [1] = "VisualElement", - }, - ["size"] = 15125, - ["path"] = "elements/Image.lua", - ["description"] = "An element that displays an image in bimg format", - }, - ["LineChart"] = { - ["default"] = false, - ["requires"] = { - }, - ["size"] = 3227, - ["path"] = "elements/LineChart.lua", - ["description"] = "", - }, - ["TabControl"] = { - ["default"] = true, - ["requires"] = { - [1] = "Container", - }, - ["size"] = 15300, - ["path"] = "elements/TabControl.lua", - ["description"] = "A TabControl element that provides tabbed interface with multiple content areas.", - }, - ["Scrollbar"] = { - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - ["size"] = 9548, - ["path"] = "elements/Scrollbar.lua", - ["description"] = "", - }, - ["Display"] = { - ["default"] = false, - ["requires"] = { - [1] = "VisualElement", - }, - ["size"] = 4243, - ["path"] = "elements/Display.lua", - ["description"] = "The Display is a special element which uses the cc window API which you can use.", - }, - ["ProgressBar"] = { - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - ["size"] = 3397, - ["path"] = "elements/ProgressBar.lua", - ["description"] = "", - }, - ["Program"] = { - ["default"] = true, - ["requires"] = { - [1] = "VisualElement", - }, - ["size"] = 11430, - ["path"] = "elements/Program.lua", - ["description"] = "", }, ["Menu"] = { + ["path"] = "elements/Menu.lua", + ["description"] = "A horizontal menu bar with selectable items.", ["default"] = true, ["requires"] = { [1] = "List", }, ["size"] = 4679, - ["path"] = "elements/Menu.lua", - ["description"] = "A horizontal menu bar with selectable items.", }, - ["Flexbox"] = { + ["BaseElement"] = { + ["path"] = "elements/BaseElement.lua", + ["description"] = "The base class for all UI elements in Basalt.", + ["default"] = true, + ["requires"] = { + }, + ["size"] = 9686, + }, + ["FlexBox"] = { + ["path"] = "elements/FlexBox.lua", + ["description"] = "A flexbox container that arranges its children in a flexible layout.", ["default"] = true, ["requires"] = { [1] = "Container", }, ["size"] = 32431, - ["path"] = "elements/Flexbox.lua", - ["description"] = "A flexbox container that arranges its children in a flexible layout.", }, - ["List"] = { + ["BigFont"] = { + ["path"] = "elements/BigFont.lua", + ["description"] = "", + ["default"] = false, + ["requires"] = { + [1] = "VisualElement", + }, + ["size"] = 21049, + }, + ["Image"] = { + ["path"] = "elements/Image.lua", + ["description"] = "An element that displays an image in bimg format", + ["default"] = false, + ["requires"] = { + [1] = "VisualElement", + }, + ["size"] = 15125, + }, + ["BaseFrame"] = { + ["path"] = "elements/BaseFrame.lua", + ["description"] = "This is the base frame class. It is the root element of all elements and the only element without a parent.", + ["default"] = true, + ["requires"] = { + [1] = "Container", + }, + ["size"] = 8466, + }, + ["ComboBox"] = { + ["path"] = "elements/ComboBox.lua", + ["description"] = "A ComboBox that combines dropdown selection with editable text input", + ["default"] = false, + ["requires"] = { + [1] = "DropDown", + }, + ["size"] = 14649, + }, + ["Switch"] = { + ["path"] = "elements/Switch.lua", + ["description"] = "The Switch is a standard Switch element with click handling and state management.", ["default"] = true, ["requires"] = { [1] = "VisualElement", }, - ["size"] = 8758, - ["path"] = "elements/List.lua", - ["description"] = "A scrollable list of selectable items", + ["size"] = 3269, + }, + ["Label"] = { + ["path"] = "elements/Label.lua", + ["description"] = "A simple text display element that automatically resizes its width based on the text content.", + ["default"] = true, + ["requires"] = { + [1] = "VisualElement", + }, + ["size"] = 3092, + }, + ["DropDown"] = { + ["path"] = "elements/DropDown.lua", + ["description"] = "A DropDown menu that shows a list of selectable items", + ["default"] = false, + ["requires"] = { + [1] = "List", + }, + ["size"] = 6359, + }, + ["BarChart"] = { + ["path"] = "elements/BarChart.lua", + ["description"] = "", + ["default"] = false, + ["requires"] = { + }, + ["size"] = 3190, + }, + ["ProgressBar"] = { + ["path"] = "elements/ProgressBar.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + [1] = "VisualElement", + }, + ["size"] = 3397, + }, + ["CheckBox"] = { + ["path"] = "elements/CheckBox.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + [1] = "VisualElement", + }, + ["size"] = 2928, + }, + ["Display"] = { + ["path"] = "elements/Display.lua", + ["description"] = "The Display is a special element which uses the cc window API which you can use.", + ["default"] = false, + ["requires"] = { + [1] = "VisualElement", + }, + ["size"] = 4243, + }, + ["Frame"] = { + ["path"] = "elements/Frame.lua", + ["description"] = "A frame element that serves as a grouping container for other elements.", + ["default"] = true, + ["requires"] = { + [1] = "Container", + }, + ["size"] = 6508, }, ["Container"] = { + ["path"] = "elements/Container.lua", + ["description"] = "The container class. It is a visual element that can contain other elements. It is the base class for all containers", ["default"] = true, ["requires"] = { [1] = "VisualElement", }, ["size"] = 25383, - ["path"] = "elements/Container.lua", - ["description"] = "The container class. It is a visual element that can contain other elements. It is the base class for all containers", + }, + ["TextBox"] = { + ["path"] = "elements/TextBox.lua", + ["description"] = "A multi-line text editor component with cursor support and text manipulation features", + ["default"] = false, + ["requires"] = { + [1] = "VisualElement", + }, + ["size"] = 12667, + }, + ["LineChart"] = { + ["path"] = "elements/LineChart.lua", + ["description"] = "", + ["default"] = false, + ["requires"] = { + }, + ["size"] = 3227, + }, + ["Graph"] = { + ["path"] = "elements/Graph.lua", + ["description"] = "A point based graph element", + ["default"] = false, + ["requires"] = { + }, + ["size"] = 6989, + }, + ["Program"] = { + ["path"] = "elements/Program.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + [1] = "VisualElement", + }, + ["size"] = 11430, + }, + ["Table"] = { + ["path"] = "elements/Table.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + [1] = "VisualElement", + }, + ["size"] = 16214, + }, + ["TabControl"] = { + ["path"] = "elements/TabControl.lua", + ["description"] = "A TabControl element that provides tabbed interface with multiple content areas.", + ["default"] = true, + ["requires"] = { + [1] = "Container", + }, + ["size"] = 15300, + }, + ["Tree"] = { + ["path"] = "elements/Tree.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + [1] = "VisualElement", + }, + ["size"] = 7942, + }, + ["Button"] = { + ["path"] = "elements/Button.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + [1] = "VisualElement", + }, + ["size"] = 1656, + }, + ["VisualElement"] = { + ["path"] = "elements/VisualElement.lua", + ["description"] = "The Visual Element class which is the base class for all visual UI elements", + ["default"] = true, + ["requires"] = { + [1] = "BaseElement", + }, + ["size"] = 18564, + }, + ["List"] = { + ["path"] = "elements/List.lua", + ["description"] = "A scrollable list of selectable items", + ["default"] = true, + ["requires"] = { + [1] = "VisualElement", + }, + ["size"] = 8758, + }, + ["ScrollBar"] = { + ["path"] = "elements/ScrollBar.lua", + ["description"] = "", + ["default"] = true, + ["requires"] = { + [1] = "VisualElement", + }, + ["size"] = 9548, }, ["Slider"] = { + ["path"] = "elements/Slider.lua", + ["description"] = "", ["default"] = true, ["requires"] = { [1] = "VisualElement", }, ["size"] = 4977, - ["path"] = "elements/Slider.lua", - ["description"] = "", - }, - ["BarChart"] = { - ["default"] = false, - ["requires"] = { - }, - ["size"] = 3190, - ["path"] = "elements/BarChart.lua", - ["description"] = "", }, }, + ["description"] = "UI Elements", }, - ["core"] = { - ["description"] = "Core Files", - ["files"] = { - ["log"] = { - ["default"] = true, - ["requires"] = { - }, - ["size"] = 3142, - ["path"] = "log.lua", - ["description"] = "", - }, - ["propertySystem"] = { - ["default"] = true, - ["requires"] = { - }, - ["size"] = 15524, - ["path"] = "propertySystem.lua", - ["description"] = "", - }, - ["main"] = { - ["default"] = true, - ["requires"] = { - }, - ["size"] = 14085, - ["path"] = "main.lua", - ["description"] = "", - }, - ["init"] = { - ["default"] = true, - ["requires"] = { - }, - ["size"] = 622, - ["path"] = "init.lua", - ["description"] = "", - }, - ["elementManager"] = { - ["default"] = true, - ["requires"] = { - }, - ["size"] = 6297, - ["path"] = "elementManager.lua", - ["description"] = "", - }, - ["errorManager"] = { - ["default"] = true, - ["requires"] = { - }, - ["size"] = 3789, - ["path"] = "errorManager.lua", - ["description"] = "", - }, - ["render"] = { - ["default"] = true, - ["requires"] = { - }, - ["size"] = 12422, - ["path"] = "render.lua", - ["description"] = "", - }, - }, - }, - }, - ["metadata"] = { - ["version"] = "2.0", - ["generated"] = "Sun Sep 14 10:20:10 2025", }, } \ No newline at end of file diff --git a/release/basalt.lua b/release/basalt.lua index c282f27..29c5885 100644 --- a/release/basalt.lua +++ b/release/basalt.lua @@ -16,23 +16,23 @@ minified_elementDirectory["Display"] = {} minified_elementDirectory["BaseElement"] = {} minified_elementDirectory["Input"] = {} minified_elementDirectory["Timer"] = {} -minified_elementDirectory["Scrollbar"] = {} minified_elementDirectory["Button"] = {} minified_elementDirectory["VisualElement"] = {} +minified_elementDirectory["FlexBox"] = {} +minified_elementDirectory["CheckBox"] = {} minified_elementDirectory["BigFont"] = {} minified_elementDirectory["Label"] = {} minified_elementDirectory["Tree"] = {} +minified_elementDirectory["DropDown"] = {} minified_elementDirectory["ComboBox"] = {} minified_elementDirectory["Switch"] = {} +minified_elementDirectory["ScrollBar"] = {} minified_elementDirectory["BaseFrame"] = {} -minified_elementDirectory["Flexbox"] = {} minified_elementDirectory["Image"] = {} minified_elementDirectory["List"] = {} minified_elementDirectory["Program"] = {} minified_elementDirectory["Container"] = {} -minified_elementDirectory["Checkbox"] = {} minified_elementDirectory["Graph"] = {} -minified_elementDirectory["Dropdown"] = {} minified_elementDirectory["BarChart"] = {} minified_elementDirectory["LineChart"] = {} minified_pluginDirectory["debug"] = {} @@ -1031,75 +1031,6 @@ local ca=select(1,...) if ca==self.timerId then self.action()local da=self.get("amount")if da>0 then self.set("amount", da-1)end;if da~=0 then self.timerId=os.startTimer(self.get("interval"))end end end end;return aa end -project["elements/Scrollbar.lua"] = function(...) local aa=require("elements/VisualElement") -local ba=require("libraries/colorHex")local ca=setmetatable({},aa)ca.__index=ca -ca.defineProperty(ca,"value",{default=0,type="number",canTriggerRender=true}) -ca.defineProperty(ca,"min",{default=0,type="number",canTriggerRender=true}) -ca.defineProperty(ca,"max",{default=100,type="number",canTriggerRender=true}) -ca.defineProperty(ca,"step",{default=10,type="number"}) -ca.defineProperty(ca,"dragMultiplier",{default=1,type="number"}) -ca.defineProperty(ca,"symbol",{default=" ",type="string",canTriggerRender=true}) -ca.defineProperty(ca,"symbolColor",{default=colors.gray,type="color",canTriggerRender=true}) -ca.defineProperty(ca,"symbolBackgroundColor",{default=colors.black,type="color",canTriggerRender=true}) -ca.defineProperty(ca,"backgroundSymbol",{default="\127",type="string",canTriggerRender=true}) -ca.defineProperty(ca,"attachedElement",{default=nil,type="table"}) -ca.defineProperty(ca,"attachedProperty",{default=nil,type="string"}) -ca.defineProperty(ca,"minValue",{default=0,type="number"}) -ca.defineProperty(ca,"maxValue",{default=100,type="number"}) -ca.defineProperty(ca,"orientation",{default="vertical",type="string",canTriggerRender=true}) -ca.defineProperty(ca,"handleSize",{default=2,type="number",canTriggerRender=true})ca.defineEvent(ca,"mouse_click") -ca.defineEvent(ca,"mouse_release")ca.defineEvent(ca,"mouse_drag") -ca.defineEvent(ca,"mouse_scroll") -function ca.new()local ab=setmetatable({},ca):__init() -ab.class=ca;ab.set("width",1)ab.set("height",10)return ab end;function ca:init(ab,bb)aa.init(self,ab,bb)self.set("type","ScrollBar")return -self end -function ca:attach(ab,bb) -self.set("attachedElement",ab)self.set("attachedProperty",bb.property)self.set("minValue", -bb.min or 0) -self.set("maxValue",bb.max or 100) -ab:observe(bb.property,function(cb,db) -if db then local _c=self.get("minValue") -local ac=self.get("maxValue")if _c==ac then return end -self.set("value",math.floor((db-_c)/ (ac-_c)*100 +0.5))end end)return self end -function ca:updateAttachedElement()local ab=self.get("attachedElement") -if not ab then return end;local bb=self.get("value")local cb=self.get("minValue") -local db=self.get("maxValue")if type(cb)=="function"then cb=cb()end;if type(db)=="function"then -db=db()end;local _c=cb+ (bb/100)* (db-cb)ab.set(self.get("attachedProperty"),math.floor( -_c+0.5)) -return self end;local function da(ab) -return -ab.get("orientation")=="vertical"and ab.get("height")or ab.get("width")end -local function _b(ab,bb,cb) -local db,_c=ab:getRelativePosition(bb,cb)return -ab.get("orientation")=="vertical"and _c or db end -function ca:mouse_click(ab,bb,cb) -if aa.mouse_click(self,ab,bb,cb)then local db=da(self) -local _c=self.get("value")local ac=self.get("handleSize")local bc= -math.floor((_c/100)* (db-ac))+1;local cc=_b(self,bb,cb) -if -cc>=bc and cc0 and-1 or 1;local db=self.get("step") -local _c=self.get("value")local ac=_c-ab*db -self.set("value",math.min(100,math.max(0,ac)))self:updateAttachedElement()return true end -function ca:render()aa.render(self)local ab=da(self)local bb=self.get("value") -local cb=self.get("handleSize")local db=self.get("symbol")local _c=self.get("symbolColor") -local ac=self.get("symbolBackgroundColor")local bc=self.get("backgroundSymbol")local cc=self.get("orientation")== -"vertical"local dc= -math.floor((bb/100)* (ab-cb))+1 -for i=1,ab do -if cc then -self:blit(1,i,bc,ba[self.get("foreground")],ba[self.get("background")])else -self:blit(i,1,bc,ba[self.get("foreground")],ba[self.get("background")])end end -for i=dc,dc+cb-1 do if cc then self:blit(1,i,db,ba[_c],ba[ac])else -self:blit(i,1,db,ba[_c],ba[ac])end end end;return ca end project["elements/Button.lua"] = function(...) local _a=require("elementManager") local aa=_a.getElement("VisualElement") local ba=require("libraries/utils").getCenteredPosition;local ca=setmetatable({},aa)ca.__index=ca @@ -1230,340 +1161,7 @@ function _b:render() if(not self.get("backgroundEnabled"))then return end;local cb,db=self.get("width"),self.get("height") self:multiBlit(1,1,cb,db," ",da[self.get("foreground")],da[self.get("background")])end;function _b:postRender()end;function _b:destroy()self.set("visible",false) ca.destroy(self)end;return _b end -project["elements/BigFont.lua"] = function(...) local _b=require("libraries/colorHex") -local ab={{"\32\32\32\137\156\148\158\159\148\135\135\144\159\139\32\136\157\32\159\139\32\32\143\32\32\143\32\32\32\32\32\32\32\32\147\148\150\131\148\32\32\32\151\140\148\151\140\147","\32\32\32\149\132\149\136\156\149\144\32\133\139\159\129\143\159\133\143\159\133\138\32\133\138\32\133\32\32\32\32\32\32\150\150\129\137\156\129\32\32\32\133\131\129\133\131\132","\32\32\32\130\131\32\130\131\32\32\129\32\32\32\32\130\131\32\130\131\32\32\32\32\143\143\143\32\32\32\32\32\32\130\129\32\130\135\32\32\32\32\131\32\32\131\32\131","\139\144\32\32\143\148\135\130\144\149\32\149\150\151\149\158\140\129\32\32\32\135\130\144\135\130\144\32\149\32\32\139\32\159\148\32\32\32\32\159\32\144\32\148\32\147\131\132","\159\135\129\131\143\149\143\138\144\138\32\133\130\149\149\137\155\149\159\143\144\147\130\132\32\149\32\147\130\132\131\159\129\139\151\129\148\32\32\139\131\135\133\32\144\130\151\32","\32\32\32\32\32\32\130\135\32\130\32\129\32\129\129\131\131\32\130\131\129\140\141\132\32\129\32\32\129\32\32\32\32\32\32\32\131\131\129\32\32\32\32\32\32\32\32\32","\32\32\32\32\149\32\159\154\133\133\133\144\152\141\132\133\151\129\136\153\32\32\154\32\159\134\129\130\137\144\159\32\144\32\148\32\32\32\32\32\32\32\32\32\32\32\151\129","\32\32\32\32\133\32\32\32\32\145\145\132\141\140\132\151\129\144\150\146\129\32\32\32\138\144\32\32\159\133\136\131\132\131\151\129\32\144\32\131\131\129\32\144\32\151\129\32","\32\32\32\32\129\32\32\32\32\130\130\32\32\129\32\129\32\129\130\129\129\32\32\32\32\130\129\130\129\32\32\32\32\32\32\32\32\133\32\32\32\32\32\129\32\129\32\32","\150\156\148\136\149\32\134\131\148\134\131\148\159\134\149\136\140\129\152\131\32\135\131\149\150\131\148\150\131\148\32\148\32\32\148\32\32\152\129\143\143\144\130\155\32\134\131\148","\157\129\149\32\149\32\152\131\144\144\131\148\141\140\149\144\32\149\151\131\148\32\150\32\150\131\148\130\156\133\32\144\32\32\144\32\130\155\32\143\143\144\32\152\129\32\134\32","\130\131\32\131\131\129\131\131\129\130\131\32\32\32\129\130\131\32\130\131\32\32\129\32\130\131\32\130\129\32\32\129\32\32\133\32\32\32\129\32\32\32\130\32\32\32\129\32","\150\140\150\137\140\148\136\140\132\150\131\132\151\131\148\136\147\129\136\147\129\150\156\145\138\143\149\130\151\32\32\32\149\138\152\129\149\32\32\157\152\149\157\144\149\150\131\148","\149\143\142\149\32\149\149\32\149\149\32\144\149\32\149\149\32\32\149\32\32\149\32\149\149\32\149\32\149\32\144\32\149\149\130\148\149\32\32\149\32\149\149\130\149\149\32\149","\130\131\129\129\32\129\131\131\32\130\131\32\131\131\32\131\131\129\129\32\32\130\131\32\129\32\129\130\131\32\130\131\32\129\32\129\131\131\129\129\32\129\129\32\129\130\131\32","\136\140\132\150\131\148\136\140\132\153\140\129\131\151\129\149\32\149\149\32\149\149\32\149\137\152\129\137\152\129\131\156\133\149\131\32\150\32\32\130\148\32\152\137\144\32\32\32","\149\32\32\149\159\133\149\32\149\144\32\149\32\149\32\149\32\149\150\151\129\138\155\149\150\130\148\32\149\32\152\129\32\149\32\32\32\150\32\32\149\32\32\32\32\32\32\32","\129\32\32\130\129\129\129\32\129\130\131\32\32\129\32\130\131\32\32\129\32\129\32\129\129\32\129\32\129\32\131\131\129\130\131\32\32\32\129\130\131\32\32\32\32\140\140\132","\32\154\32\159\143\32\149\143\32\159\143\32\159\144\149\159\143\32\159\137\145\159\143\144\149\143\32\32\145\32\32\32\145\149\32\144\32\149\32\143\159\32\143\143\32\159\143\32","\32\32\32\152\140\149\151\32\149\149\32\145\149\130\149\157\140\133\32\149\32\154\143\149\151\32\149\32\149\32\144\32\149\149\153\32\32\149\32\149\133\149\149\32\149\149\32\149","\32\32\32\130\131\129\131\131\32\130\131\32\130\131\129\130\131\129\32\129\32\140\140\129\129\32\129\32\129\32\137\140\129\130\32\129\32\130\32\129\32\129\129\32\129\130\131\32","\144\143\32\159\144\144\144\143\32\159\143\144\159\138\32\144\32\144\144\32\144\144\32\144\144\32\144\144\32\144\143\143\144\32\150\129\32\149\32\130\150\32\134\137\134\134\131\148","\136\143\133\154\141\149\151\32\129\137\140\144\32\149\32\149\32\149\154\159\133\149\148\149\157\153\32\154\143\149\159\134\32\130\148\32\32\149\32\32\151\129\32\32\32\32\134\32","\133\32\32\32\32\133\129\32\32\131\131\32\32\130\32\130\131\129\32\129\32\130\131\129\129\32\129\140\140\129\131\131\129\32\130\129\32\129\32\130\129\32\32\32\32\32\129\32","\32\32\32\32\149\32\32\149\32\32\32\32\32\32\32\32\149\32\32\149\32\32\32\32\32\32\32\32\149\32\32\149\32\32\32\32\32\32\32\32\149\32\32\149\32\32\32\32","\32\32\32\32\32\32\32\32\32\32\32\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\32\32\32\32\32\32\32\32\32\32\32","\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32","\32\32\32\32\149\32\32\149\32\32\32\32\32\32\32\32\149\32\32\149\32\32\32\32\32\32\32\32\149\32\32\149\32\32\32\32\32\32\32\32\149\32\32\149\32\32\32\32","\32\32\32\32\32\32\32\32\32\32\32\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\32\32\32\32\32\32\32\32\32\32\32","\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32","\32\32\32\32\145\32\159\139\32\151\131\132\155\143\132\134\135\145\32\149\32\158\140\129\130\130\32\152\147\155\157\134\32\32\144\144\32\32\32\32\32\32\152\131\155\131\131\129","\32\32\32\32\149\32\149\32\145\148\131\32\149\32\149\140\157\132\32\148\32\137\155\149\32\32\32\149\154\149\137\142\32\153\153\32\131\131\149\131\131\129\149\135\145\32\32\32","\32\32\32\32\129\32\130\135\32\131\131\129\134\131\132\32\129\32\32\129\32\131\131\32\32\32\32\130\131\129\32\32\32\32\129\129\32\32\32\32\32\32\130\131\129\32\32\32","\150\150\32\32\148\32\134\32\32\132\32\32\134\32\32\144\32\144\150\151\149\32\32\32\32\32\32\145\32\32\152\140\144\144\144\32\133\151\129\133\151\129\132\151\129\32\145\32","\130\129\32\131\151\129\141\32\32\142\32\32\32\32\32\149\32\149\130\149\149\32\143\32\32\32\32\142\132\32\154\143\133\157\153\132\151\150\148\151\158\132\151\150\148\144\130\148","\32\32\32\140\140\132\32\32\32\32\32\32\32\32\32\151\131\32\32\129\129\32\32\32\32\134\32\32\32\32\32\32\32\129\129\32\129\32\129\129\130\129\129\32\129\130\131\32","\156\143\32\159\141\129\153\140\132\153\137\32\157\141\32\159\142\32\150\151\129\150\131\132\140\143\144\143\141\145\137\140\148\141\141\144\157\142\32\159\140\32\151\134\32\157\141\32","\157\140\149\157\140\149\157\140\149\157\140\149\157\140\149\157\140\149\151\151\32\154\143\132\157\140\32\157\140\32\157\140\32\157\140\32\32\149\32\32\149\32\32\149\32\32\149\32","\129\32\129\129\32\129\129\32\129\129\32\129\129\32\129\129\32\129\129\131\129\32\134\32\131\131\129\131\131\129\131\131\129\131\131\129\130\131\32\130\131\32\130\131\32\130\131\32","\151\131\148\152\137\145\155\140\144\152\142\145\153\140\132\153\137\32\154\142\144\155\159\132\150\156\148\147\32\144\144\130\145\136\137\32\146\130\144\144\130\145\130\136\32\151\140\132","\151\32\149\151\155\149\149\32\149\149\32\149\149\32\149\149\32\149\149\32\149\152\137\144\157\129\149\149\32\149\149\32\149\149\32\149\149\32\149\130\150\32\32\157\129\149\32\149","\131\131\32\129\32\129\130\131\32\130\131\32\130\131\32\130\131\32\130\131\32\32\32\32\130\131\32\130\131\32\130\131\32\130\131\32\130\131\32\32\129\32\130\131\32\133\131\32","\156\143\32\159\141\129\153\140\132\153\137\32\157\141\32\159\142\32\159\159\144\152\140\144\156\143\32\159\141\129\153\140\132\157\141\32\130\145\32\32\147\32\136\153\32\130\146\32","\152\140\149\152\140\149\152\140\149\152\140\149\152\140\149\152\140\149\149\157\134\154\143\132\157\140\133\157\140\133\157\140\133\157\140\133\32\149\32\32\149\32\32\149\32\32\149\32","\130\131\129\130\131\129\130\131\129\130\131\129\130\131\129\130\131\129\130\130\131\32\134\32\130\131\129\130\131\129\130\131\129\130\131\129\32\129\32\32\129\32\32\129\32\32\129\32","\159\134\144\137\137\32\156\143\32\159\141\129\153\140\132\153\137\32\157\141\32\32\132\32\159\143\32\147\32\144\144\130\145\136\137\32\146\130\144\144\130\145\130\138\32\146\130\144","\149\32\149\149\32\149\149\32\149\149\32\149\149\32\149\149\32\149\149\32\149\131\147\129\138\134\149\149\32\149\149\32\149\149\32\149\149\32\149\154\143\149\32\157\129\154\143\149","\130\131\32\129\32\129\130\131\32\130\131\32\130\131\32\130\131\32\130\131\32\32\32\32\130\131\32\130\131\129\130\131\129\130\131\129\130\131\129\140\140\129\130\131\32\140\140\129"},{"000110000110110000110010101000000010000000100101","000000110110000000000010101000000010000000100101","000000000000000000000000000000000000000000000000","100010110100000010000110110000010100000100000110","000000110000000010110110000110000000000000110000","000000000000000000000000000000000000000000000000","000000110110000010000000100000100000000000000010","000000000110110100010000000010000000000000000100","000000000000000000000000000000000000000000000000","010000000000100110000000000000000000000110010000","000000000000000000000000000010000000010110000000","000000000000000000000000000000000000000000000000","011110110000000100100010110000000100000000000000","000000000000000000000000000000000000000000000000","000000000000000000000000000000000000000000000000","110000110110000000000000000000010100100010000000","000010000000000000110110000000000100010010000000","000000000000000000000000000000000000000000000000","010110010110100110110110010000000100000110110110","000000000000000000000110000000000110000000000000","000000000000000000000000000000000000000000000000","010100010110110000000000000000110000000010000000","110110000000000000110000110110100000000010000000","000000000000000000000000000000000000000000000000","000100011111000100011111000100011111000100011111","000000000000100100100100011011011011111111111111","000000000000000000000000000000000000000000000000","000100011111000100011111000100011111000100011111","000000000000100100100100011011011011111111111111","100100100100100100100100100100100100100100100100","000000110100110110000010000011110000000000011000","000000000100000000000010000011000110000000001000","000000000000000000000000000000000000000000000000","010000100100000000000000000100000000010010110000","000000000000000000000000000000110110110110110000","000000000000000000000000000000000000000000000000","110110110110110110000000110110110110110110110110","000000000000000000000110000000000000000000000000","000000000000000000000000000000000000000000000000","000000000000110110000110010000000000000000010010","000010000000000000000000000000000000000000000000","000000000000000000000000000000000000000000000000","110110110110110110110000110110110110000000000000","000000000000000000000110000000000000000000000000","000000000000000000000000000000000000000000000000","110110110110110110110000110000000000000000010000","000000000000000000000000100000000000000110000110","000000000000000000000000000000000000000000000000"}}local bb={}local cb={} -do local dc=0;local _d=#ab[1]local ad=#ab[1][1] -for i=1,_d,3 do -for j=1,ad,3 do -local bd=string.char(dc)local cd={}cd[1]=ab[1][i]:sub(j,j+2) -cd[2]=ab[1][i+1]:sub(j,j+2)cd[3]=ab[1][i+2]:sub(j,j+2)local dd={}dd[1]=ab[2][i]:sub(j, -j+2)dd[2]=ab[2][i+1]:sub(j,j+2)dd[3]=ab[2][ -i+2]:sub(j,j+2)cb[bd]={cd,dd}dc=dc+1 end end;bb[1]=cb end -local function db(dc,_d)local ad={["0"]="1",["1"]="0"}if dc<=#bb then return true end -for f=#bb+1,dc do local bd={}local cd=bb[ -f-1] -for char=0,255 do local dd=string.char(char)local __a={}local a_a={} -local b_a=cd[dd][1]local c_a=cd[dd][2] -for i=1,#b_a do local d_a,_aa,aaa,baa,caa,daa={},{},{},{},{},{} -for j=1,#b_a[1]do -local _ba=cb[b_a[i]:sub(j,j)][1]table.insert(d_a,_ba[1]) -table.insert(_aa,_ba[2])table.insert(aaa,_ba[3]) -local aba=cb[b_a[i]:sub(j,j)][2] -if c_a[i]:sub(j,j)=="1"then -table.insert(baa,(aba[1]:gsub("[01]",ad))) -table.insert(caa,(aba[2]:gsub("[01]",ad))) -table.insert(daa,(aba[3]:gsub("[01]",ad)))else table.insert(baa,aba[1]) -table.insert(caa,aba[2])table.insert(daa,aba[3])end end;table.insert(__a,table.concat(d_a)) -table.insert(__a,table.concat(_aa))table.insert(__a,table.concat(aaa)) -table.insert(a_a,table.concat(baa))table.insert(a_a,table.concat(caa)) -table.insert(a_a,table.concat(daa))end;bd[dd]={__a,a_a}if _d then _d="Font"..f.."Yeld"..char -os.queueEvent(_d)os.pullEvent(_d)end end;bb[f]=bd end;return true end -local function _c(dc,_d,ad,bd,cd) -if not type(_d)=="string"then error("Not a String",3)end -local dd=type(ad)=="string"and ad:sub(1,1)or _b[ad]or -error("Wrong Front Color",3) -local __a=type(bd)=="string"and bd:sub(1,1)or _b[bd]or -error("Wrong Back Color",3)if(bb[dc]==nil)then db(3,false)end;local a_a=bb[dc]or -error("Wrong font size selected",3)if _d==""then -return{{""},{""},{""}}end;local b_a={} -for daa in _d:gmatch('.')do table.insert(b_a,daa)end;local c_a={}local d_a=#a_a[b_a[1]][1] -for nLine=1,d_a do local daa={}for i=1,#b_a do -daa[i]= -a_a[b_a[i]]and a_a[b_a[i]][1][nLine]or""end;c_a[nLine]=table.concat(daa)end;local _aa={}local aaa={}local baa={["0"]=dd,["1"]=__a}local caa={["0"]=__a,["1"]=dd} -for nLine=1,d_a -do local daa={}local _ba={} -for i=1,#b_a do local aba= -a_a[b_a[i]]and a_a[b_a[i]][2][nLine]or"" -daa[i]=aba:gsub("[01]",cd and -{["0"]=ad:sub(i,i),["1"]=bd:sub(i,i)}or baa) -_ba[i]=aba:gsub("[01]", -cd and{["0"]=bd:sub(i,i),["1"]=ad:sub(i,i)}or caa)end;_aa[nLine]=table.concat(daa) -aaa[nLine]=table.concat(_ba)end;return{c_a,_aa,aaa}end;local ac=require("elementManager") -local bc=ac.getElement("VisualElement")local cc=setmetatable({},bc)cc.__index=cc -cc.defineProperty(cc,"text",{default="BigFont",type="string",canTriggerRender=true,setter=function(dc,_d) -dc.bigfontText=_c(dc.get("fontSize"),_d,dc.get("foreground"),dc.get("background"))return _d end}) -cc.defineProperty(cc,"fontSize",{default=1,type="number",canTriggerRender=true,setter=function(dc,_d) -dc.bigfontText=_c(_d,dc.get("text"),dc.get("foreground"),dc.get("background"))return _d end})function cc.new()local dc=setmetatable({},cc):__init() -dc.class=cc;dc.set("width",16)dc.set("height",3)dc.set("z",5) -return dc end -function cc:init(dc,_d) -bc.init(self,dc,_d)self.set("type","BigFont") -self:observe("background",function(ad,bd) -ad.bigfontText=_c(ad.get("fontSize"),ad.get("text"),ad.get("foreground"),bd)end) -self:observe("foreground",function(ad,bd) -ad.bigfontText=_c(ad.get("fontSize"),ad.get("text"),bd,ad.get("background"))end)end -function cc:render()bc.render(self) -if(self.bigfontText)then -local dc,_d=self.get("x"),self.get("y") -for i=1,#self.bigfontText[1]do -local ad=self.bigfontText[1][i]:sub(1,self.get("width")) -local bd=self.bigfontText[2][i]:sub(1,self.get("width")) -local cd=self.bigfontText[3][i]:sub(1,self.get("width"))self:blit(dc,_d+i-1,ad,bd,cd)end end end;return cc end -project["elements/Label.lua"] = function(...) local _a=require("elementManager") -local aa=_a.getElement("VisualElement")local ba=require("libraries/utils").wrapText -local ca=setmetatable({},aa)ca.__index=ca -ca.defineProperty(ca,"text",{default="Label",type="string",canTriggerRender=true,setter=function(da,_b) -if(type(_b)=="function")then _b=_b()end -if(da.get("autoSize"))then da.set("width",#_b)else da.set("height",# -ba(_b,da.get("width")))end;return _b end}) -ca.defineProperty(ca,"autoSize",{default=true,type="boolean",canTriggerRender=true,setter=function(da,_b)if(_b)then -da.set("width",#da.get("text"))else -da.set("height",#ba(da.get("text"),da.get("width")))end;return _b end}) -function ca.new()local da=setmetatable({},ca):__init() -da.class=ca;da.set("z",3)da.set("foreground",colors.black) -da.set("backgroundEnabled",false)return da end -function ca:init(da,_b)aa.init(self,da,_b)if(self.parent)then -self.set("background",self.parent.get("background")) -self.set("foreground",self.parent.get("foreground"))end -self.set("type","Label")return self end;function ca:getWrappedText()local da=self.get("text") -local _b=ba(da,self.get("width"))return _b end -function ca:render() -aa.render(self)local da=self.get("text") -if(self.get("autoSize"))then -self:textFg(1,1,da,self.get("foreground"))else local _b=ba(da,self.get("width"))for ab,bb in ipairs(_b)do -self:textFg(1,ab,bb,self.get("foreground"))end end end;return ca end -project["elements/Tree.lua"] = function(...) local _a=require("elements/VisualElement")local aa=string.sub -local ba=setmetatable({},_a)ba.__index=ba -ba.defineProperty(ba,"nodes",{default={},type="table",canTriggerRender=true,setter=function(da,_b)if#_b>0 then -da.get("expandedNodes")[_b[1]]=true end;return _b end}) -ba.defineProperty(ba,"selectedNode",{default=nil,type="table",canTriggerRender=true}) -ba.defineProperty(ba,"expandedNodes",{default={},type="table",canTriggerRender=true}) -ba.defineProperty(ba,"scrollOffset",{default=0,type="number",canTriggerRender=true}) -ba.defineProperty(ba,"horizontalOffset",{default=0,type="number",canTriggerRender=true}) -ba.defineProperty(ba,"nodeColor",{default=colors.white,type="color"}) -ba.defineProperty(ba,"selectedColor",{default=colors.lightBlue,type="color"})ba.defineEvent(ba,"mouse_click") -ba.defineEvent(ba,"mouse_scroll")function ba.new()local da=setmetatable({},ba):__init() -da.class=ba;da.set("width",30)da.set("height",10)da.set("z",5) -return da end -function ba:init(da,_b) -_a.init(self,da,_b)self.set("type","Tree")return self end;function ba:expandNode(da)self.get("expandedNodes")[da]=true -self:updateRender()return self end -function ba:collapseNode(da)self.get("expandedNodes")[da]= -nil;self:updateRender()return self end;function ba:toggleNode(da)if self.get("expandedNodes")[da]then -self:collapseNode(da)else self:expandNode(da)end -return self end -local function ca(da,_b,ab,bb)bb=bb or{}ab= -ab or 0;for cb,db in ipairs(da)do table.insert(bb,{node=db,level=ab}) -if -_b[db]and db.children then ca(db.children,_b,ab+1,bb)end end;return bb end -function ba:mouse_click(da,_b,ab) -if _a.mouse_click(self,da,_b,ab)then -local bb,cb=self:getRelativePosition(_b,ab) -local db=ca(self.get("nodes"),self.get("expandedNodes"))local _c=cb+self.get("scrollOffset") -if db[_c]then local ac=db[_c] -local bc=ac.node -if bb<=ac.level*2 +2 then self:toggleNode(bc)end;self.set("selectedNode",bc) -self:fireEvent("node_select",bc)end;return true end;return false end -function ba:onSelect(da)self:registerCallback("node_select",da)return self end -function ba:mouse_scroll(da,_b,ab) -if _a.mouse_scroll(self,da,_b,ab)then -local bb=ca(self.get("nodes"),self.get("expandedNodes")) -local cb=math.max(0,#bb-self.get("height")) -local db=math.min(cb,math.max(0,self.get("scrollOffset")+da))self.set("scrollOffset",db)return true end;return false end -function ba:getNodeSize()local da,_b=0,0 -local ab=ca(self.get("nodes"),self.get("expandedNodes"))for bb,cb in ipairs(ab)do -da=math.max(da,cb.level+#cb.node.text)end;_b=#ab;return da,_b end -function ba:render()_a.render(self) -local da=ca(self.get("nodes"),self.get("expandedNodes"))local _b=self.get("height")local ab=self.get("selectedNode") -local bb=self.get("expandedNodes")local cb=self.get("scrollOffset") -local db=self.get("horizontalOffset") -for y=1,_b do local _c=da[y+cb] -if _c then local ac=_c.node;local bc=_c.level -local cc=string.rep(" ",bc)local dc=" "if ac.children and#ac.children>0 then -dc=bb[ac]and"\31"or"\16"end -local _d= -ac==ab and self.get("selectedColor")or self.get("background") -local ad=cc..dc.." ".. (ac.text or"Node")local bd=aa(ad,db+1,db+self.get("width")) -self:textFg(1,y, -bd..string.rep(" ",self.get("width")-#bd),self.get("foreground"))else -self:textFg(1,y,string.rep(" ",self.get("width")),self.get("foreground"),self.get("background"))end end end;return ba end -project["elements/ComboBox.lua"] = function(...) local _a=require("elements/VisualElement") -local aa=require("src.elements.DropDown")local ba=require("libraries/colorHex") -local ca=setmetatable({},aa)ca.__index=ca -ca.defineProperty(ca,"editable",{default=true,type="boolean",canTriggerRender=true}) -ca.defineProperty(ca,"text",{default="",type="string",canTriggerRender=true}) -ca.defineProperty(ca,"cursorPos",{default=1,type="number"}) -ca.defineProperty(ca,"viewOffset",{default=0,type="number",canTriggerRender=true}) -ca.defineProperty(ca,"placeholder",{default="...",type="string"}) -ca.defineProperty(ca,"placeholderColor",{default=colors.gray,type="color"}) -ca.defineProperty(ca,"focusedBackground",{default=colors.blue,type="color"}) -ca.defineProperty(ca,"focusedForeground",{default=colors.white,type="color"}) -ca.defineProperty(ca,"autoComplete",{default=false,type="boolean"}) -ca.defineProperty(ca,"manuallyOpened",{default=false,type="boolean"})function ca.new()local da=setmetatable({},ca):__init() -da.class=ca;da.set("width",16)da.set("height",1)da.set("z",8) -return da end -function ca:init(da,_b) -aa.init(self,da,_b)self.set("type","ComboBox") -self.set("cursorPos",1)self.set("viewOffset",0)return self end -function ca:setText(da)if da==nil then da=""end -self.set("text",tostring(da)) -self.set("cursorPos",#self.get("text")+1)self:updateViewport()return self end;function ca:getText()return self.get("text")end;function ca:setEditable(da) -self.set("editable",da)return self end -function ca:getFilteredItems() -local da=self.get("items")or{}local _b=self.get("text"):lower()if not -self.get("autoComplete")or#_b==0 then return da end -local ab={} -for bb,cb in ipairs(da)do local db="" -if type(cb)=="string"then db=cb:lower()elseif type(cb)=="table"and -cb.text then db=cb.text:lower()end;if db:find(_b,1,true)then table.insert(ab,cb)end end;return ab end -function ca:updateFilteredDropdown() -if not self.get("autoComplete")then return end;local da=self:getFilteredItems()local _b=#da>0 and -#self.get("text")>0 -if _b then self.set("isOpen",true) -self.set("manuallyOpened",false)local ab=self.get("dropdownHeight")or 5 -local bb=math.min(ab,#da)self.set("height",1 +bb)else self.set("isOpen",false) -self.set("manuallyOpened",false)self.set("height",1)end;self:updateRender()end -function ca:updateViewport()local da=self.get("text") -local _b=self.get("cursorPos")local ab=self.get("width")local bb=self.get("dropSymbol") -local cb=ab-#bb;if cb<1 then cb=1 end;local db=self.get("viewOffset")if _b-db>cb then db=_b-cb elseif -_b-1 1 then local cb=ab:sub(1,bb-2).. -ab:sub(bb)self.set("text",cb) -self.set("cursorPos",bb-1)self:updateViewport()if self.get("autoComplete")then -self:updateFilteredDropdown()else self:updateRender()end end elseif da==keys.delete then -if bb<=#ab then -local cb=ab:sub(1,bb-1)..ab:sub(bb+1)self.set("text",cb)self:updateViewport() -if -self.get("autoComplete")then self:updateFilteredDropdown()else self:updateRender()end end elseif da==keys.home then self.set("cursorPos",1) -self:updateViewport()elseif da==keys["end"]then self.set("cursorPos",#ab+1) -self:updateViewport()elseif da==keys.enter then -self.set("isOpen",not self.get("isOpen"))self:updateRender()end end -function ca:mouse_click(da,_b,ab) -if not _a.mouse_click(self,da,_b,ab)then return false end;local bb,cb=self:getRelativePosition(_b,ab) -local db=self.get("width")local _c=self.get("dropSymbol") -if cb==1 then -if -bb>=db-#_c+1 and bb<=db then local ac=self.get("isOpen")self.set("isOpen",not ac) -if -self.get("isOpen")then local bc=self.get("items")or{} -local cc=self.get("dropdownHeight")or 5;local dc=math.min(cc,#bc)self.set("height",1 +dc) -self.set("manuallyOpened",true)else self.set("height",1) -self.set("manuallyOpened",false)end;self:updateRender()return true end -if bb<=db-#_c and self.get("editable")then -local ac=self.get("text")local bc=self.get("viewOffset")local cc=#ac+1 -local dc=math.min(cc,bc+bb)self.set("cursorPos",dc)self:updateRender()return true end;return true elseif -self.get("isOpen")and cb>1 and self.get("selectable")then local ac=(cb-1)+self.get("offset") -local bc=self.get("items") -if ac<=#bc then local cc=bc[ac] -if type(cc)=="string"then cc={text=cc}bc[ac]=cc end -if not self.get("multiSelection")then for dc,_d in ipairs(bc)do if type(_d)=="table"then -_d.selected=false end end end;cc.selected=true;if cc.text then self:setText(cc.text)end -self.set("isOpen",false)self.set("height",1)self:updateRender()return true end end;return false end -function ca:render()_a.render(self)local da=self.get("text") -local _b=self.get("width")local ab=self.get("dropSymbol")local bb=self.get("focused") -local cb=self.get("isOpen")local db=self.get("viewOffset") -local _c=self.get("placeholder") -local ac=bb and self.get("focusedBackground")or self.get("background") -local bc=bb and self.get("focusedForeground")or self.get("foreground")local cc=da;local dc=_b-#ab;if#da==0 and not bb and#_c>0 then cc=_c -bc=self.get("placeholderColor")end -if#cc>0 then cc=cc:sub(db+1,db+dc)end;cc=cc..string.rep(" ",dc-#cc)local _d=cc.. -(cb and"\31"or"\17") -self:blit(1,1,_d,string.rep(ba[bc],_b),string.rep(ba[ac],_b)) -if bb and self.get("editable")then local ad=self.get("cursorPos") -local bd=ad-db;if bd>=1 and bd<=dc then -self:setCursor(bd,1,true,self.get("foreground"))end end -if cb then local ad -if -self.get("autoComplete")and not self.get("manuallyOpened")then ad=self:getFilteredItems()else ad=self.get("items")end -local bd=math.min(self.get("dropdownHeight"),#ad) -if bd>0 then local cd=self.get("offset") -for i=1,bd do local dd=i+cd -if ad[dd]then local __a=ad[dd] -local a_a=__a.text or""local b_a=__a.selected or false -local c_a= -b_a and self.get("selectedBackground")or self.get("background") -local d_a=b_a and self.get("selectedForeground")or self.get("foreground")if#a_a>_b then a_a=a_a:sub(1,_b)end;a_a=a_a.. -string.rep(" ",_b-#a_a) -self:blit(1,i+1,a_a,string.rep(ba[d_a],_b),string.rep(ba[c_a],_b))end end end end end;function ca:focus()aa.focus(self)end -function ca:blur()aa.blur(self) -self.set("isOpen",false)self.set("height",1)self:updateRender()end;return ca end -project["elements/Switch.lua"] = function(...) local _a=require("elementManager") -local aa=_a.getElement("VisualElement")local ba=require("libraries/colorHex") -local ca=setmetatable({},aa)ca.__index=ca -ca.defineProperty(ca,"checked",{default=false,type="boolean",canTriggerRender=true}) -ca.defineProperty(ca,"text",{default="",type="string",canTriggerRender=true}) -ca.defineProperty(ca,"autoSize",{default=false,type="boolean"}) -ca.defineProperty(ca,"onBackground",{default=colors.green,type="number",canTriggerRender=true}) -ca.defineProperty(ca,"offBackground",{default=colors.red,type="number",canTriggerRender=true})ca.defineEvent(ca,"mouse_click") -ca.defineEvent(ca,"mouse_up") -function ca.new()local da=setmetatable({},ca):__init() -da.class=ca;da.set("width",2)da.set("height",1)da.set("z",5) -da.set("backgroundEnabled",true)return da end -function ca:init(da,_b)aa.init(self,da,_b)self.set("type","Switch")end -function ca:mouse_click(da,_b,ab)if aa.mouse_click(self,da,_b,ab)then -self.set("checked",not self.get("checked"))return true end;return false end -function ca:render()local da=self.get("checked")local _b=self.get("text") -local ab=self.get("width")local bb=self.get("height")local cb=da and self.get("onBackground")or -self.get("offBackground") -self:multiBlit(1,1,ab,bb," ",ba[self.get("foreground")],ba[cb])local db=math.floor(ab/2)local _c=da and(ab-db+1)or 1 -self:multiBlit(_c,1,db,bb," ",ba[self.get("foreground")],ba[self.get("background")])if _b~=""then -self:textFg(ab+2,1,_b,self.get("foreground"))end end;return ca end -project["elements/BaseFrame.lua"] = function(...) local ba=require("elementManager") -local ca=ba.getElement("Container")local da=require("errorManager")local _b=require("render") -local ab=setmetatable({},ca)ab.__index=ab -local function bb(cb) -local db,_c=pcall(function()return peripheral.getType(cb)end)if db then return true end;return false end -ab.defineProperty(ab,"term",{default=nil,type="table",setter=function(cb,db)cb._peripheralName=nil;if -cb.basalt.getActiveFrame(cb._values.term)==cb then -cb.basalt.setActiveFrame(cb,false)end;if -db==nil or db.setCursorPos==nil then return db end;if(bb(db))then -cb._peripheralName=peripheral.getName(db)end;cb._values.term=db -if -cb.basalt.getActiveFrame(db)==nil then cb.basalt.setActiveFrame(cb)end;cb._render=_b.new(db)cb._renderUpdate=true;local _c,ac=db.getSize() -cb.set("width",_c)cb.set("height",ac)return db end})function ab.new()local cb=setmetatable({},ab):__init() -cb.class=ab;return cb end;function ab:init(cb,db) -ca.init(self,cb,db)self.set("term",term.current()) -self.set("type","BaseFrame")return self end -function ab:multiBlit(cb,db,_c,ac,bc,cc,dc)if -(cb<1)then _c=_c+cb-1;cb=1 end;if(db<1)then ac=ac+db-1;db=1 end -self._render:multiBlit(cb,db,_c,ac,bc,cc,dc)end;function ab:textFg(cb,db,_c,ac)if cb<1 then _c=string.sub(_c,1 -cb)cb=1 end -self._render:textFg(cb,db,_c,ac)end;function ab:textBg(cb,db,_c,ac)if cb<1 then _c=string.sub(_c,1 - -cb)cb=1 end -self._render:textBg(cb,db,_c,ac)end;function ab:drawText(cb,db,_c)if cb<1 then _c=string.sub(_c, -1 -cb)cb=1 end -self._render:text(cb,db,_c)end -function ab:drawFg(cb,db,_c)if cb<1 then -_c=string.sub(_c,1 -cb)cb=1 end;self._render:fg(cb,db,_c)end;function ab:drawBg(cb,db,_c)if cb<1 then _c=string.sub(_c,1 -cb)cb=1 end -self._render:bg(cb,db,_c)end -function ab:blit(cb,db,_c,ac,bc) -if cb<1 then -_c=string.sub(_c,1 -cb)ac=string.sub(ac,1 -cb)bc=string.sub(bc,1 -cb)cb=1 end;self._render:blit(cb,db,_c,ac,bc)end;function ab:setCursor(cb,db,_c,ac)local bc=self.get("term") -self._render:setCursor(cb,db,_c,ac)end -function ab:monitor_touch(cb,db,_c) -local ac=self.get("term")if ac==nil then return end -if(bb(ac))then if self._peripheralName==cb then -self:mouse_click(1,db,_c) -self.basalt.schedule(function()sleep(0.1)self:mouse_up(1,db,_c)end)end end end;function ab:mouse_click(cb,db,_c)ca.mouse_click(self,cb,db,_c) -self.basalt.setFocus(self)end -function ab:mouse_up(cb,db,_c) -ca.mouse_up(self,cb,db,_c)ca.mouse_release(self,cb,db,_c)end -function ab:term_resize()local cb,db=self.get("term").getSize() -if(cb== -self.get("width")and db==self.get("height"))then return end;self.set("width",cb)self.set("height",db) -self._render:setSize(cb,db)self._renderUpdate=true end -function ab:key(cb)self:fireEvent("key",cb)ca.key(self,cb)end -function ab:key_up(cb)self:fireEvent("key_up",cb)ca.key_up(self,cb)end -function ab:char(cb)self:fireEvent("char",cb)ca.char(self,cb)end -function ab:dispatchEvent(cb,...)local db=self.get("term")if db==nil then return end;if(bb(db))then if -cb=="mouse_click"then return end end -ca.dispatchEvent(self,cb,...)end;function ab:render() -if(self._renderUpdate)then if self._render~=nil then ca.render(self) -self._render:render()self._renderUpdate=false end end end -return ab end -project["elements/Flexbox.lua"] = function(...) local da=require("elementManager") +project["elements/FlexBox.lua"] = function(...) local da=require("elementManager") local _b=da.getElement("Container")local ab=setmetatable({},_b)ab.__index=ab ab.defineProperty(ab,"flexDirection",{default="row",type="string"}) ab.defineProperty(ab,"flexSpacing",{default=1,type="number"}) @@ -1763,6 +1361,475 @@ function ab:render() if (self.get("flexUpdateLayout"))then ac(self,self.get("flexDirection"),self.get("flexSpacing"),self.get("flexJustifyContent"),self.get("flexWrap"))end;_b.render(self)end;return ab end +project["elements/CheckBox.lua"] = function(...) local c=require("elements/VisualElement") +local d=setmetatable({},c)d.__index=d +d.defineProperty(d,"checked",{default=false,type="boolean",canTriggerRender=true}) +d.defineProperty(d,"text",{default=" ",type="string",canTriggerRender=true,setter=function(_a,aa)local ba=_a.get("checkedText") +local ca=math.max(#aa,#ba)if(_a.get("autoSize"))then _a.set("width",ca)end;return aa end}) +d.defineProperty(d,"checkedText",{default="x",type="string",canTriggerRender=true,setter=function(_a,aa)local ba=_a.get("text") +local ca=math.max(#aa,#ba)if(_a.get("autoSize"))then _a.set("width",ca)end;return aa end}) +d.defineProperty(d,"autoSize",{default=true,type="boolean"})d.defineEvent(d,"mouse_click") +d.defineEvent(d,"mouse_up")function d.new()local _a=setmetatable({},d):__init()_a.class=d +_a.set("backgroundEnabled",false)return _a end +function d:init(_a,aa) +c.init(self,_a,aa)self.set("type","CheckBox")end +function d:mouse_click(_a,aa,ba)if c.mouse_click(self,_a,aa,ba)then +self.set("checked",not self.get("checked"))return true end;return false end +function d:render()c.render(self)local _a=self.get("checked") +local aa=self.get("text")local ba=self.get("checkedText") +local ca=string.sub(_a and ba or aa,1,self.get("width"))self:textFg(1,1,ca,self.get("foreground"))end;return d end +project["elements/BigFont.lua"] = function(...) local _b=require("libraries/colorHex") +local ab={{"\32\32\32\137\156\148\158\159\148\135\135\144\159\139\32\136\157\32\159\139\32\32\143\32\32\143\32\32\32\32\32\32\32\32\147\148\150\131\148\32\32\32\151\140\148\151\140\147","\32\32\32\149\132\149\136\156\149\144\32\133\139\159\129\143\159\133\143\159\133\138\32\133\138\32\133\32\32\32\32\32\32\150\150\129\137\156\129\32\32\32\133\131\129\133\131\132","\32\32\32\130\131\32\130\131\32\32\129\32\32\32\32\130\131\32\130\131\32\32\32\32\143\143\143\32\32\32\32\32\32\130\129\32\130\135\32\32\32\32\131\32\32\131\32\131","\139\144\32\32\143\148\135\130\144\149\32\149\150\151\149\158\140\129\32\32\32\135\130\144\135\130\144\32\149\32\32\139\32\159\148\32\32\32\32\159\32\144\32\148\32\147\131\132","\159\135\129\131\143\149\143\138\144\138\32\133\130\149\149\137\155\149\159\143\144\147\130\132\32\149\32\147\130\132\131\159\129\139\151\129\148\32\32\139\131\135\133\32\144\130\151\32","\32\32\32\32\32\32\130\135\32\130\32\129\32\129\129\131\131\32\130\131\129\140\141\132\32\129\32\32\129\32\32\32\32\32\32\32\131\131\129\32\32\32\32\32\32\32\32\32","\32\32\32\32\149\32\159\154\133\133\133\144\152\141\132\133\151\129\136\153\32\32\154\32\159\134\129\130\137\144\159\32\144\32\148\32\32\32\32\32\32\32\32\32\32\32\151\129","\32\32\32\32\133\32\32\32\32\145\145\132\141\140\132\151\129\144\150\146\129\32\32\32\138\144\32\32\159\133\136\131\132\131\151\129\32\144\32\131\131\129\32\144\32\151\129\32","\32\32\32\32\129\32\32\32\32\130\130\32\32\129\32\129\32\129\130\129\129\32\32\32\32\130\129\130\129\32\32\32\32\32\32\32\32\133\32\32\32\32\32\129\32\129\32\32","\150\156\148\136\149\32\134\131\148\134\131\148\159\134\149\136\140\129\152\131\32\135\131\149\150\131\148\150\131\148\32\148\32\32\148\32\32\152\129\143\143\144\130\155\32\134\131\148","\157\129\149\32\149\32\152\131\144\144\131\148\141\140\149\144\32\149\151\131\148\32\150\32\150\131\148\130\156\133\32\144\32\32\144\32\130\155\32\143\143\144\32\152\129\32\134\32","\130\131\32\131\131\129\131\131\129\130\131\32\32\32\129\130\131\32\130\131\32\32\129\32\130\131\32\130\129\32\32\129\32\32\133\32\32\32\129\32\32\32\130\32\32\32\129\32","\150\140\150\137\140\148\136\140\132\150\131\132\151\131\148\136\147\129\136\147\129\150\156\145\138\143\149\130\151\32\32\32\149\138\152\129\149\32\32\157\152\149\157\144\149\150\131\148","\149\143\142\149\32\149\149\32\149\149\32\144\149\32\149\149\32\32\149\32\32\149\32\149\149\32\149\32\149\32\144\32\149\149\130\148\149\32\32\149\32\149\149\130\149\149\32\149","\130\131\129\129\32\129\131\131\32\130\131\32\131\131\32\131\131\129\129\32\32\130\131\32\129\32\129\130\131\32\130\131\32\129\32\129\131\131\129\129\32\129\129\32\129\130\131\32","\136\140\132\150\131\148\136\140\132\153\140\129\131\151\129\149\32\149\149\32\149\149\32\149\137\152\129\137\152\129\131\156\133\149\131\32\150\32\32\130\148\32\152\137\144\32\32\32","\149\32\32\149\159\133\149\32\149\144\32\149\32\149\32\149\32\149\150\151\129\138\155\149\150\130\148\32\149\32\152\129\32\149\32\32\32\150\32\32\149\32\32\32\32\32\32\32","\129\32\32\130\129\129\129\32\129\130\131\32\32\129\32\130\131\32\32\129\32\129\32\129\129\32\129\32\129\32\131\131\129\130\131\32\32\32\129\130\131\32\32\32\32\140\140\132","\32\154\32\159\143\32\149\143\32\159\143\32\159\144\149\159\143\32\159\137\145\159\143\144\149\143\32\32\145\32\32\32\145\149\32\144\32\149\32\143\159\32\143\143\32\159\143\32","\32\32\32\152\140\149\151\32\149\149\32\145\149\130\149\157\140\133\32\149\32\154\143\149\151\32\149\32\149\32\144\32\149\149\153\32\32\149\32\149\133\149\149\32\149\149\32\149","\32\32\32\130\131\129\131\131\32\130\131\32\130\131\129\130\131\129\32\129\32\140\140\129\129\32\129\32\129\32\137\140\129\130\32\129\32\130\32\129\32\129\129\32\129\130\131\32","\144\143\32\159\144\144\144\143\32\159\143\144\159\138\32\144\32\144\144\32\144\144\32\144\144\32\144\144\32\144\143\143\144\32\150\129\32\149\32\130\150\32\134\137\134\134\131\148","\136\143\133\154\141\149\151\32\129\137\140\144\32\149\32\149\32\149\154\159\133\149\148\149\157\153\32\154\143\149\159\134\32\130\148\32\32\149\32\32\151\129\32\32\32\32\134\32","\133\32\32\32\32\133\129\32\32\131\131\32\32\130\32\130\131\129\32\129\32\130\131\129\129\32\129\140\140\129\131\131\129\32\130\129\32\129\32\130\129\32\32\32\32\32\129\32","\32\32\32\32\149\32\32\149\32\32\32\32\32\32\32\32\149\32\32\149\32\32\32\32\32\32\32\32\149\32\32\149\32\32\32\32\32\32\32\32\149\32\32\149\32\32\32\32","\32\32\32\32\32\32\32\32\32\32\32\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\32\32\32\32\32\32\32\32\32\32\32","\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32","\32\32\32\32\149\32\32\149\32\32\32\32\32\32\32\32\149\32\32\149\32\32\32\32\32\32\32\32\149\32\32\149\32\32\32\32\32\32\32\32\149\32\32\149\32\32\32\32","\32\32\32\32\32\32\32\32\32\32\32\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\32\32\32\32\32\32\32\32\32\32\32","\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32\32\149\32","\32\32\32\32\145\32\159\139\32\151\131\132\155\143\132\134\135\145\32\149\32\158\140\129\130\130\32\152\147\155\157\134\32\32\144\144\32\32\32\32\32\32\152\131\155\131\131\129","\32\32\32\32\149\32\149\32\145\148\131\32\149\32\149\140\157\132\32\148\32\137\155\149\32\32\32\149\154\149\137\142\32\153\153\32\131\131\149\131\131\129\149\135\145\32\32\32","\32\32\32\32\129\32\130\135\32\131\131\129\134\131\132\32\129\32\32\129\32\131\131\32\32\32\32\130\131\129\32\32\32\32\129\129\32\32\32\32\32\32\130\131\129\32\32\32","\150\150\32\32\148\32\134\32\32\132\32\32\134\32\32\144\32\144\150\151\149\32\32\32\32\32\32\145\32\32\152\140\144\144\144\32\133\151\129\133\151\129\132\151\129\32\145\32","\130\129\32\131\151\129\141\32\32\142\32\32\32\32\32\149\32\149\130\149\149\32\143\32\32\32\32\142\132\32\154\143\133\157\153\132\151\150\148\151\158\132\151\150\148\144\130\148","\32\32\32\140\140\132\32\32\32\32\32\32\32\32\32\151\131\32\32\129\129\32\32\32\32\134\32\32\32\32\32\32\32\129\129\32\129\32\129\129\130\129\129\32\129\130\131\32","\156\143\32\159\141\129\153\140\132\153\137\32\157\141\32\159\142\32\150\151\129\150\131\132\140\143\144\143\141\145\137\140\148\141\141\144\157\142\32\159\140\32\151\134\32\157\141\32","\157\140\149\157\140\149\157\140\149\157\140\149\157\140\149\157\140\149\151\151\32\154\143\132\157\140\32\157\140\32\157\140\32\157\140\32\32\149\32\32\149\32\32\149\32\32\149\32","\129\32\129\129\32\129\129\32\129\129\32\129\129\32\129\129\32\129\129\131\129\32\134\32\131\131\129\131\131\129\131\131\129\131\131\129\130\131\32\130\131\32\130\131\32\130\131\32","\151\131\148\152\137\145\155\140\144\152\142\145\153\140\132\153\137\32\154\142\144\155\159\132\150\156\148\147\32\144\144\130\145\136\137\32\146\130\144\144\130\145\130\136\32\151\140\132","\151\32\149\151\155\149\149\32\149\149\32\149\149\32\149\149\32\149\149\32\149\152\137\144\157\129\149\149\32\149\149\32\149\149\32\149\149\32\149\130\150\32\32\157\129\149\32\149","\131\131\32\129\32\129\130\131\32\130\131\32\130\131\32\130\131\32\130\131\32\32\32\32\130\131\32\130\131\32\130\131\32\130\131\32\130\131\32\32\129\32\130\131\32\133\131\32","\156\143\32\159\141\129\153\140\132\153\137\32\157\141\32\159\142\32\159\159\144\152\140\144\156\143\32\159\141\129\153\140\132\157\141\32\130\145\32\32\147\32\136\153\32\130\146\32","\152\140\149\152\140\149\152\140\149\152\140\149\152\140\149\152\140\149\149\157\134\154\143\132\157\140\133\157\140\133\157\140\133\157\140\133\32\149\32\32\149\32\32\149\32\32\149\32","\130\131\129\130\131\129\130\131\129\130\131\129\130\131\129\130\131\129\130\130\131\32\134\32\130\131\129\130\131\129\130\131\129\130\131\129\32\129\32\32\129\32\32\129\32\32\129\32","\159\134\144\137\137\32\156\143\32\159\141\129\153\140\132\153\137\32\157\141\32\32\132\32\159\143\32\147\32\144\144\130\145\136\137\32\146\130\144\144\130\145\130\138\32\146\130\144","\149\32\149\149\32\149\149\32\149\149\32\149\149\32\149\149\32\149\149\32\149\131\147\129\138\134\149\149\32\149\149\32\149\149\32\149\149\32\149\154\143\149\32\157\129\154\143\149","\130\131\32\129\32\129\130\131\32\130\131\32\130\131\32\130\131\32\130\131\32\32\32\32\130\131\32\130\131\129\130\131\129\130\131\129\130\131\129\140\140\129\130\131\32\140\140\129"},{"000110000110110000110010101000000010000000100101","000000110110000000000010101000000010000000100101","000000000000000000000000000000000000000000000000","100010110100000010000110110000010100000100000110","000000110000000010110110000110000000000000110000","000000000000000000000000000000000000000000000000","000000110110000010000000100000100000000000000010","000000000110110100010000000010000000000000000100","000000000000000000000000000000000000000000000000","010000000000100110000000000000000000000110010000","000000000000000000000000000010000000010110000000","000000000000000000000000000000000000000000000000","011110110000000100100010110000000100000000000000","000000000000000000000000000000000000000000000000","000000000000000000000000000000000000000000000000","110000110110000000000000000000010100100010000000","000010000000000000110110000000000100010010000000","000000000000000000000000000000000000000000000000","010110010110100110110110010000000100000110110110","000000000000000000000110000000000110000000000000","000000000000000000000000000000000000000000000000","010100010110110000000000000000110000000010000000","110110000000000000110000110110100000000010000000","000000000000000000000000000000000000000000000000","000100011111000100011111000100011111000100011111","000000000000100100100100011011011011111111111111","000000000000000000000000000000000000000000000000","000100011111000100011111000100011111000100011111","000000000000100100100100011011011011111111111111","100100100100100100100100100100100100100100100100","000000110100110110000010000011110000000000011000","000000000100000000000010000011000110000000001000","000000000000000000000000000000000000000000000000","010000100100000000000000000100000000010010110000","000000000000000000000000000000110110110110110000","000000000000000000000000000000000000000000000000","110110110110110110000000110110110110110110110110","000000000000000000000110000000000000000000000000","000000000000000000000000000000000000000000000000","000000000000110110000110010000000000000000010010","000010000000000000000000000000000000000000000000","000000000000000000000000000000000000000000000000","110110110110110110110000110110110110000000000000","000000000000000000000110000000000000000000000000","000000000000000000000000000000000000000000000000","110110110110110110110000110000000000000000010000","000000000000000000000000100000000000000110000110","000000000000000000000000000000000000000000000000"}}local bb={}local cb={} +do local dc=0;local _d=#ab[1]local ad=#ab[1][1] +for i=1,_d,3 do +for j=1,ad,3 do +local bd=string.char(dc)local cd={}cd[1]=ab[1][i]:sub(j,j+2) +cd[2]=ab[1][i+1]:sub(j,j+2)cd[3]=ab[1][i+2]:sub(j,j+2)local dd={}dd[1]=ab[2][i]:sub(j, +j+2)dd[2]=ab[2][i+1]:sub(j,j+2)dd[3]=ab[2][ +i+2]:sub(j,j+2)cb[bd]={cd,dd}dc=dc+1 end end;bb[1]=cb end +local function db(dc,_d)local ad={["0"]="1",["1"]="0"}if dc<=#bb then return true end +for f=#bb+1,dc do local bd={}local cd=bb[ +f-1] +for char=0,255 do local dd=string.char(char)local __a={}local a_a={} +local b_a=cd[dd][1]local c_a=cd[dd][2] +for i=1,#b_a do local d_a,_aa,aaa,baa,caa,daa={},{},{},{},{},{} +for j=1,#b_a[1]do +local _ba=cb[b_a[i]:sub(j,j)][1]table.insert(d_a,_ba[1]) +table.insert(_aa,_ba[2])table.insert(aaa,_ba[3]) +local aba=cb[b_a[i]:sub(j,j)][2] +if c_a[i]:sub(j,j)=="1"then +table.insert(baa,(aba[1]:gsub("[01]",ad))) +table.insert(caa,(aba[2]:gsub("[01]",ad))) +table.insert(daa,(aba[3]:gsub("[01]",ad)))else table.insert(baa,aba[1]) +table.insert(caa,aba[2])table.insert(daa,aba[3])end end;table.insert(__a,table.concat(d_a)) +table.insert(__a,table.concat(_aa))table.insert(__a,table.concat(aaa)) +table.insert(a_a,table.concat(baa))table.insert(a_a,table.concat(caa)) +table.insert(a_a,table.concat(daa))end;bd[dd]={__a,a_a}if _d then _d="Font"..f.."Yeld"..char +os.queueEvent(_d)os.pullEvent(_d)end end;bb[f]=bd end;return true end +local function _c(dc,_d,ad,bd,cd) +if not type(_d)=="string"then error("Not a String",3)end +local dd=type(ad)=="string"and ad:sub(1,1)or _b[ad]or +error("Wrong Front Color",3) +local __a=type(bd)=="string"and bd:sub(1,1)or _b[bd]or +error("Wrong Back Color",3)if(bb[dc]==nil)then db(3,false)end;local a_a=bb[dc]or +error("Wrong font size selected",3)if _d==""then +return{{""},{""},{""}}end;local b_a={} +for daa in _d:gmatch('.')do table.insert(b_a,daa)end;local c_a={}local d_a=#a_a[b_a[1]][1] +for nLine=1,d_a do local daa={}for i=1,#b_a do +daa[i]= +a_a[b_a[i]]and a_a[b_a[i]][1][nLine]or""end;c_a[nLine]=table.concat(daa)end;local _aa={}local aaa={}local baa={["0"]=dd,["1"]=__a}local caa={["0"]=__a,["1"]=dd} +for nLine=1,d_a +do local daa={}local _ba={} +for i=1,#b_a do local aba= +a_a[b_a[i]]and a_a[b_a[i]][2][nLine]or"" +daa[i]=aba:gsub("[01]",cd and +{["0"]=ad:sub(i,i),["1"]=bd:sub(i,i)}or baa) +_ba[i]=aba:gsub("[01]", +cd and{["0"]=bd:sub(i,i),["1"]=ad:sub(i,i)}or caa)end;_aa[nLine]=table.concat(daa) +aaa[nLine]=table.concat(_ba)end;return{c_a,_aa,aaa}end;local ac=require("elementManager") +local bc=ac.getElement("VisualElement")local cc=setmetatable({},bc)cc.__index=cc +cc.defineProperty(cc,"text",{default="BigFont",type="string",canTriggerRender=true,setter=function(dc,_d) +dc.bigfontText=_c(dc.get("fontSize"),_d,dc.get("foreground"),dc.get("background"))return _d end}) +cc.defineProperty(cc,"fontSize",{default=1,type="number",canTriggerRender=true,setter=function(dc,_d) +dc.bigfontText=_c(_d,dc.get("text"),dc.get("foreground"),dc.get("background"))return _d end})function cc.new()local dc=setmetatable({},cc):__init() +dc.class=cc;dc.set("width",16)dc.set("height",3)dc.set("z",5) +return dc end +function cc:init(dc,_d) +bc.init(self,dc,_d)self.set("type","BigFont") +self:observe("background",function(ad,bd) +ad.bigfontText=_c(ad.get("fontSize"),ad.get("text"),ad.get("foreground"),bd)end) +self:observe("foreground",function(ad,bd) +ad.bigfontText=_c(ad.get("fontSize"),ad.get("text"),bd,ad.get("background"))end)end +function cc:render()bc.render(self) +if(self.bigfontText)then +local dc,_d=self.get("x"),self.get("y") +for i=1,#self.bigfontText[1]do +local ad=self.bigfontText[1][i]:sub(1,self.get("width")) +local bd=self.bigfontText[2][i]:sub(1,self.get("width")) +local cd=self.bigfontText[3][i]:sub(1,self.get("width"))self:blit(dc,_d+i-1,ad,bd,cd)end end end;return cc end +project["elements/Label.lua"] = function(...) local _a=require("elementManager") +local aa=_a.getElement("VisualElement")local ba=require("libraries/utils").wrapText +local ca=setmetatable({},aa)ca.__index=ca +ca.defineProperty(ca,"text",{default="Label",type="string",canTriggerRender=true,setter=function(da,_b) +if(type(_b)=="function")then _b=_b()end +if(da.get("autoSize"))then da.set("width",#_b)else da.set("height",# +ba(_b,da.get("width")))end;return _b end}) +ca.defineProperty(ca,"autoSize",{default=true,type="boolean",canTriggerRender=true,setter=function(da,_b)if(_b)then +da.set("width",#da.get("text"))else +da.set("height",#ba(da.get("text"),da.get("width")))end;return _b end}) +function ca.new()local da=setmetatable({},ca):__init() +da.class=ca;da.set("z",3)da.set("foreground",colors.black) +da.set("backgroundEnabled",false)return da end +function ca:init(da,_b)aa.init(self,da,_b)if(self.parent)then +self.set("background",self.parent.get("background")) +self.set("foreground",self.parent.get("foreground"))end +self.set("type","Label")return self end;function ca:getWrappedText()local da=self.get("text") +local _b=ba(da,self.get("width"))return _b end +function ca:render() +aa.render(self)local da=self.get("text") +if(self.get("autoSize"))then +self:textFg(1,1,da,self.get("foreground"))else local _b=ba(da,self.get("width"))for ab,bb in ipairs(_b)do +self:textFg(1,ab,bb,self.get("foreground"))end end end;return ca end +project["elements/Tree.lua"] = function(...) local _a=require("elements/VisualElement")local aa=string.sub +local ba=setmetatable({},_a)ba.__index=ba +ba.defineProperty(ba,"nodes",{default={},type="table",canTriggerRender=true,setter=function(da,_b)if#_b>0 then +da.get("expandedNodes")[_b[1]]=true end;return _b end}) +ba.defineProperty(ba,"selectedNode",{default=nil,type="table",canTriggerRender=true}) +ba.defineProperty(ba,"expandedNodes",{default={},type="table",canTriggerRender=true}) +ba.defineProperty(ba,"scrollOffset",{default=0,type="number",canTriggerRender=true}) +ba.defineProperty(ba,"horizontalOffset",{default=0,type="number",canTriggerRender=true}) +ba.defineProperty(ba,"nodeColor",{default=colors.white,type="color"}) +ba.defineProperty(ba,"selectedColor",{default=colors.lightBlue,type="color"})ba.defineEvent(ba,"mouse_click") +ba.defineEvent(ba,"mouse_scroll")function ba.new()local da=setmetatable({},ba):__init() +da.class=ba;da.set("width",30)da.set("height",10)da.set("z",5) +return da end +function ba:init(da,_b) +_a.init(self,da,_b)self.set("type","Tree")return self end;function ba:expandNode(da)self.get("expandedNodes")[da]=true +self:updateRender()return self end +function ba:collapseNode(da)self.get("expandedNodes")[da]= +nil;self:updateRender()return self end;function ba:toggleNode(da)if self.get("expandedNodes")[da]then +self:collapseNode(da)else self:expandNode(da)end +return self end +local function ca(da,_b,ab,bb)bb=bb or{}ab= +ab or 0;for cb,db in ipairs(da)do table.insert(bb,{node=db,level=ab}) +if +_b[db]and db.children then ca(db.children,_b,ab+1,bb)end end;return bb end +function ba:mouse_click(da,_b,ab) +if _a.mouse_click(self,da,_b,ab)then +local bb,cb=self:getRelativePosition(_b,ab) +local db=ca(self.get("nodes"),self.get("expandedNodes"))local _c=cb+self.get("scrollOffset") +if db[_c]then local ac=db[_c] +local bc=ac.node +if bb<=ac.level*2 +2 then self:toggleNode(bc)end;self.set("selectedNode",bc) +self:fireEvent("node_select",bc)end;return true end;return false end +function ba:onSelect(da)self:registerCallback("node_select",da)return self end +function ba:mouse_scroll(da,_b,ab) +if _a.mouse_scroll(self,da,_b,ab)then +local bb=ca(self.get("nodes"),self.get("expandedNodes")) +local cb=math.max(0,#bb-self.get("height")) +local db=math.min(cb,math.max(0,self.get("scrollOffset")+da))self.set("scrollOffset",db)return true end;return false end +function ba:getNodeSize()local da,_b=0,0 +local ab=ca(self.get("nodes"),self.get("expandedNodes"))for bb,cb in ipairs(ab)do +da=math.max(da,cb.level+#cb.node.text)end;_b=#ab;return da,_b end +function ba:render()_a.render(self) +local da=ca(self.get("nodes"),self.get("expandedNodes"))local _b=self.get("height")local ab=self.get("selectedNode") +local bb=self.get("expandedNodes")local cb=self.get("scrollOffset") +local db=self.get("horizontalOffset") +for y=1,_b do local _c=da[y+cb] +if _c then local ac=_c.node;local bc=_c.level +local cc=string.rep(" ",bc)local dc=" "if ac.children and#ac.children>0 then +dc=bb[ac]and"\31"or"\16"end +local _d= +ac==ab and self.get("selectedColor")or self.get("background") +local ad=cc..dc.." ".. (ac.text or"Node")local bd=aa(ad,db+1,db+self.get("width")) +self:textFg(1,y, +bd..string.rep(" ",self.get("width")-#bd),self.get("foreground"))else +self:textFg(1,y,string.rep(" ",self.get("width")),self.get("foreground"),self.get("background"))end end end;return ba end +project["elements/DropDown.lua"] = function(...) local _a=require("elements/VisualElement") +local aa=require("elements/List")local ba=require("libraries/colorHex") +local ca=setmetatable({},aa)ca.__index=ca +ca.defineProperty(ca,"isOpen",{default=false,type="boolean",canTriggerRender=true}) +ca.defineProperty(ca,"dropdownHeight",{default=5,type="number"}) +ca.defineProperty(ca,"selectedText",{default="",type="string"}) +ca.defineProperty(ca,"dropSymbol",{default="\31",type="string"})function ca.new()local da=setmetatable({},ca):__init() +da.class=ca;da.set("width",16)da.set("height",1)da.set("z",8) +return da end +function ca:init(da,_b) +aa.init(self,da,_b)self.set("type","DropDown")return self end +function ca:mouse_click(da,_b,ab) +if not _a.mouse_click(self,da,_b,ab)then return false end;local bb,cb=self:getRelativePosition(_b,ab) +if cb==1 then self.set("isOpen",not +self.get("isOpen"))if +not self.get("isOpen")then self.set("height",1)else +self.set("height",1 +math.min(self.get("dropdownHeight"),# +self.get("items")))end +return true elseif +self.get("isOpen")and cb>1 and self.get("selectable")then local db=(cb-1)+self.get("offset") +local _c=self.get("items") +if db<=#_c then local ac=_c[db] +if type(ac)=="string"then ac={text=ac}_c[db]=ac end +if not self.get("multiSelection")then for bc,cc in ipairs(_c)do if type(cc)=="table"then +cc.selected=false end end end;ac.selected=not ac.selected +if ac.callback then ac.callback(self)end;self:fireEvent("select",db,ac) +self.set("isOpen",false)self.set("height",1)self:updateRender()return true end end;return false end +function ca:render()_a.render(self)local da=self.get("selectedText") +local _b=self:getSelectedItems()if#_b>0 then local ab=_b[1]da=ab.text or"" +da=da:sub(1,self.get("width")-2)end +self:blit(1,1,da..string.rep(" ",self.get("width")-# +da-1).. ( +self.get("isOpen")and"\31"or"\17"),string.rep(ba[self.get("foreground")],self.get("width")),string.rep(ba[self.get("background")],self.get("width"))) +if self.get("isOpen")then local ab=self.get("items") +local bb=self.get("height")-1;local cb=self.get("offset")local db=self.get("width") +for i=1,bb do local _c=i+cb +local ac=ab[_c] +if ac then if type(ac)=="string"then ac={text=ac}ab[_c]=ac end +if +ac.separator then local bc=(ac.text or"-"):sub(1,1) +local cc=string.rep(bc,db)local dc=ac.foreground or self.get("foreground")local _d= +ac.background or self.get("background")self:textBg(1, +i+1,string.rep(" ",db),_d) +self:textFg(1,i+1,cc,dc)else local bc=ac.text;local cc=ac.selected;bc=bc:sub(1,db) +local dc=cc and(ac.selectedBackground or +self.get("selectedBackground"))or(ac.background or +self.get("background")) +local _d= +cc and(ac.selectedForeground or self.get("selectedForeground"))or(ac.foreground or self.get("foreground"))self:textBg(1,i+1,string.rep(" ",db),dc)self:textFg(1, +i+1,bc,_d)end end end end end;return ca end +project["elements/ComboBox.lua"] = function(...) local _a=require("elements/VisualElement") +local aa=require("elements/DropDown")local ba=require("libraries/colorHex") +local ca=setmetatable({},aa)ca.__index=ca +ca.defineProperty(ca,"editable",{default=true,type="boolean",canTriggerRender=true}) +ca.defineProperty(ca,"text",{default="",type="string",canTriggerRender=true}) +ca.defineProperty(ca,"cursorPos",{default=1,type="number"}) +ca.defineProperty(ca,"viewOffset",{default=0,type="number",canTriggerRender=true}) +ca.defineProperty(ca,"placeholder",{default="...",type="string"}) +ca.defineProperty(ca,"placeholderColor",{default=colors.gray,type="color"}) +ca.defineProperty(ca,"focusedBackground",{default=colors.blue,type="color"}) +ca.defineProperty(ca,"focusedForeground",{default=colors.white,type="color"}) +ca.defineProperty(ca,"autoComplete",{default=false,type="boolean"}) +ca.defineProperty(ca,"manuallyOpened",{default=false,type="boolean"})function ca.new()local da=setmetatable({},ca):__init() +da.class=ca;da.set("width",16)da.set("height",1)da.set("z",8) +return da end +function ca:init(da,_b) +aa.init(self,da,_b)self.set("type","ComboBox") +self.set("cursorPos",1)self.set("viewOffset",0)return self end +function ca:setText(da)if da==nil then da=""end +self.set("text",tostring(da)) +self.set("cursorPos",#self.get("text")+1)self:updateViewport()return self end;function ca:getText()return self.get("text")end;function ca:setEditable(da) +self.set("editable",da)return self end +function ca:getFilteredItems() +local da=self.get("items")or{}local _b=self.get("text"):lower()if not +self.get("autoComplete")or#_b==0 then return da end +local ab={} +for bb,cb in ipairs(da)do local db="" +if type(cb)=="string"then db=cb:lower()elseif type(cb)=="table"and +cb.text then db=cb.text:lower()end;if db:find(_b,1,true)then table.insert(ab,cb)end end;return ab end +function ca:updateFilteredDropdown() +if not self.get("autoComplete")then return end;local da=self:getFilteredItems()local _b=#da>0 and +#self.get("text")>0 +if _b then self.set("isOpen",true) +self.set("manuallyOpened",false)local ab=self.get("dropdownHeight")or 5 +local bb=math.min(ab,#da)self.set("height",1 +bb)else self.set("isOpen",false) +self.set("manuallyOpened",false)self.set("height",1)end;self:updateRender()end +function ca:updateViewport()local da=self.get("text") +local _b=self.get("cursorPos")local ab=self.get("width")local bb=self.get("dropSymbol") +local cb=ab-#bb;if cb<1 then cb=1 end;local db=self.get("viewOffset")if _b-db>cb then db=_b-cb elseif +_b-1 1 then local cb=ab:sub(1,bb-2).. +ab:sub(bb)self.set("text",cb) +self.set("cursorPos",bb-1)self:updateViewport()if self.get("autoComplete")then +self:updateFilteredDropdown()else self:updateRender()end end elseif da==keys.delete then +if bb<=#ab then +local cb=ab:sub(1,bb-1)..ab:sub(bb+1)self.set("text",cb)self:updateViewport() +if +self.get("autoComplete")then self:updateFilteredDropdown()else self:updateRender()end end elseif da==keys.home then self.set("cursorPos",1) +self:updateViewport()elseif da==keys["end"]then self.set("cursorPos",#ab+1) +self:updateViewport()elseif da==keys.enter then +self.set("isOpen",not self.get("isOpen"))self:updateRender()end end +function ca:mouse_click(da,_b,ab) +if not _a.mouse_click(self,da,_b,ab)then return false end;local bb,cb=self:getRelativePosition(_b,ab) +local db=self.get("width")local _c=self.get("dropSymbol") +if cb==1 then +if +bb>=db-#_c+1 and bb<=db then local ac=self.get("isOpen")self.set("isOpen",not ac) +if +self.get("isOpen")then local bc=self.get("items")or{} +local cc=self.get("dropdownHeight")or 5;local dc=math.min(cc,#bc)self.set("height",1 +dc) +self.set("manuallyOpened",true)else self.set("height",1) +self.set("manuallyOpened",false)end;self:updateRender()return true end +if bb<=db-#_c and self.get("editable")then +local ac=self.get("text")local bc=self.get("viewOffset")local cc=#ac+1 +local dc=math.min(cc,bc+bb)self.set("cursorPos",dc)self:updateRender()return true end;return true elseif +self.get("isOpen")and cb>1 and self.get("selectable")then local ac=(cb-1)+self.get("offset") +local bc=self.get("items") +if ac<=#bc then local cc=bc[ac] +if type(cc)=="string"then cc={text=cc}bc[ac]=cc end +if not self.get("multiSelection")then for dc,_d in ipairs(bc)do if type(_d)=="table"then +_d.selected=false end end end;cc.selected=true;if cc.text then self:setText(cc.text)end +self.set("isOpen",false)self.set("height",1)self:updateRender()return true end end;return false end +function ca:render()_a.render(self)local da=self.get("text") +local _b=self.get("width")local ab=self.get("dropSymbol")local bb=self.get("focused") +local cb=self.get("isOpen")local db=self.get("viewOffset") +local _c=self.get("placeholder") +local ac=bb and self.get("focusedBackground")or self.get("background") +local bc=bb and self.get("focusedForeground")or self.get("foreground")local cc=da;local dc=_b-#ab;if#da==0 and not bb and#_c>0 then cc=_c +bc=self.get("placeholderColor")end +if#cc>0 then cc=cc:sub(db+1,db+dc)end;cc=cc..string.rep(" ",dc-#cc)local _d=cc.. +(cb and"\31"or"\17") +self:blit(1,1,_d,string.rep(ba[bc],_b),string.rep(ba[ac],_b)) +if bb and self.get("editable")then local ad=self.get("cursorPos") +local bd=ad-db;if bd>=1 and bd<=dc then +self:setCursor(bd,1,true,self.get("foreground"))end end +if cb then local ad +if +self.get("autoComplete")and not self.get("manuallyOpened")then ad=self:getFilteredItems()else ad=self.get("items")end +local bd=math.min(self.get("dropdownHeight"),#ad) +if bd>0 then local cd=self.get("offset") +for i=1,bd do local dd=i+cd +if ad[dd]then local __a=ad[dd] +local a_a=__a.text or""local b_a=__a.selected or false +local c_a= +b_a and self.get("selectedBackground")or self.get("background") +local d_a=b_a and self.get("selectedForeground")or self.get("foreground")if#a_a>_b then a_a=a_a:sub(1,_b)end;a_a=a_a.. +string.rep(" ",_b-#a_a) +self:blit(1,i+1,a_a,string.rep(ba[d_a],_b),string.rep(ba[c_a],_b))end end end end end;function ca:focus()aa.focus(self)end +function ca:blur()aa.blur(self) +self.set("isOpen",false)self.set("height",1)self:updateRender()end;return ca end +project["elements/Switch.lua"] = function(...) local _a=require("elementManager") +local aa=_a.getElement("VisualElement")local ba=require("libraries/colorHex") +local ca=setmetatable({},aa)ca.__index=ca +ca.defineProperty(ca,"checked",{default=false,type="boolean",canTriggerRender=true}) +ca.defineProperty(ca,"text",{default="",type="string",canTriggerRender=true}) +ca.defineProperty(ca,"autoSize",{default=false,type="boolean"}) +ca.defineProperty(ca,"onBackground",{default=colors.green,type="number",canTriggerRender=true}) +ca.defineProperty(ca,"offBackground",{default=colors.red,type="number",canTriggerRender=true})ca.defineEvent(ca,"mouse_click") +ca.defineEvent(ca,"mouse_up") +function ca.new()local da=setmetatable({},ca):__init() +da.class=ca;da.set("width",2)da.set("height",1)da.set("z",5) +da.set("backgroundEnabled",true)return da end +function ca:init(da,_b)aa.init(self,da,_b)self.set("type","Switch")end +function ca:mouse_click(da,_b,ab)if aa.mouse_click(self,da,_b,ab)then +self.set("checked",not self.get("checked"))return true end;return false end +function ca:render()local da=self.get("checked")local _b=self.get("text") +local ab=self.get("width")local bb=self.get("height")local cb=da and self.get("onBackground")or +self.get("offBackground") +self:multiBlit(1,1,ab,bb," ",ba[self.get("foreground")],ba[cb])local db=math.floor(ab/2)local _c=da and(ab-db+1)or 1 +self:multiBlit(_c,1,db,bb," ",ba[self.get("foreground")],ba[self.get("background")])if _b~=""then +self:textFg(ab+2,1,_b,self.get("foreground"))end end;return ca end +project["elements/ScrollBar.lua"] = function(...) local aa=require("elements/VisualElement") +local ba=require("libraries/colorHex")local ca=setmetatable({},aa)ca.__index=ca +ca.defineProperty(ca,"value",{default=0,type="number",canTriggerRender=true}) +ca.defineProperty(ca,"min",{default=0,type="number",canTriggerRender=true}) +ca.defineProperty(ca,"max",{default=100,type="number",canTriggerRender=true}) +ca.defineProperty(ca,"step",{default=10,type="number"}) +ca.defineProperty(ca,"dragMultiplier",{default=1,type="number"}) +ca.defineProperty(ca,"symbol",{default=" ",type="string",canTriggerRender=true}) +ca.defineProperty(ca,"symbolColor",{default=colors.gray,type="color",canTriggerRender=true}) +ca.defineProperty(ca,"symbolBackgroundColor",{default=colors.black,type="color",canTriggerRender=true}) +ca.defineProperty(ca,"backgroundSymbol",{default="\127",type="string",canTriggerRender=true}) +ca.defineProperty(ca,"attachedElement",{default=nil,type="table"}) +ca.defineProperty(ca,"attachedProperty",{default=nil,type="string"}) +ca.defineProperty(ca,"minValue",{default=0,type="number"}) +ca.defineProperty(ca,"maxValue",{default=100,type="number"}) +ca.defineProperty(ca,"orientation",{default="vertical",type="string",canTriggerRender=true}) +ca.defineProperty(ca,"handleSize",{default=2,type="number",canTriggerRender=true})ca.defineEvent(ca,"mouse_click") +ca.defineEvent(ca,"mouse_release")ca.defineEvent(ca,"mouse_drag") +ca.defineEvent(ca,"mouse_scroll") +function ca.new()local ab=setmetatable({},ca):__init() +ab.class=ca;ab.set("width",1)ab.set("height",10)return ab end;function ca:init(ab,bb)aa.init(self,ab,bb)self.set("type","ScrollBar")return +self end +function ca:attach(ab,bb) +self.set("attachedElement",ab)self.set("attachedProperty",bb.property)self.set("minValue", +bb.min or 0) +self.set("maxValue",bb.max or 100) +ab:observe(bb.property,function(cb,db) +if db then local _c=self.get("minValue") +local ac=self.get("maxValue")if _c==ac then return end +self.set("value",math.floor((db-_c)/ (ac-_c)*100 +0.5))end end)return self end +function ca:updateAttachedElement()local ab=self.get("attachedElement") +if not ab then return end;local bb=self.get("value")local cb=self.get("minValue") +local db=self.get("maxValue")if type(cb)=="function"then cb=cb()end;if type(db)=="function"then +db=db()end;local _c=cb+ (bb/100)* (db-cb)ab.set(self.get("attachedProperty"),math.floor( +_c+0.5)) +return self end;local function da(ab) +return +ab.get("orientation")=="vertical"and ab.get("height")or ab.get("width")end +local function _b(ab,bb,cb) +local db,_c=ab:getRelativePosition(bb,cb)return +ab.get("orientation")=="vertical"and _c or db end +function ca:mouse_click(ab,bb,cb) +if aa.mouse_click(self,ab,bb,cb)then local db=da(self) +local _c=self.get("value")local ac=self.get("handleSize")local bc= +math.floor((_c/100)* (db-ac))+1;local cc=_b(self,bb,cb) +if +cc>=bc and cc0 and-1 or 1;local db=self.get("step") +local _c=self.get("value")local ac=_c-ab*db +self.set("value",math.min(100,math.max(0,ac)))self:updateAttachedElement()return true end +function ca:render()aa.render(self)local ab=da(self)local bb=self.get("value") +local cb=self.get("handleSize")local db=self.get("symbol")local _c=self.get("symbolColor") +local ac=self.get("symbolBackgroundColor")local bc=self.get("backgroundSymbol")local cc=self.get("orientation")== +"vertical"local dc= +math.floor((bb/100)* (ab-cb))+1 +for i=1,ab do +if cc then +self:blit(1,i,bc,ba[self.get("foreground")],ba[self.get("background")])else +self:blit(i,1,bc,ba[self.get("foreground")],ba[self.get("background")])end end +for i=dc,dc+cb-1 do if cc then self:blit(1,i,db,ba[_c],ba[ac])else +self:blit(i,1,db,ba[_c],ba[ac])end end end;return ca end +project["elements/BaseFrame.lua"] = function(...) local ba=require("elementManager") +local ca=ba.getElement("Container")local da=require("errorManager")local _b=require("render") +local ab=setmetatable({},ca)ab.__index=ab +local function bb(cb) +local db,_c=pcall(function()return peripheral.getType(cb)end)if db then return true end;return false end +ab.defineProperty(ab,"term",{default=nil,type="table",setter=function(cb,db)cb._peripheralName=nil;if +cb.basalt.getActiveFrame(cb._values.term)==cb then +cb.basalt.setActiveFrame(cb,false)end;if +db==nil or db.setCursorPos==nil then return db end;if(bb(db))then +cb._peripheralName=peripheral.getName(db)end;cb._values.term=db +if +cb.basalt.getActiveFrame(db)==nil then cb.basalt.setActiveFrame(cb)end;cb._render=_b.new(db)cb._renderUpdate=true;local _c,ac=db.getSize() +cb.set("width",_c)cb.set("height",ac)return db end})function ab.new()local cb=setmetatable({},ab):__init() +cb.class=ab;return cb end;function ab:init(cb,db) +ca.init(self,cb,db)self.set("term",term.current()) +self.set("type","BaseFrame")return self end +function ab:multiBlit(cb,db,_c,ac,bc,cc,dc)if +(cb<1)then _c=_c+cb-1;cb=1 end;if(db<1)then ac=ac+db-1;db=1 end +self._render:multiBlit(cb,db,_c,ac,bc,cc,dc)end;function ab:textFg(cb,db,_c,ac)if cb<1 then _c=string.sub(_c,1 -cb)cb=1 end +self._render:textFg(cb,db,_c,ac)end;function ab:textBg(cb,db,_c,ac)if cb<1 then _c=string.sub(_c,1 - +cb)cb=1 end +self._render:textBg(cb,db,_c,ac)end;function ab:drawText(cb,db,_c)if cb<1 then _c=string.sub(_c, +1 -cb)cb=1 end +self._render:text(cb,db,_c)end +function ab:drawFg(cb,db,_c)if cb<1 then +_c=string.sub(_c,1 -cb)cb=1 end;self._render:fg(cb,db,_c)end;function ab:drawBg(cb,db,_c)if cb<1 then _c=string.sub(_c,1 -cb)cb=1 end +self._render:bg(cb,db,_c)end +function ab:blit(cb,db,_c,ac,bc) +if cb<1 then +_c=string.sub(_c,1 -cb)ac=string.sub(ac,1 -cb)bc=string.sub(bc,1 -cb)cb=1 end;self._render:blit(cb,db,_c,ac,bc)end;function ab:setCursor(cb,db,_c,ac)local bc=self.get("term") +self._render:setCursor(cb,db,_c,ac)end +function ab:monitor_touch(cb,db,_c) +local ac=self.get("term")if ac==nil then return end +if(bb(ac))then if self._peripheralName==cb then +self:mouse_click(1,db,_c) +self.basalt.schedule(function()sleep(0.1)self:mouse_up(1,db,_c)end)end end end;function ab:mouse_click(cb,db,_c)ca.mouse_click(self,cb,db,_c) +self.basalt.setFocus(self)end +function ab:mouse_up(cb,db,_c) +ca.mouse_up(self,cb,db,_c)ca.mouse_release(self,cb,db,_c)end +function ab:term_resize()local cb,db=self.get("term").getSize() +if(cb== +self.get("width")and db==self.get("height"))then return end;self.set("width",cb)self.set("height",db) +self._render:setSize(cb,db)self._renderUpdate=true end +function ab:key(cb)self:fireEvent("key",cb)ca.key(self,cb)end +function ab:key_up(cb)self:fireEvent("key_up",cb)ca.key_up(self,cb)end +function ab:char(cb)self:fireEvent("char",cb)ca.char(self,cb)end +function ab:dispatchEvent(cb,...)local db=self.get("term")if db==nil then return end;if(bb(db))then if +cb=="mouse_click"then return end end +ca.dispatchEvent(self,cb,...)end;function ab:render() +if(self._renderUpdate)then if self._render~=nil then ca.render(self) +self._render:render()self._renderUpdate=false end end end +return ab end project["elements/Image.lua"] = function(...) local ba=require("elementManager") local ca=ba.getElement("VisualElement")local da=require("libraries/colorHex") local _b=setmetatable({},ca)_b.__index=_b @@ -2215,23 +2282,6 @@ cc:postRender()end end function db:destroy()if not self:isType("BaseFrame")then ab.destroy(self) return self else _b.header="Basalt Error" _b.error("Cannot destroy a BaseFrame.")end end;return db end -project["elements/Checkbox.lua"] = function(...) local c=require("elements/VisualElement") -local d=setmetatable({},c)d.__index=d -d.defineProperty(d,"checked",{default=false,type="boolean",canTriggerRender=true}) -d.defineProperty(d,"text",{default=" ",type="string",canTriggerRender=true,setter=function(_a,aa)local ba=_a.get("checkedText") -local ca=math.max(#aa,#ba)if(_a.get("autoSize"))then _a.set("width",ca)end;return aa end}) -d.defineProperty(d,"checkedText",{default="x",type="string",canTriggerRender=true,setter=function(_a,aa)local ba=_a.get("text") -local ca=math.max(#aa,#ba)if(_a.get("autoSize"))then _a.set("width",ca)end;return aa end}) -d.defineProperty(d,"autoSize",{default=true,type="boolean"})d.defineEvent(d,"mouse_click") -d.defineEvent(d,"mouse_up")function d.new()local _a=setmetatable({},d):__init()_a.class=d -_a.set("backgroundEnabled",false)return _a end -function d:init(_a,aa) -c.init(self,_a,aa)self.set("type","CheckBox")end -function d:mouse_click(_a,aa,ba)if c.mouse_click(self,_a,aa,ba)then -self.set("checked",not self.get("checked"))return true end;return false end -function d:render()c.render(self)local _a=self.get("checked") -local aa=self.get("text")local ba=self.get("checkedText") -local ca=string.sub(_a and ba or aa,1,self.get("width"))self:textFg(1,1,ca,self.get("foreground"))end;return d end project["elements/Graph.lua"] = function(...) local _a=require("elementManager") local aa=_a.getElement("VisualElement")local ba=require("libraries/colorHex") local ca=setmetatable({},aa)ca.__index=ca @@ -2276,56 +2326,6 @@ for cc,dc in ipairs(_c.data)do local _d=math.floor(( (cc-1)*bc)+1)local ad= (dc-ab)/ (bb-ab) local bd=math.floor(_b- (ad* (_b-1)))bd=math.max(1,math.min(bd,_b)) self:blit(_d,bd,_c.symbol,ba[_c.bgColor],ba[_c.fgColor])end end end end;return ca end -project["elements/Dropdown.lua"] = function(...) local _a=require("elements/VisualElement") -local aa=require("elements/List")local ba=require("libraries/colorHex") -local ca=setmetatable({},aa)ca.__index=ca -ca.defineProperty(ca,"isOpen",{default=false,type="boolean",canTriggerRender=true}) -ca.defineProperty(ca,"dropdownHeight",{default=5,type="number"}) -ca.defineProperty(ca,"selectedText",{default="",type="string"}) -ca.defineProperty(ca,"dropSymbol",{default="\31",type="string"})function ca.new()local da=setmetatable({},ca):__init() -da.class=ca;da.set("width",16)da.set("height",1)da.set("z",8) -return da end -function ca:init(da,_b) -aa.init(self,da,_b)self.set("type","DropDown")return self end -function ca:mouse_click(da,_b,ab) -if not _a.mouse_click(self,da,_b,ab)then return false end;local bb,cb=self:getRelativePosition(_b,ab) -if cb==1 then self.set("isOpen",not -self.get("isOpen"))if -not self.get("isOpen")then self.set("height",1)else -self.set("height",1 +math.min(self.get("dropdownHeight"),# -self.get("items")))end -return true elseif -self.get("isOpen")and cb>1 and self.get("selectable")then local db=(cb-1)+self.get("offset") -local _c=self.get("items") -if db<=#_c then local ac=_c[db] -if type(ac)=="string"then ac={text=ac}_c[db]=ac end -if not self.get("multiSelection")then for bc,cc in ipairs(_c)do if type(cc)=="table"then -cc.selected=false end end end;ac.selected=not ac.selected -if ac.callback then ac.callback(self)end;self:fireEvent("select",db,ac) -self.set("isOpen",false)self.set("height",1)self:updateRender()return true end end;return false end -function ca:render()_a.render(self)local da=self.get("selectedText") -local _b=self:getSelectedItems()if#_b>0 then local ab=_b[1]da=ab.text or"" -da=da:sub(1,self.get("width")-2)end -self:blit(1,1,da..string.rep(" ",self.get("width")-# -da-1).. ( -self.get("isOpen")and"\31"or"\17"),string.rep(ba[self.get("foreground")],self.get("width")),string.rep(ba[self.get("background")],self.get("width"))) -if self.get("isOpen")then local ab=self.get("items") -local bb=self.get("height")-1;local cb=self.get("offset")local db=self.get("width") -for i=1,bb do local _c=i+cb -local ac=ab[_c] -if ac then if type(ac)=="string"then ac={text=ac}ab[_c]=ac end -if -ac.separator then local bc=(ac.text or"-"):sub(1,1) -local cc=string.rep(bc,db)local dc=ac.foreground or self.get("foreground")local _d= -ac.background or self.get("background")self:textBg(1, -i+1,string.rep(" ",db),_d) -self:textFg(1,i+1,cc,dc)else local bc=ac.text;local cc=ac.selected;bc=bc:sub(1,db) -local dc=cc and(ac.selectedBackground or -self.get("selectedBackground"))or(ac.background or -self.get("background")) -local _d= -cc and(ac.selectedForeground or self.get("selectedForeground"))or(ac.foreground or self.get("foreground"))self:textBg(1,i+1,string.rep(" ",db),dc)self:textFg(1, -i+1,bc,_d)end end end end end;return ca end project["elements/BarChart.lua"] = function(...) local aa=require("elementManager") local ba=aa.getElement("VisualElement")local ca=aa.getElement("Graph") local da=require("libraries/colorHex")local _b=setmetatable({},ca)_b.__index=_b;function _b.new()