Test
This commit is contained in:
@@ -10,9 +10,5 @@ not_luadoc = true
|
|||||||
all = true
|
all = true
|
||||||
no_space_before_args = true
|
no_space_before_args = true
|
||||||
wrap = true
|
wrap = true
|
||||||
custom_tags = {
|
package = 'basalt'
|
||||||
{'event', 'Events'},
|
merge = true
|
||||||
{'param', 'Parameters'},
|
|
||||||
{'return', 'Returns'},
|
|
||||||
{'usage', 'Usage'}
|
|
||||||
}
|
|
||||||
|
|||||||
29
src/main.lua
29
src/main.lua
@@ -1,15 +1,30 @@
|
|||||||
--- Basalt UI Framework main module
|
--- Basalt UI Framework main module.
|
||||||
|
-- This is the main entry point for the Basalt UI Framework.
|
||||||
|
-- It provides functions for creating and managing UI elements and handling events.
|
||||||
-- @module basalt
|
-- @module basalt
|
||||||
-- @author NyoriE
|
-- @author NyoriE
|
||||||
-- @license MIT
|
-- @license MIT
|
||||||
-- @copyright 2025
|
-- @copyright 2025
|
||||||
|
-- @release 2.0
|
||||||
|
-- @see elementManager
|
||||||
|
-- @usage
|
||||||
|
-- local basalt = require("basalt")
|
||||||
|
-- local mainFrame = basalt.createFrame()
|
||||||
|
-- mainFrame:show()
|
||||||
|
-- basalt.run()
|
||||||
|
|
||||||
local elementManager = require("elementManager")
|
local elementManager = require("elementManager")
|
||||||
local expect = require("libraries/expect")
|
local expect = require("libraries/expect")
|
||||||
local errorManager = require("errorManager")
|
local errorManager = require("errorManager")
|
||||||
|
|
||||||
--- The main Basalt instance
|
--- The main Basalt instance
|
||||||
|
-- Contains all core functionality and management functions
|
||||||
-- @type Basalt
|
-- @type Basalt
|
||||||
|
-- @field traceback boolean Enable/disable error tracing
|
||||||
|
-- @field _events table Internal events storage
|
||||||
|
-- @field _schedule table Internal schedule storage
|
||||||
|
-- @field _plugins table Plugins storage
|
||||||
|
-- @field LOGGER table Logging instance
|
||||||
local basalt = {}
|
local basalt = {}
|
||||||
basalt.traceback = true
|
basalt.traceback = true
|
||||||
basalt._events = {}
|
basalt._events = {}
|
||||||
@@ -21,11 +36,15 @@ local mainFrame = nil
|
|||||||
local updaterActive = false
|
local updaterActive = false
|
||||||
|
|
||||||
--- Creates a new UI element
|
--- Creates a new UI element
|
||||||
|
-- Creates and returns a new UI element of the specified type
|
||||||
-- @function create
|
-- @function create
|
||||||
-- @param type string The type of element to create (e.g. "BaseFrame")
|
-- @param type string The type of element to create (e.g. "Button", "Label", "BaseFrame")
|
||||||
-- @param[opt] id string Optional ID for the element
|
-- @param[opt] id string Optional unique identifier for the element
|
||||||
-- @return table The created element instance
|
-- @treturn table The created element instance
|
||||||
-- @usage local button = basalt.create("Button", "myButton")
|
-- @see elementManager.getElement
|
||||||
|
-- @usage
|
||||||
|
-- local button = basalt.create("Button", "myButton")
|
||||||
|
-- button:setPosition(5, 5)
|
||||||
function basalt.create(type, id)
|
function basalt.create(type, id)
|
||||||
if(id==nil)then id = elementManager.generateId() end
|
if(id==nil)then id = elementManager.generateId() end
|
||||||
local element = elementManager.getElement(type).new(id, basalt)
|
local element = elementManager.getElement(type).new(id, basalt)
|
||||||
|
|||||||
Reference in New Issue
Block a user