bad syntax fix

This commit is contained in:
Samuel Pizette
2022-06-09 11:08:26 -04:00
parent 42f1870475
commit cb98307e44
25 changed files with 296 additions and 296 deletions

View File

@@ -10,16 +10,16 @@ Just use the following command in any CC:Tweaked shell:
This will download `basalt.lua` to your local directory
To load the framework, make use of the following snippet
````lua
```lua
--> For those who are unfamiliar with lua, dofile executes the code in the referenced file
local basalt = dofile("basalt.lua")
````
```
Here is a fully functioning example of Basalt code
````lua
```lua
local basalt = dofile("basalt.lua") --> Load the Basalt framework
--> Create the first frame. Please note that Basalt needs at least one active "non-parent" frame to properly supply events
@@ -50,9 +50,9 @@ button:onClick(buttonClick)
button:show() --> Make the button visible, so the user can click it
basalt.autoUpdate() --> Basalt#autoUpdate starts the event listener to detect user input
````
```
If you're like us and strive for succinct and beautiful code, here is a cleaner implementation of the code above:
````lua
```lua
local basalt = dofile("basalt.lua")
local mainFrame = basalt.createFrame("mainFrame"):show()
@@ -67,4 +67,4 @@ local button = mainFrame --> Basalt returns an instance of the object on most me
:show()
basalt.autoUpdate()
````
```

View File

@@ -12,15 +12,15 @@ Just use the following command in any CC:Tweaked shell:
This will download `basalt.lua` to your local directory.
To load the framework, make use of the following snippet:
````lua
```lua
--> For those who are unfamiliar with lua, dofile executes the code in the referenced file
local basalt = dofile("basalt.lua")
````
```
Here is a fully functioning example of Basalt code:
````lua
```lua
local basalt = dofile("basalt.lua") --> Load the Basalt framework
--> Create the first frame. Please note that Basalt needs at least one active "non-parent" frame to properly supply events
@@ -51,9 +51,9 @@ button:onClick(buttonClick)
button:show() --> Make the button visible, so the user can click it
basalt.autoUpdate() --> Basalt#autoUpdate starts the event listener to detect user input
````
```
If you're like us and strive for succinct and beautiful code, here is a cleaner implementation of the code above:
````lua
```lua
local basalt = dofile("basalt.lua")
local mainFrame = basalt.createFrame("mainFrame"):show()
@@ -68,4 +68,4 @@ local button = mainFrame --> Basalt returns an instance of the object on most me
:show()
basalt.autoUpdate()
````
```

View File

@@ -5,7 +5,7 @@ This is just a script which helps you to install basalt.lua, if it's not already
## Visual Installer
This is a visual version, it asks the user if he wants to install basalt.lua (if not found)<br>
![](https://i.imgur.com/b4Ys7FB.png)
````lua
```lua
--Basalt configurated installer
local filePath = "basalt.lua" --here you can change the file path default: basalt.lua
if not(fs.exists(filePath))then
@@ -59,11 +59,11 @@ if not(fs.exists(filePath))then
end
local basalt = dofile(filePath) -- here you can change the variablename in any variablename you want default: basalt
````
```
## Basic Installer
Here is a very basic one which just installs basalt.lua if don't exist:
````lua
```lua
--Basalt configurated installer
local filePath = "basalt.lua" --here you can change the file path default: basalt.lua
if not(fs.exists(filePath))then
@@ -71,4 +71,4 @@ if not(fs.exists(filePath))then
end
local basalt = dofile(filePath) -- here you can change the variablename in any variablename you want default: basalt
````
```