From 2933e1cffacf22f8a4e2796c939c7b1c454db5c5 Mon Sep 17 00:00:00 2001 From: SeaSide53 Date: Sat, 3 Jun 2023 19:49:31 +0200 Subject: [PATCH 1/6] Updated setTheme.md --- docs/objects/Basalt/setTheme.md | 4 ++-- docs/objects/Frame/setTheme.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/objects/Basalt/setTheme.md b/docs/objects/Basalt/setTheme.md index 085b853..58ebfe8 100644 --- a/docs/objects/Basalt/setTheme.md +++ b/docs/objects/Basalt/setTheme.md @@ -2,11 +2,11 @@ ### Description -Sets the base theme of the project! Make sure to cover all existing objects, otherwise it will result in errors. A good example is [theme](https://github.com/Pyroxenium/Basalt/blob/master/Basalt/theme.lua). The theme can also be retrieved with [`basalt.getTheme()`](objects/Basalt/getTheme) +Sets the base theme of the project! Make sure to cover all existing objects, otherwise it will result in errors. A good example is [theme](https://github.com/Pyroxenium/Basalt/blob/master/Basalt/plugins/themes.lua). The theme can also be retrieved with [`basalt.getTheme()`](objects/Basalt/getTheme) ### Parameters -1. `table` theme - A table containing the theme layout. Look into [theme](https://github.com/Pyroxenium/Basalt/blob/master/Basalt/theme.lua) for an example +1. `table` theme - A table containing the theme layout. Look into [theme](https://github.com/Pyroxenium/Basalt/blob/master/Basalt/plugins/themes.lua) for an example ### Usage diff --git a/docs/objects/Frame/setTheme.md b/docs/objects/Frame/setTheme.md index 43e9f67..70642e9 100644 --- a/docs/objects/Frame/setTheme.md +++ b/docs/objects/Frame/setTheme.md @@ -1,10 +1,10 @@ ## setTheme -Sets the default theme, of that frame children objects always try to get the theme of its parent frame, if it does not exist it goes to its parent parent frame, and so on until it reaches the basalt manager's theme - which is stored in theme.lua (Please checkout [theme](https://github.com/Pyroxenium/Basalt/blob/master/Basalt/theme.lua) for how it could look like. +Sets the default theme, of that frame children objects always try to get the theme of its parent frame, if it does not exist it goes to its parent parent frame, and so on until it reaches the basalt manager's theme - which is stored in theme.lua (Please checkout [theme](https://github.com/Pyroxenium/Basalt/blob/master/Basalt/plugins/themes.lua) for how it could look like. #### Parameters: -1. `table` theme layout look into [theme](https://github.com/Pyroxenium/Basalt/blob/master/Basalt/theme.lua) for a example +1. `table` theme layout look into [theme](https://github.com/Pyroxenium/Basalt/blob/master/Basalt/plugins/themes.lua) for a example #### Returns: -- 2.49.1 From 414922ab2278c858356caa2cf32656f41687f4c2 Mon Sep 17 00:00:00 2001 From: SeaSide53 Date: Sat, 3 Jun 2023 20:10:22 +0200 Subject: [PATCH 2/6] Updated 1.6 setTheme.md --- docs/docs1_6/objects/Basalt/setTheme.md | 4 ++-- docs/docs1_6/objects/Frame/setTheme.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs1_6/objects/Basalt/setTheme.md b/docs/docs1_6/objects/Basalt/setTheme.md index 3c4b3df..69a3cfd 100644 --- a/docs/docs1_6/objects/Basalt/setTheme.md +++ b/docs/docs1_6/objects/Basalt/setTheme.md @@ -2,11 +2,11 @@ ## setTheme -Sets the base theme of the project! Make sure to cover all existing objects, otherwise it will result in errors. A good example is [theme](https://github.com/Pyroxenium/Basalt/blob/master/Basalt/theme.lua). The theme can also be gotten with [`basalt.getTheme()`](objects/Basalt/getTheme) +Sets the base theme of the project! Make sure to cover all existing objects, otherwise it will result in errors. A good example is [theme](https://github.com/Pyroxenium/Basalt/blob/bb1b1beb795e3cf06a84ca79408244bca715961e/Basalt/theme.lua). The theme can also be gotten with [`basalt.getTheme()`](objects/Basalt/getTheme) ### Parameters -1. `table` theme layout look into [theme](https://github.com/Pyroxenium/Basalt/blob/master/Basalt/theme.lua) for a example +1. `table` theme layout look into [theme](https://github.com/Pyroxenium/Basalt/blob/bb1b1beb795e3cf06a84ca79408244bca715961e/Basalt/theme.lua) for a example ### Usage diff --git a/docs/docs1_6/objects/Frame/setTheme.md b/docs/docs1_6/objects/Frame/setTheme.md index 43e9f67..f247da4 100644 --- a/docs/docs1_6/objects/Frame/setTheme.md +++ b/docs/docs1_6/objects/Frame/setTheme.md @@ -1,10 +1,10 @@ ## setTheme -Sets the default theme, of that frame children objects always try to get the theme of its parent frame, if it does not exist it goes to its parent parent frame, and so on until it reaches the basalt manager's theme - which is stored in theme.lua (Please checkout [theme](https://github.com/Pyroxenium/Basalt/blob/master/Basalt/theme.lua) for how it could look like. +Sets the default theme, of that frame children objects always try to get the theme of its parent frame, if it does not exist it goes to its parent parent frame, and so on until it reaches the basalt manager's theme - which is stored in theme.lua (Please checkout [theme](https://github.com/Pyroxenium/Basalt/blob/bb1b1beb795e3cf06a84ca79408244bca715961e/Basalt/theme.lua) for how it could look like. #### Parameters: -1. `table` theme layout look into [theme](https://github.com/Pyroxenium/Basalt/blob/master/Basalt/theme.lua) for a example +1. `table` theme layout look into [theme](https://github.com/Pyroxenium/Basalt/blob/bb1b1beb795e3cf06a84ca79408244bca715961e/Basalt/theme.lua) for a example #### Returns: -- 2.49.1 From 1b74c1fdfe26aa5af5922ee024f564e605da9cf3 Mon Sep 17 00:00:00 2001 From: SeaSide53 Date: Sun, 4 Jun 2023 13:56:51 +0200 Subject: [PATCH 3/6] Fixed typo --- docs/objects/Image.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/objects/Image.md b/docs/objects/Image.md index 64cbb55..6f3709b 100644 --- a/docs/objects/Image.md +++ b/docs/objects/Image.md @@ -1,6 +1,6 @@ The Image object is designed for adding more advanced backgrounds to your interface. It supports the loading of .nfp and .bimg images, allowing for greater customization of your interface's appearance. -In addition to the Object and VisualObject methods, Progressbar objects have the following methods: +In addition to the Object and VisualObject methods, Image objects have the following methods: | | | |---|---| -- 2.49.1 From 5d92bc9703be9896c3b5cce83580f43ceacdd407 Mon Sep 17 00:00:00 2001 From: SeaSide53 Date: Sun, 4 Jun 2023 15:05:52 +0200 Subject: [PATCH 4/6] Cleaned up loadImage functions --- Basalt/libraries/images.lua | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/Basalt/libraries/images.lua b/Basalt/libraries/images.lua index ce6ac00..a8caaa8 100644 --- a/Basalt/libraries/images.lua +++ b/Basalt/libraries/images.lua @@ -27,24 +27,29 @@ local function loadBBFAsBimg(path) end -local function loadImage(path, f, binaryMode) - if(sub(path, -4) == ".bimg")then +local function loadImage(path, binaryMode) + --Loads the image with the right loader, returns error if the file type is unknown. + if(sub(path, -5) == ".bimg")then return loadBIMG(path, binaryMode) - elseif(sub(path, -3) == ".bbf")then - return loadBBF(path, binaryMode) + elseif(sub(path, -4) == ".bbf")then + return loadBBF(path) + elseif(sub(path, -4) == ".nfp")then + return loadNFP(path) else - return loadNFP(path, binaryMode) + error("Unknown file type") end - -- ... end -local function loadImageAsBimg(path) - if(path:find(".bimg"))then - return loadBIMG(path) - elseif(path:find(".bbf"))then +local function loadImageAsBimg(path, binaryMode) + --Loads the image with the right Bimg loader, returns error if the file type is unknown. + if(sub(path, -5) == ".bimg")then + return loadBIMG(path, binaryMode) + elseif(sub(path, -4) == ".bbf")then return loadBBFAsBimg(path) - else + elseif(sub(path, -4) == ".nfp")then return loadNFPAsBimg(path) + else + error("Unknown file type") end end -- 2.49.1 From d8634b3ba417303f8a2be2c06067fdc94a67afd9 Mon Sep 17 00:00:00 2001 From: SeaSide53 Date: Sun, 4 Jun 2023 15:27:51 +0200 Subject: [PATCH 5/6] Changed it to use the new function --- Basalt/objects/Image.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basalt/objects/Image.lua b/Basalt/objects/Image.lua index 3f68d45..63e8fd9 100644 --- a/Basalt/objects/Image.lua +++ b/Basalt/objects/Image.lua @@ -145,7 +145,7 @@ return function(name, basalt) loadImage = function(self, path) if(fs.exists(path))then - local newBimg = images.loadBIMG(path) + local newBimg = images.loadImageAsBimg(path) bimgLibrary = bimg(newBimg) activeFrame = 1 bimgFrame = bimgLibrary.getFrameObject(1) -- 2.49.1 From 2a0bf8629b5625a134061828891bdc135af76e98 Mon Sep 17 00:00:00 2001 From: SeaSide53 Date: Sun, 4 Jun 2023 15:34:29 +0200 Subject: [PATCH 6/6] More typos --- docs/objects/Frame/addObject.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/objects/Frame/addObject.md b/docs/objects/Frame/addObject.md index b025eda..faa903b 100644 --- a/docs/objects/Frame/addObject.md +++ b/docs/objects/Frame/addObject.md @@ -1,9 +1,9 @@ ## add<Object> -Adds a new object. Don't use add<Object> please use addTheObjectYouNeed For example if you want a new Frame, use -addFrame, if you want to add a button, use addButton +Adds a new object. Don't use add<Object> please use addTheObjectYouNeed. For example if you want a new Frame, use +addFrame, if you want to add a button, use addButton. #### Parameters: -1. `string` optional - the id if you don't add a id it will autimatically generate one for you +1. `string` optional - the id if you don't add a id it will automatically generate one for you #### Returns: 1. `object` The new object you've created -- 2.49.1