From 897b7018a14322f260816640dd51c3713294cb78 Mon Sep 17 00:00:00 2001 From: Erb3 <49862976+Erb3@users.noreply.github.com> Date: Wed, 7 Sep 2022 16:02:11 +0200 Subject: [PATCH 01/29] [WIKI] Edit wiki home page Changed made: * Updated CC:T download link * Fix into markdown * Change underscores into astrix * Fix into markdown * Remove unnecessary
--- docs/Home.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/Home.md b/docs/Home.md index 8576b6b..0785d5d 100644 --- a/docs/Home.md +++ b/docs/Home.md @@ -1,24 +1,23 @@ # Welcome to The Basalt Wiki! -*Note: The Basalt Wiki is a work in progress. Please treat Wiki errors the same as bugs and report them accordingly.* +*Note: The Basalt Wiki is a work in progress. Please treat wiki errors the same as bugs and report them accordingly.* Here you can find information about how to use Basalt as well as examples of functional Basalt code. The aim of Basalt is to improve user interaction through visual display. ## About Basalt -Basalt is intended to be an easy-to-understand UI Framework designed for CC:Tweaked (Also know as "ComputerCraft: Tweaked") - a popular minecraft mod. For more information about CC:Tweaked, checkout the project's [wiki](https://tweaked.cc/) or [download](https://www.curseforge.com/minecraft/mc-mods/cc-tweaked). +Basalt is intended to be an easy-to-understand UI Framework designed for CC:Tweaked (Also know as "ComputerCraft: Tweaked") - a popular minecraft mod. For more information about CC:Tweaked, checkout the project's [wiki](https://tweaked.cc/) or [download](https://modrinth.com/mod/cc-tweaked). ## Quick Demo - + +![Basalt Demo GIF](https://raw.githubusercontent.com/Pyroxenium/Basalt/master/docs/_media/basaltPreview2.gif) ## Questions & Bugs -Obviously NyoriE has implemented some easter eggs, *some people* call them "bugs". If you happen to discover one of these just make a new
issue. +Obviously NyoriE has implemented some easter eggs, *some people* call them "bugs". If you happen to discover one of these just make a new [Github Issue](https://github.com/Pyroxenium/Basalt/issues) -Additionally, if you have questions about Basalt or how to make use of it, feel free to create a new discussion on Basalt's Discussion Board, or ask in our [discord](https://discord.gg/yNNnmBVBpE). +Additionally, if you have questions about Basalt or how to make use of it, feel free to create a new discussion on [Basalt's Discussion Board (Github)](https://github.com/Pyroxenium/Basalt/discussions), or ask in our [discord](https://discord.gg/yNNnmBVBpE). --- Feel free to join our [discord](https://discord.gg/yNNnmBVBpE)! - -

-- 2.49.1 From ff12c040df0702288e6756c218028acf34f17d36 Mon Sep 17 00:00:00 2001 From: Erb3 <49862976+Erb3@users.noreply.github.com> Date: Wed, 7 Sep 2022 16:07:15 +0200 Subject: [PATCH 02/29] Fix formatting in _sidebar.md --- docs/_sidebar.md | 56 +++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 1a657fa..d661492 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -1,32 +1,34 @@ +# Sidebar + - About - - [Home](Home.md) + - [Home](Home.md) - [Quick Start](home/Quick-Start.md) - [Installer](home/installer) - Objects - - [Basalt](objects/Basalt.md) - - [Object](objects/Object.md) - - [Button](objects/Button.md) - - [Checkbox](objects/Checkbox.md) - - [Dropdown](objects/Dropdown.md) - - [Frame](objects/Frame.md) - - [Image](objects/Image.md) - - [Input](objects/Input.md) - - [Label](objects/Label.md) - - [List](objects/List.md) - - [Menubar](objects/Menubar.md) - - [Pane](objects/Pane.md) - - [Program](objects/Program.md) - - [Progressbar](objects/Progressbar.md) - - [Radio](objects/Radio.md) - - [Scrollbar](objects/Scrollbar.md) - - [Slider](objects/Slider.md) - - [Textfield](objects/Textfield.md) - - [Animation](objects/Animation.md) - - [Thread](objects/Thread.md) - - [Timer](objects/Timer.md) + - [Basalt](objects/Basalt.md) + - [Object](objects/Object.md) + - [Button](objects/Button.md) + - [Checkbox](objects/Checkbox.md) + - [Dropdown](objects/Dropdown.md) + - [Frame](objects/Frame.md) + - [Image](objects/Image.md) + - [Input](objects/Input.md) + - [Label](objects/Label.md) + - [List](objects/List.md) + - [Menubar](objects/Menubar.md) + - [Pane](objects/Pane.md) + - [Program](objects/Program.md) + - [Progressbar](objects/Progressbar.md) + - [Radio](objects/Radio.md) + - [Scrollbar](objects/Scrollbar.md) + - [Slider](objects/Slider.md) + - [Textfield](objects/Textfield.md) + - [Animation](objects/Animation.md) + - [Thread](objects/Thread.md) + - [Timer](objects/Timer.md) - Tips & Tricks - - [Your Logic](tips/logic.md) - - [Button coloring](tips/buttonColoring.md) - - [Designing/Animating](tips/design.md) - - [Dynamic Values](tips/dynamicvalues.md) - - [XML](tips/xml.md) + - [Your Logic](tips/logic.md) + - [Button coloring](tips/buttonColoring.md) + - [Designing/Animating](tips/design.md) + - [Dynamic Values](tips/dynamicvalues.md) + - [XML](tips/xml.md) -- 2.49.1 From 4d83697537a61d899375a67f2174db3262cc64e8 Mon Sep 17 00:00:00 2001 From: Erb3 <49862976+Erb3@users.noreply.github.com> Date: Wed, 7 Sep 2022 16:11:53 +0200 Subject: [PATCH 03/29] Update navbar to be consistant --- docs/_navbar.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/_navbar.md b/docs/_navbar.md index f208277..5ac0836 100644 --- a/docs/_navbar.md +++ b/docs/_navbar.md @@ -1,4 +1,6 @@ +# NavBar + - Getting Started - - [Home](Home.md) - - [Quick Start](home/Quick-Start.md) + - [Home](Home) + - [Quick Start](home/Quick-Start) - [Installer](home/installer) -- 2.49.1 From 04d85b633cb25fbdd39c065a9aa5f35084b9a1a1 Mon Sep 17 00:00:00 2001 From: Erb3 <49862976+Erb3@users.noreply.github.com> Date: Wed, 7 Sep 2022 16:29:17 +0200 Subject: [PATCH 04/29] Undo adding title to sidebar and navbar --- docs/_navbar.md | 2 -- docs/_sidebar.md | 2 -- 2 files changed, 4 deletions(-) diff --git a/docs/_navbar.md b/docs/_navbar.md index 5ac0836..af382db 100644 --- a/docs/_navbar.md +++ b/docs/_navbar.md @@ -1,5 +1,3 @@ -# NavBar - - Getting Started - [Home](Home) - [Quick Start](home/Quick-Start) diff --git a/docs/_sidebar.md b/docs/_sidebar.md index d661492..ca57c17 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -1,5 +1,3 @@ -# Sidebar - - About - [Home](Home.md) - [Quick Start](home/Quick-Start.md) -- 2.49.1 From 93a0c738fa24d98f4832ef159ff7f95b052c2bc1 Mon Sep 17 00:00:00 2001 From: Erb3 <49862976+Erb3@users.noreply.github.com> Date: Wed, 7 Sep 2022 16:51:32 +0200 Subject: [PATCH 05/29] Make the footer work --- docs/Home.md | 4 ---- docs/index.html | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/Home.md b/docs/Home.md index 0785d5d..9d660da 100644 --- a/docs/Home.md +++ b/docs/Home.md @@ -17,7 +17,3 @@ Basalt is intended to be an easy-to-understand UI Framework designed for CC:Twea Obviously NyoriE has implemented some easter eggs, *some people* call them "bugs". If you happen to discover one of these just make a new [Github Issue](https://github.com/Pyroxenium/Basalt/issues) Additionally, if you have questions about Basalt or how to make use of it, feel free to create a new discussion on [Basalt's Discussion Board (Github)](https://github.com/Pyroxenium/Basalt/discussions), or ask in our [discord](https://discord.gg/yNNnmBVBpE). - ---- - -Feel free to join our [discord](https://discord.gg/yNNnmBVBpE)! diff --git a/docs/index.html b/docs/index.html index 35feccf..7006a2b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -38,6 +38,7 @@ logo: '/_media/logo.png', loadNavbar: true, loadSidebar: true, + loadFooter: '_footer.md', autoHeader: true, subMaxLevel: 2, homepage: 'Home.md', @@ -50,5 +51,7 @@ + + -- 2.49.1 From ab767e16dd269d0d90d106503a5e327838583023 Mon Sep 17 00:00:00 2001 From: Erlend Date: Wed, 7 Sep 2022 16:53:51 +0200 Subject: [PATCH 06/29] Fix _footer --- docs/{_Footer.md => _footer.md} | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename docs/{_Footer.md => _footer.md} (54%) diff --git a/docs/_Footer.md b/docs/_footer.md similarity index 54% rename from docs/_Footer.md rename to docs/_footer.md index dfb8692..d381de8 100644 --- a/docs/_Footer.md +++ b/docs/_footer.md @@ -1 +1,3 @@ -Thanks for checking out our wiki, join our discord for more help: [discord.gg/yM7kndJdJJ](discord.gg/yM7kndJdJJ) \ No newline at end of file +--- + +Thanks for checking out our wiki, join our discord for more help: [discord.gg/yM7kndJdJJ](discord.gg/yNNnmBVBpE) -- 2.49.1 From 153f2b9146fd0ea0c5cec42a36f7de65654ba582 Mon Sep 17 00:00:00 2001 From: Erlend Date: Mon, 12 Sep 2022 12:20:24 +0200 Subject: [PATCH 07/29] docs: rephrase installer.md --- docs/home/installer.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/docs/home/installer.md b/docs/home/installer.md index 831bb18..170e25c 100644 --- a/docs/home/installer.md +++ b/docs/home/installer.md @@ -1,12 +1,12 @@ # Installer -This is just a script which helps you to setup your program to automatically install the Basalt UI Framework, if it doesn't exists. Means, you create your program (which requires basalt) and add this on the top of your program. Now, everytime you execute your program it checks if basalt.lua (or your custom filepath) exists or not, if not it installs it, or if you are using the advanced installer, it asks the user if the program is allowed to install basalt for you. +This is just a script which helps you to setup your program to automatically install the Basalt UI Framework if it doesn't exist. Which means you create your program (which requires basalt), and add this on the top of your program. Now everytime you execute your program it checks if basalt.lua (or your custom filepath) exists or not. If it dosent exist it installs it, or if you are using the advanced installer it asks the user if the program is allowed to install basalt for you. ## Basic Installer -Here is a very basic one which just installs basalt.lua if don't exist: +Here is a very basic installer which just installs basalt.lua if it dosen't exist: ```lua --Basalt configurated installer -local filePath = "basalt.lua" --here you can change the file path default: basalt +local filePath = "basalt.lua" --here you can change the file path that it installs to. default: /basalt.lua if not(fs.exists(filePath))then shell.run("pastebin run ESs1mg7P packed true "..filePath:gsub(".lua", "")) -- this is an alternative to the wget command end @@ -18,8 +18,8 @@ This is a visual version, it asks the user if he wants to install basalt.lua (if ![](https://raw.githubusercontent.com/Pyroxenium/Basalt/master/docs/_media/installer.png) ```lua --Basalt configurated installer -local filePath = "basalt.lua" --here you can change the file path default: basalt -if not(fs.exists(filePath))then +local filePath = "basalt.lua" --here you can change the file path it installs to. Default: /basalt.lua +if not fs.exists(filePath) then local w,h = term.getSize() term.clear() local _installerWindow = window.create(term.current(),w/2-8,h/2-3,18,6) @@ -68,7 +68,4 @@ if not(fs.exists(filePath))then term.setCursorPos(1,1) term.clear() end - -local basalt = require(filePath:gsub(".lua", "")) -- here you can change the variablename in any variablename you want default: basalt ------------------------------- ``` -- 2.49.1 From 140f1b0014d5435a751471dd6bfe61f9d3941653 Mon Sep 17 00:00:00 2001 From: Erlend Date: Mon, 12 Sep 2022 12:23:31 +0200 Subject: [PATCH 08/29] Reword Quick-Start.md --- docs/home/Quick-Start.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/home/Quick-Start.md b/docs/home/Quick-Start.md index 5002627..a46cad6 100644 --- a/docs/home/Quick-Start.md +++ b/docs/home/Quick-Start.md @@ -1,18 +1,21 @@ -## HowTo Use +# Quick Start -To load the framework into your project, make use of the following code on top of your code. +## How to use + +To load Basalt into your project, make use of the following code on top of your code. ```lua local basalt = require("basalt") ``` -It does not matter if you have installed the single file version or the full folder project.
+It does not matter if you have installed the single file version or the full folder project. Both versions can be loaded by using `require("Basalt")`, you dont need to add `.lua`. ## Download ### Download the folder version -This version is for people who'd like to work with Basalt, change something in Basalt or checkout the project.
-But you are also able to just use it to create your own UI.
+This version is for people who'd like to work with Basalt, change something in Basalt, or checkout the project. +But you are also able to just use it to create your own UI. + To install the full project to your CC:Tweaked Computer, use the following command on your CC:Tweaked shell: @@ -30,7 +33,7 @@ This will download the project as a single file called "basalt.lua". You are imm ### Basalt Package Manager -The Basalt Package Manager is still in alpha!

+**The Basalt Package Manager is still in alpha!** The Basalt Package Manager is a visual installer, you are able to change some settings, also to choose which objects are necessary for your projects and which are not. To install the BPM (Basalt Package Manager) use the following command on your CC:Tweaked shell: -- 2.49.1 From 00fff1c2f0a263c93b2d1c0fd0cdff44bb28b548 Mon Sep 17 00:00:00 2001 From: Erb3 <49862976+Erb3@users.noreply.github.com> Date: Mon, 12 Sep 2022 20:09:14 +0200 Subject: [PATCH 09/29] Docs: Basalt.md update Changes: * Rewording * Add forgotten methods * Sort methods --- docs/objects/Basalt.md | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/docs/objects/Basalt.md b/docs/objects/Basalt.md index ac6393d..41e3e12 100644 --- a/docs/objects/Basalt.md +++ b/docs/objects/Basalt.md @@ -1,37 +1,46 @@ +# Basalt + This is the UI Manager and the first thing you want to access. Before you can access Basalt, you need to add the following code on top of your file: -`local basalt = require("basalt")` +```lua +local basalt = require("basalt") +``` -require loads the UI Framework into your project. - -Now you are able to access the following list of methods: +What this code does is it loads basalt into the basalt variable. +You are now able to access the following list of methods: | | | |---|---| +|[autoUpdate](objects/Basalt/autoUpdate.md)|Starts the event and draw listener |[createFrame](objects/Basalt/createFrame.md)|Creates a new base frame -|[removeFrame](objects/Basalt/removeFrame.md)|Removes a previously created base frame +|[debug](objects/Basalt/debug.md)|Writes something into the debug console |[getFrame](objects/Basalt/getFrame.md)|Returns a frame object by it's id |[getActiveFrame](objects/Basalt/getActiveFrame.md)|Returns the currently active base frame -|[autoUpdate](objects/Basalt/autoUpdate.md)|Starts the event and draw listener -|[update](objects/Basalt/update.md)|Starts the event and draw listener once -|[stopUpdate](objects/Basalt/stopUpdate.md)|Stops the currently active event and draw listener +|[getTheme](objects/Basalt/getTheme.md)|Returns the currently active theme +|[getVariable](objects/Basalt/getVariable.md)|Returns a variable defined with setVariable +|[getVersion](objects/Basalt/getVersion.md)|Returns the Basalt version |[isKeyDown](objects/Basalt/isKeyDown.md)|Returns if the key is held down -|[debug](objects/Basalt/debug.md)|Writes something into the debug console |[log](objects/Basalt/log.md)|Writes something into the log file +|[onEvent](objects/Basalt/onEvent.md)|Event listener +|[removeFrame](objects/Basalt/removeFrame.md)|Removes a previously created base frame +|[schedule](objects/Basalt/schedule.md)|Schedules a new task +|[setActiveFrame](objects/Basalt/setActiveFrame.md)|Sets the active frame |[setTheme](objects/Basalt/setTheme.md)|Changes the base theme of basalt |[setVariable](objects/Basalt/setVariable.md)|Sets a variable which you can access via XML -|[schedule](objects/Basalt/schedule.md)|Schedules a new task +|[stopUpdate](objects/Basalt/stopUpdate.md)|Stops the currently active event and draw listener +|[update](objects/Basalt/update.md)|Starts the event and draw listener once -# Examples +## Examples Here is a lua example on how to create a empty base frame and start basalt's listener. + ```lua -local basalt = require("basalt") -- we load the UI Framework into our project +local basalt = require("basalt") -- Loads Basalt into our project -local main = basalt.createFrame() -- we create a base frame - on that frame we are able to add object's +local main = basalt.createFrame() -- Creates a base frame. On that frame we are able to add object's --- here we would add additional object's +-- Here we would add additional object's -basalt.autoUpdate() -- we start listening to incoming events and draw stuff on the screen -``` \ No newline at end of file +basalt.autoUpdate() -- Starts listening to incoming events and draw stuff on the screen. This should nearly always be the last line. +``` -- 2.49.1 From 6fa519be86f7f3d81a2388de897d20926dda9d15 Mon Sep 17 00:00:00 2001 From: Erb3 <49862976+Erb3@users.noreply.github.com> Date: Mon, 12 Sep 2022 20:35:01 +0200 Subject: [PATCH 10/29] Docs: basalt.autoUpdate() --- docs/objects/Basalt/autoUpdate.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/objects/Basalt/autoUpdate.md b/docs/objects/Basalt/autoUpdate.md index 9038719..b74a259 100644 --- a/docs/objects/Basalt/autoUpdate.md +++ b/docs/objects/Basalt/autoUpdate.md @@ -1,12 +1,17 @@ -## basalt.autoUpdate + +# basalt.autoUpdate + This starts the event and draw handler for you. The listeners will run until you stop them. -#### Parameters: -1. `boolean` optional - if you use false as the first parameter it would stop the listeners. +## Parameters + +1. `boolean` optional - if you use false as the first parameter it would stop the listeners. Using false is a synonym for [`basalt.stopUpdate()`](objects/Basalt/stopUpdate.md). + +## Usage + +* Enables the basalt listeners, otherwise the screen will not continue to update -#### Usage: -* Enable the basalt listeners, otherwise the screen will not continue to update ```lua local main = basalt.createFrame() basalt.autoUpdate() -``` \ No newline at end of file +``` -- 2.49.1 From 04d5919a828ba7ef01a57d61aa8aa4e03f3beae5 Mon Sep 17 00:00:00 2001 From: Erb3 <49862976+Erb3@users.noreply.github.com> Date: Mon, 12 Sep 2022 20:44:18 +0200 Subject: [PATCH 11/29] Docs: basalt.createFrame --- docs/objects/Basalt/createFrame.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/objects/Basalt/createFrame.md b/docs/objects/Basalt/createFrame.md index 5650aa5..e84ec94 100644 --- a/docs/objects/Basalt/createFrame.md +++ b/docs/objects/Basalt/createFrame.md @@ -1,17 +1,23 @@ -## basalt.createFrame + +# basalt.createFrame + Creates a new base-frame, you can have as many base-frames as you want, but only 1 can be active (visible) at the same time. You can always switch between your base frames. Only the currently active base-frame listens to incoming events (except for some events like time-events and peripheral-events) -#### Parameters: +## Parameters + 1. `string` id - optional (if you dont set a id it will automatically create a uuid for you) -#### Returns: +## Returns + 1. `frame` object -#### Usage: +## Usage + * How to use multiple base frames: + ```lua local main1 = basalt.createFrame() -- Visible base frame on program start local main2 = basalt.createFrame() @@ -24,4 +30,5 @@ main1:addButton() end) main2:addLabel() :setText("We are currently on main2") -``` \ No newline at end of file +basalt.autoUpdate() +``` -- 2.49.1 From 77eeb1ce81512ccf12829a1799f8120e59493959 Mon Sep 17 00:00:00 2001 From: Erb3 <49862976+Erb3@users.noreply.github.com> Date: Mon, 12 Sep 2022 20:47:37 +0200 Subject: [PATCH 12/29] Docs: basalt.debug --- docs/objects/Basalt/debug.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/objects/Basalt/debug.md b/docs/objects/Basalt/debug.md index 948e1e0..b824186 100644 --- a/docs/objects/Basalt/debug.md +++ b/docs/objects/Basalt/debug.md @@ -1,22 +1,28 @@ -## basalt.debug + +# basalt.debug + Creates a label with some information on the main frame on the bottom left. When you click on that label it will open a log view for you. See it as the new print for debugging -You can also edit the default debug Label (change position, change color or whatever you want) by accessing the variable basalt.debugLabel +You can also edit the default debug Label (change position, change color or whatever you want) by accessing the variable `basalt.debugLabel` which returns the debug Label. -Also basalt.debugFrame and basalt.debugList are available. +`basalt.debugFrame` and `basalt.debugList` are also available. + +## Parameters -#### Parameters: 1. `...` (multiple parameters are possible, like print does) -#### Usage: +## Usage + * Prints "Hello! ^-^" to the debug console + ```lua basalt.debug("Hello! ", "^-^") ``` * Changes the debug label's anchor + ```lua basalt.debugLabel:setAnchor("topLeft") -- default anchor is bottomLeft basalt.debug("Hello!") -``` \ No newline at end of file +``` -- 2.49.1 From 72f2c527b903ab4c82dec1eba82ce691913b2ca4 Mon Sep 17 00:00:00 2001 From: Erb3 <49862976+Erb3@users.noreply.github.com> Date: Mon, 12 Sep 2022 20:51:58 +0200 Subject: [PATCH 13/29] Docs: basalt.get(Active)Frame --- docs/objects/Basalt/getActiveFrame.md | 15 ++++++++++----- docs/objects/Basalt/getFrame.md | 23 +++++++++++++++-------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/docs/objects/Basalt/getActiveFrame.md b/docs/objects/Basalt/getActiveFrame.md index 495e1d5..e778c7d 100644 --- a/docs/objects/Basalt/getActiveFrame.md +++ b/docs/objects/Basalt/getActiveFrame.md @@ -1,12 +1,17 @@ -## basalt.getActiveFrame -Returns the currently active/visible base frame -#### Returns: +# basalt.getActiveFrame + +Returns the currently active/visible base frame. + +## Returns + 1. `frame` The current frame -#### Usage: +## Usage + * Displays the active frame name in the debug console + ```lua local main = basalt.createFrame() basalt.debug(basalt.getActiveFrame():getName()) -- returns the id -``` \ No newline at end of file +``` diff --git a/docs/objects/Basalt/getFrame.md b/docs/objects/Basalt/getFrame.md index ad70e02..cf9b328 100644 --- a/docs/objects/Basalt/getFrame.md +++ b/docs/objects/Basalt/getFrame.md @@ -1,14 +1,20 @@ -## basalt.getFrame -Returns a base frame by the given id -#### Parameters: +# basalt.getFrame + +Returns a base frame by the given id. + +## Parameters + 1. `string` id -#### Returns: -1. `frame` object +## Returns + +1. `frame` The frame with the supplied id. + +## Usage -#### Usage: * Creates, fetches and shows the "myFirstFrame" object + ```lua local main = basalt.createFrame("firstBaseFrame") local main2 = basalt.createFrame("secondBaseFrame") @@ -16,8 +22,9 @@ main:addButton() :setText("Show") :onClick(function() local frame2 = basalt.getFrame("secondBaseFrame") - if(frame2~=nil)then + if(frame2 ~= nil)then frame2:show() end end) -``` \ No newline at end of file +basalt.autoUpdate() +``` -- 2.49.1 From 7bcbafe30b20eb822669e07fe1bd41fa55db276e Mon Sep 17 00:00:00 2001 From: Erb3 <49862976+Erb3@users.noreply.github.com> Date: Mon, 12 Sep 2022 20:57:06 +0200 Subject: [PATCH 14/29] Docs: basalt.getTheme --- docs/objects/Basalt/getTheme.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 docs/objects/Basalt/getTheme.md diff --git a/docs/objects/Basalt/getTheme.md b/docs/objects/Basalt/getTheme.md new file mode 100644 index 0000000..154ade3 --- /dev/null +++ b/docs/objects/Basalt/getTheme.md @@ -0,0 +1,17 @@ +# basalt.getTheme + +Returns the current theme. + +## Returns + +1. `theme` The current theme + +## Usage + +* Displays the current theme in the debug console + +```lua +basalt.debug(basalt.getTheme()) +``` + +TODO basalt.getTheme documentation -- 2.49.1 From 651690d8ab71cf5636d276fad3d4e0f095a107ff Mon Sep 17 00:00:00 2001 From: Erb3 <49862976+Erb3@users.noreply.github.com> Date: Mon, 12 Sep 2022 21:04:01 +0200 Subject: [PATCH 15/29] Docs: basalt.getVariable & basalt.getVersion --- docs/objects/Basalt/getVariable.md | 24 ++++++++++++++++++++++++ docs/objects/Basalt/getVersion.md | 15 +++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 docs/objects/Basalt/getVariable.md create mode 100644 docs/objects/Basalt/getVersion.md diff --git a/docs/objects/Basalt/getVariable.md b/docs/objects/Basalt/getVariable.md new file mode 100644 index 0000000..6d03c2f --- /dev/null +++ b/docs/objects/Basalt/getVariable.md @@ -0,0 +1,24 @@ +# basalt.getVariable + +Returns a variable defined with [setVariable](objects/Basalt/setVariable) + +## Returns + +1. `variable` The variable stored + +## Usage + +* Displays the stored variable in the debug console + +```lua +basalt.setVariable("abc", function() + basalt.debug("I got clicked") + return 1 +end) + +basalt.debug(basalt.getVariable("abc")()) -- Should debug log "I got clicked" and debug log 2 (which was returned from the function) +``` + +```xml +