diff --git a/README.md b/README.md index d84de99..dd9152a 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,11 @@ If you have questions, feel free to join the discord server: [https://discord.gg ## Changelogs From now on we will add changes: +#### Version 3: +- fixed monitor support +- added :setIndex() for scrollbars +- added dynamic value system (not fully done) + #### Version 2: Note: You won't get any changes for now, so don't redownload the project! (: - reworked the filesystem, now we use require instead of loadfile diff --git a/docs/events/keyEvents.md b/docs/events/keyEvents.md index adc38fd..079fa99 100644 --- a/docs/events/keyEvents.md +++ b/docs/events/keyEvents.md @@ -8,7 +8,7 @@ Any visual object can register onKey events. Here is a example on how to add a onKey event to your frame: ```lua -local basalt = dofile("basalt.lua") +local basalt = require("Basalt") local mainFrame = basalt.createFrame("myMainFrame"):show() local subFrame = mainFrame:addFrame("subFrame"):setPosition(3,3):setSize(18,6):setBar("Sub Frame",colors.black):showBar():show() @@ -27,7 +27,7 @@ Any visual object can register onKeyUp events. Here is a example on how to add a onKeyUp event to your frame: ```lua -local basalt = dofile("basalt.lua") +local basalt = require("Basalt") local mainFrame = basalt.createFrame("myMainFrame"):show() local subFrame = mainFrame:addFrame("subFrame"):setPosition(3,3):setSize(18,6):setBar("Sub Frame",colors.black):showBar():show() diff --git a/docs/events/mouseEvents.md b/docs/events/mouseEvents.md index 0c3e181..ea864cc 100644 --- a/docs/events/mouseEvents.md +++ b/docs/events/mouseEvents.md @@ -8,7 +8,7 @@ Any visual object can register onClick events. Here is a example on how to add a onClick event to your button: ```lua -local basalt = dofile("basalt.lua") +local basalt = require("Basalt") local mainFrame = basalt.createFrame("myMainFrame"):show() local button = mainFrame:addButton("myButton"):setPosition(3,3):setSize(12,3):setText("Click"):show() @@ -27,7 +27,7 @@ Any visual object can register onClickUp events. Here is a example on how to add a onClickUp event to your button: ```lua -local basalt = dofile("basalt.lua") +local basalt = require("Basalt") local mainFrame = basalt.createFrame("myMainFrame"):show() local button = mainFrame:addButton("myButton"):setPosition(3,3):setSize(12,3):setText("Click"):show() @@ -51,7 +51,7 @@ Any visual object can register onScroll events. Here is a example on how to add a onScroll event to your button: ```lua -local basalt = dofile("basalt.lua") +local basalt = require("Basalt") local mainFrame = basalt.createFrame("myMainFrame"):show() local button = mainFrame:addButton("myButton"):setPosition(3,3):setSize(12,3):setText("Click"):show() @@ -70,7 +70,7 @@ Any visual object can register onDrag events. Here is a example on how to add a onDrag event to your button: ```lua -local basalt = dofile("basalt.lua") +local basalt = require("Basalt") local mainFrame = basalt.createFrame("myMainFrame"):show() local button = mainFrame:addButton("myButton"):setPosition(3,3):setSize(12,3):setText("Click"):show() diff --git a/docs/events/otherEvents.md b/docs/events/otherEvents.md index ebe2917..8ed8f3e 100644 --- a/docs/events/otherEvents.md +++ b/docs/events/otherEvents.md @@ -7,7 +7,7 @@ This is a custom event which gets triggered as soon as the function :setValue() Here is a example on how to add a onChange event to your input, and also another example for your checkbox: ```lua -local basalt = dofile("basalt.lua") +local basalt = require("Basalt") local mainFrame = basalt.createFrame("myMainFrame"):show() local aInput = mainFrame:addInput("specialInput"):setPosition(3,3):show() @@ -36,7 +36,7 @@ This is a custom event which gets triggered as soon as the parent frame gets res Here is a example on how to add a onResize event to your button: ```lua -local basalt = dofile("basalt.lua") +local basalt = require("Basalt") local mainFrame = basalt.createFrame("myMainFrame"):show() local aButton = mainFrame:addButton("myButton"):setPosition(3,3):show() @@ -53,6 +53,8 @@ aButton:onResize(onButtonResize) This event gets triggered as soon as the object loses its focus. ```lua +local basalt = require("Basalt") + local mainFrame = basalt.createFrame("myFirstFrame"):show() local aButton = mainFrame:addButton("exampleButton"):setPosition(3,3):onLoseFocus( function(self) @@ -66,6 +68,8 @@ local aButton = mainFrame:addButton("exampleButton"):setPosition(3,3):onLoseFocu This event gets triggered as soon as the object is the currently focused object. ```lua +local basalt = require("Basalt") + local mainFrame = basalt.createFrame("myFirstFrame"):show() local aButton = mainFrame:addButton("exampleButton"):setPosition(3,3):onGetFocus( function(self) diff --git a/docs/home/installer.md b/docs/home/installer.md index cddd247..4bd7895 100644 --- a/docs/home/installer.md +++ b/docs/home/installer.md @@ -8,9 +8,9 @@ Here is a very basic one which just installs basalt.lua if don't exist: --Basalt configurated installer local filePath = "basalt.lua" --here you can change the file path default: basalt.lua if not(fs.exists(filePath))then - shell.run("pastebin run ESs1mg7P "..filePath) -- this is an alternative to the wget command + shell.run("pastebin run ESs1mg7P packed true "..filePath) -- this is an alternative to the wget command end -local basalt = dofile(filePath) -- here you can change the variablename in any variablename you want default: basalt +local basalt = require(filePath:gsub(".lua", "")) -- here you can change the variablename in any variablename you want default: basalt ``` ## Advanced Installer @@ -51,7 +51,7 @@ if not(fs.exists(filePath))then local event, p1,p2,p3,p4 = os.pullEvent() if(event=="mouse_click")then if(p3==math.floor(h/2+2))and(p2>=w/2-8)and(p2<=w/2-2)then - shell.run("pastebin run ESs1mg7P "..filePath) + shell.run("pastebin run ESs1mg7P packed true "..filePath) _installerWindow.setVisible(false) term.clear() break @@ -69,6 +69,6 @@ if not(fs.exists(filePath))then term.clear() end -local basalt = dofile(filePath) -- here you can change the variablename in any variablename you want default: basalt +local basalt = require(filePath:gsub(".lua", "")) -- here you can change the variablename in any variablename you want default: basalt ------------------------------ ``` diff --git a/docs/objects/Basalt.md b/docs/objects/Basalt.md index 88803a1..2d74a14 100644 --- a/docs/objects/Basalt.md +++ b/docs/objects/Basalt.md @@ -1,6 +1,6 @@ To start using Basalt you have to do the following line of code: -`local basalt = dofile("basalt.lua")` +`local basalt = require("Basalt")` remember you need the basalt.lua file on your computer! diff --git a/examples/basaltPreview.lua b/examples/basaltPreview.lua index 2303e7d..040b7b6 100644 --- a/examples/basaltPreview.lua +++ b/examples/basaltPreview.lua @@ -1,9 +1,9 @@ --Basalt configurated installer local filePath = "basalt.lua" --here you can change the file path default: basalt.lua if not(fs.exists(filePath))then - shell.run("pastebin run ESs1mg7P "..filePath) -- this is an alternative to the wget command + shell.run("pastebin run ESs1mg7P packed true "..filePath) -- this is an alternative to the wget command end -local basalt = dofile(filePath) -- here you can change the variablename in any variablename you want default: basalt +local basalt = require(filePath:gsub(".lua", "")) -- here you can change the variablename in any variablename you want default: basalt local w, h = term.getSize() diff --git a/examples/progressBarEnergyExample.lua b/examples/progressBarEnergyExample.lua index 5740e5c..f1431aa 100644 --- a/examples/progressBarEnergyExample.lua +++ b/examples/progressBarEnergyExample.lua @@ -3,9 +3,9 @@ local filePath = "basalt.lua" --here you can change the file path default: basalt.lua if not(fs.exists(filePath))then - shell.run("pastebin run ESs1mg7P "..filePath) -- this is an alternative to the wget command + shell.run("pastebin run ESs1mg7P packed true "..filePath) -- this is an alternative to the wget command end -local basalt = dofile(filePath) -- here you can change the variablename in any variablename you want default: basalt +local basalt = require(filePath:gsub(".lua", "")) -- here you can change the variablename in any variablename you want default: basalt local energyCube = peripheral.find("ultimateEnergyCube")