Updated Basalt (markdown)
12
Basalt.md
12
Basalt.md
@@ -20,7 +20,7 @@ local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
|||||||
removes the frame
|
removes the frame
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
||||||
NyoUI.removeFrame("myFirstFrame")
|
basalt.removeFrame("myFirstFrame")
|
||||||
````
|
````
|
||||||
**args:** the id as string<br>
|
**args:** the id as string<br>
|
||||||
**returns:**-<br>
|
**returns:**-<br>
|
||||||
@@ -70,7 +70,7 @@ basalt.debug("Hi i am cute")
|
|||||||
**returns:**-<br>
|
**returns:**-<br>
|
||||||
|
|
||||||
# Tipps
|
# Tipps
|
||||||
If you are new to such things, you want to create your own logic (lets say for example a redstone or rednet handler) while using the NyoUI Framework, you just have to create something like this:
|
If you are new to such things, you want to create your own logic (lets say for example a redstone or rednet handler) while using the basalt Framework, you just have to create something like this:
|
||||||
|
|
||||||
````lua
|
````lua
|
||||||
local basalt = dofile("basalt.lua")
|
local basalt = dofile("basalt.lua")
|
||||||
@@ -85,14 +85,14 @@ local function yourCustomHandler()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
parallel.waitForAll(basalt.startUpdate, yourCustomHandler) -- here it will handle your function (yourCustomHandler) and NyoUIs handlers at the time
|
parallel.waitForAll(basalt.startUpdate, yourCustomHandler) -- here it will handle your function (yourCustomHandler) and basalts handlers at the time
|
||||||
````
|
````
|
||||||
You can read [here](http://www.computercraft.info/wiki/Parallel_(API)) what exactly parallel.waitForAll() does
|
You can read [here](http://www.computercraft.info/wiki/Parallel_(API)) what exactly parallel.waitForAll() does
|
||||||
|
|
||||||
# Installer
|
# Installer
|
||||||
Here is a premade installer you can add into your script if you want:
|
Here is a premade installer you can add into your script if you want:
|
||||||
|
|
||||||
This is a visual version, it asks the user if he wants to install NyoUI.lua (if not found)<br>
|
This is a visual version, it asks the user if he wants to install basalt.lua (if not found)<br>
|
||||||

|

|
||||||
````lua
|
````lua
|
||||||
--Basalt configurated installer
|
--Basalt configurated installer
|
||||||
@@ -146,9 +146,9 @@ local basalt = dofile(filePath) -- here you can change the variablename in any v
|
|||||||
------------------------------
|
------------------------------
|
||||||
````
|
````
|
||||||
|
|
||||||
Here is a very basic one which just installs NyoUI.lua if don't exist:
|
Here is a very basic one which just installs basalt.lua if don't exist:
|
||||||
````lua
|
````lua
|
||||||
--NyoUI configurated installer
|
--Basalt configurated installer
|
||||||
local filePath = "basalt.lua" --here you can change the file path default: basalt.lua
|
local filePath = "basalt.lua" --here you can change the file path default: basalt.lua
|
||||||
if not(fs.exists(filePath))then
|
if not(fs.exists(filePath))then
|
||||||
shell.run("wget https://raw.githubusercontent.com/NoryiE/Basalt/master/basalt.lua "..filePath)
|
shell.run("wget https://raw.githubusercontent.com/NoryiE/Basalt/master/basalt.lua "..filePath)
|
||||||
|
|||||||
Reference in New Issue
Block a user