From fd19492ad14e4d48e206358df652c60abcd4f77e Mon Sep 17 00:00:00 2001 From: Ryan Luu Date: Thu, 4 Dec 2025 00:32:04 +0000 Subject: [PATCH 01/10] Remove line number and toc limit Signed-off-by: GitHub --- mkdocs.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index 9fdf29a..c9042a5 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -53,10 +53,7 @@ markdown_extensions: - attr_list - toc: permalink: true - toc_depth: 3 - pymdownx.superfences - - pymdownx.highlight: - linenums: true nav: - Home: index.md From 453ca903bdeeee283d0707cb7759982c7fa63467 Mon Sep 17 00:00:00 2001 From: Ryan Luu Date: Thu, 4 Dec 2025 00:34:53 +0000 Subject: [PATCH 02/10] Add linenumbers to examples Signed-off-by: GitHub --- docs/api-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-reference.md b/docs/api-reference.md index a6105c5..2376ed1 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -1,6 +1,6 @@ Purse unlocks APIs for the CoreGui backpack which were previously locked to other CoreGui scripts. To access the APIs, just require Purse like any other [module script]: -``` lua title="Toggle Inventory Example" +``` lua title="Toggle Inventory Example" linenums="1" local ReplicatedStorage = game:GetService("ReplicatedStorage") local Purse = require(ReplicatedStorage.Purse) From 3403648d86b527e3dc66ba8997f15c7af2b7962b Mon Sep 17 00:00:00 2001 From: Ryan Luu Date: Thu, 4 Dec 2025 04:06:28 +0000 Subject: [PATCH 03/10] Improve formatting for returns Signed-off-by: GitHub --- docs/api-reference.md | 94 +++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 48 deletions(-) diff --git a/docs/api-reference.md b/docs/api-reference.md index 2376ed1..9132b67 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -14,99 +14,97 @@ Purse.OpenClose() -- Toggle the inventory ### OpenClose -Toggles the backpack open/closed state. If the backpack is currently open, it will close it. If closed, it will open it. +``` +OpenClose(): () +``` + +Toggles the inventory open/closed state. If the inventory is currently open, it will close it. If closed, it will open it. ## Properties ### IsHotbarVisible -Returns if the hotbar is currently visible to the player. - -#### Returns - -[boolean] +``` +IsHotbarVisible: boolean +``` ### IsOpen -Returns if the inventory is currently open to the player. - -#### Returns - -[boolean] +``` +IsOpen: boolean +``` ### ModuleName -Returns the module name. This will always return "Backpack". - -#### Returns +``` +ModuleName: string +``` -[string] +Returns "Backpack". ### KeepVRTopbarOpen -Returns `true`. - -#### Returns +``` +KeepVRTopbarOpen: boolean +``` -[boolean] +Returns `true`. ### VRIsExclusive -Returns `true`. - -#### Returns +``` +VRIsExclusive: boolean +``` -[boolean] +Returns `true`. ### VRClosesNonExclusive -Returns `true`. - -#### Returns +``` +VRClosesNonExclusive: boolean +``` -[boolean] +Returns `true`. ### IsInventoryEmpty -Returns if the inventory is empty. - -#### Returns +``` +IsInventoryEmpty: boolean +``` -[boolean] +Returns `true` if the inventory is empty. ## Events ### StateChanged -Fires when the backpack is closed or opened. - -#### Returns - -[BindableEvent] +``` +StateChanged: BindableEvent +``` ### BackpackEmpty -Fires when the inventory is empty. - -#### Returns +``` +BackpackEmpty: BindableEvent +``` -[BindableEvent] +Fires when the inventory is empty. ### BackpackItemAdded -Fires when a item is added to the inventory. - -#### Returns +``` +BackpackItemAdded: BindableEvent +``` -[BindableEvent] +Fires when a item is added to the inventory. ### BackpackItemRemoved -Fires when a item is removed from the inventory. - -#### Returns +``` +BackpackItemRemoved: BindableEvent +``` -[BindableEvent] +Fires when a item is removed from the inventory. [BindableEvent]: https://create.roblox.com/docs/reference/engine/classes/BindableEvent [boolean]: https://create.roblox.com/docs/luau/booleans From 758f951b99d8b994e47679238ca72b9f4bebb77d Mon Sep 17 00:00:00 2001 From: Ryan Luu Date: Thu, 4 Dec 2025 22:36:28 +0000 Subject: [PATCH 04/10] Improve API reference returns and descriptions Signed-off-by: GitHub --- docs/api-reference.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/api-reference.md b/docs/api-reference.md index 9132b67..93aa56c 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -18,7 +18,7 @@ Purse.OpenClose() -- Toggle the inventory OpenClose(): () ``` -Toggles the inventory open/closed state. If the inventory is currently open, it will close it. If closed, it will open it. +Toggles whether or not the inventory is visible. ## Properties @@ -28,12 +28,16 @@ Toggles the inventory open/closed state. If the inventory is currently open, it IsHotbarVisible: boolean ``` +Determines whether or not the hotbar is visible. + ### IsOpen ``` IsOpen: boolean ``` +Returns `true` if the inventory is open. + ### ModuleName ``` @@ -82,6 +86,8 @@ Returns `true` if the inventory is empty. StateChanged: BindableEvent ``` +Fires when the inventory is toggled. + ### BackpackEmpty ``` @@ -108,4 +114,4 @@ Fires when a item is removed from the inventory. [BindableEvent]: https://create.roblox.com/docs/reference/engine/classes/BindableEvent [boolean]: https://create.roblox.com/docs/luau/booleans - [string]: https://create.roblox.com/docs/luau/strings + [string]: https://create.roblox.com/docs/luau/strings \ No newline at end of file From a18923778868e417beeddc52611cb4ae3a818777 Mon Sep 17 00:00:00 2001 From: Ryan Luu Date: Thu, 4 Dec 2025 22:57:22 +0000 Subject: [PATCH 05/10] Improve example Signed-off-by: GitHub --- docs/api-reference.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/api-reference.md b/docs/api-reference.md index 93aa56c..3b09c52 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -1,11 +1,18 @@ -Purse unlocks APIs for the CoreGui backpack which were previously locked to other CoreGui scripts. To access the APIs, just require Purse like any other [module script]: +Purse unlocks APIs for the CoreGui backpack which were previously locked to other CoreGui scripts. To access the APIs, just require Purse like any other [module script]. -``` lua title="Toggle Inventory Example" linenums="1" +``` lua title="LocalScript - Inventory Toggle Button" linenums="1" local ReplicatedStorage = game:GetService("ReplicatedStorage") +local Players = game:GetService("Players") local Purse = require(ReplicatedStorage.Purse) -Purse.OpenClose() -- Toggle the inventory +local button = script.Parent + +local function onButtonActivated() + Purse.OpenClose() -- Toggle the inventory +end + +button.Activated:Connect(onButtonActivated) ``` [module script]: https://create.roblox.com/docs/reference/engine/classes/ModuleScript From e6d1c8e582949255a68e152f381230ea1a1d4651 Mon Sep 17 00:00:00 2001 From: Ryan Luu Date: Thu, 4 Dec 2025 22:57:28 +0000 Subject: [PATCH 06/10] Improve formatting Signed-off-by: GitHub --- docs/api-reference.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/api-reference.md b/docs/api-reference.md index 3b09c52..bb58b7e 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -43,7 +43,7 @@ Determines whether or not the hotbar is visible. IsOpen: boolean ``` -Returns `true` if the inventory is open. +Returns true if the inventory is open. ### ModuleName @@ -59,7 +59,7 @@ Returns "Backpack". KeepVRTopbarOpen: boolean ``` -Returns `true`. +Returns true. ### VRIsExclusive @@ -67,7 +67,7 @@ Returns `true`. VRIsExclusive: boolean ``` -Returns `true`. +Returns true. ### VRClosesNonExclusive @@ -75,7 +75,7 @@ Returns `true`. VRClosesNonExclusive: boolean ``` -Returns `true`. +Returns true. ### IsInventoryEmpty @@ -83,7 +83,7 @@ Returns `true`. IsInventoryEmpty: boolean ``` -Returns `true` if the inventory is empty. +Returns true if the inventory is empty. ## Events From 1943fe1f0962557469088f10186c2c18c764781f Mon Sep 17 00:00:00 2001 From: Ryan Luu Date: Thu, 4 Dec 2025 23:27:01 +0000 Subject: [PATCH 07/10] Improve return block Signed-off-by: GitHub --- docs/api-reference.md | 55 +++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/docs/api-reference.md b/docs/api-reference.md index bb58b7e..3cde0f3 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -21,7 +21,7 @@ button.Activated:Connect(onButtonActivated) ### OpenClose -``` +``` lua OpenClose(): () ``` @@ -31,7 +31,7 @@ Toggles whether or not the inventory is visible. ### IsHotbarVisible -``` +``` lua IsHotbarVisible: boolean ``` @@ -39,7 +39,7 @@ Determines whether or not the hotbar is visible. ### IsOpen -``` +``` lua IsOpen: boolean ``` @@ -47,39 +47,32 @@ Returns true if the inventory is open. ### ModuleName -``` -ModuleName: string +``` lua +ModuleName: "Backpack" ``` -Returns "Backpack". - ### KeepVRTopbarOpen -``` -KeepVRTopbarOpen: boolean +``` lua +KeepVRTopbarOpen: true ``` -Returns true. ### VRIsExclusive +``` lua +VRIsExclusive: true ``` -VRIsExclusive: boolean -``` - -Returns true. ### VRClosesNonExclusive +``` lua +VRClosesNonExclusive: true ``` -VRClosesNonExclusive: boolean -``` - -Returns true. ### IsInventoryEmpty -``` +``` lua IsInventoryEmpty: boolean ``` @@ -89,35 +82,35 @@ Returns true if the inventory is empty. ### StateChanged -``` -StateChanged: BindableEvent +``` lua +StateChanged(isNowOpen: boolean): BindableEvent ``` -Fires when the inventory is toggled. +Fires after the inventory is opened or closed. ### BackpackEmpty -``` -BackpackEmpty: BindableEvent +``` lua +BackpackEmpty(): BindableEvent ``` -Fires when the inventory is empty. +Fires when the backpack becomes empty. ### BackpackItemAdded -``` -BackpackItemAdded: BindableEvent +``` lua +BackpackItemAdded(): BindableEvent ``` -Fires when a item is added to the inventory. +Fires when an item is added to the backpack. ### BackpackItemRemoved -``` -BackpackItemRemoved: BindableEvent +``` lua +BackpackItemRemoved(): BindableEvent ``` -Fires when a item is removed from the inventory. +Fires when an item is removed from the backpack. [BindableEvent]: https://create.roblox.com/docs/reference/engine/classes/BindableEvent [boolean]: https://create.roblox.com/docs/luau/booleans From d22844f0623989bb3eaa45e41b2ed60eaab05ec7 Mon Sep 17 00:00:00 2001 From: Ryan Luu Date: Thu, 4 Dec 2025 23:32:56 +0000 Subject: [PATCH 08/10] Fix IsInventoryEmpty being a function Signed-off-by: GitHub --- docs/api-reference.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/api-reference.md b/docs/api-reference.md index 3cde0f3..2a877b7 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -27,6 +27,14 @@ OpenClose(): () Toggles whether or not the inventory is visible. +### IsInventoryEmpty + +``` lua +IsInventoryEmpty(): boolean +``` + +Returns true if the inventory is empty. + ## Properties ### IsHotbarVisible @@ -70,14 +78,6 @@ VRIsExclusive: true VRClosesNonExclusive: true ``` -### IsInventoryEmpty - -``` lua -IsInventoryEmpty: boolean -``` - -Returns true if the inventory is empty. - ## Events ### StateChanged From acf64259d7cf766484993ce381788ad090ffba8b Mon Sep 17 00:00:00 2001 From: Ryan Luu Date: Thu, 4 Dec 2025 23:38:55 +0000 Subject: [PATCH 09/10] Fix return docs Signed-off-by: GitHub --- docs/api-reference.md | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/docs/api-reference.md b/docs/api-reference.md index 2a877b7..81dd34e 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -21,7 +21,7 @@ button.Activated:Connect(onButtonActivated) ### OpenClose -``` lua +``` OpenClose(): () ``` @@ -29,7 +29,7 @@ Toggles whether or not the inventory is visible. ### IsInventoryEmpty -``` lua +``` IsInventoryEmpty(): boolean ``` @@ -39,7 +39,7 @@ Returns true if the inventory is empty. ### IsHotbarVisible -``` lua +``` IsHotbarVisible: boolean ``` @@ -47,7 +47,7 @@ Determines whether or not the hotbar is visible. ### IsOpen -``` lua +``` IsOpen: boolean ``` @@ -55,34 +55,41 @@ Returns true if the inventory is open. ### ModuleName -``` lua -ModuleName: "Backpack" ``` +ModuleName: string +``` + +Returns "Backpack". ### KeepVRTopbarOpen -``` lua -KeepVRTopbarOpen: true +``` +KeepVRTopbarOpen: boolean ``` +Returns true. ### VRIsExclusive -``` lua -VRIsExclusive: true +``` +VRIsExclusive: boolean ``` +Returns true. + ### VRClosesNonExclusive -``` lua -VRClosesNonExclusive: true +``` +VRClosesNonExclusive: boolean ``` +Returns true. + ## Events ### StateChanged -``` lua +``` StateChanged(isNowOpen: boolean): BindableEvent ``` @@ -90,7 +97,7 @@ Fires after the inventory is opened or closed. ### BackpackEmpty -``` lua +``` BackpackEmpty(): BindableEvent ``` @@ -98,7 +105,7 @@ Fires when the backpack becomes empty. ### BackpackItemAdded -``` lua +``` BackpackItemAdded(): BindableEvent ``` @@ -106,7 +113,7 @@ Fires when an item is added to the backpack. ### BackpackItemRemoved -``` lua +``` BackpackItemRemoved(): BindableEvent ``` From bc305906355572e5a78edf8ca7e18681fe28ad42 Mon Sep 17 00:00:00 2001 From: Ryan Luu Date: Thu, 4 Dec 2025 15:52:06 -0800 Subject: [PATCH 10/10] Remove unused Players service from API reference Removed unused Players service from the example. Signed-off-by: Ryan Luu --- docs/api-reference.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/api-reference.md b/docs/api-reference.md index 81dd34e..85aa25b 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -2,7 +2,6 @@ Purse unlocks APIs for the CoreGui backpack which were previously locked to othe ``` lua title="LocalScript - Inventory Toggle Button" linenums="1" local ReplicatedStorage = game:GetService("ReplicatedStorage") -local Players = game:GetService("Players") local Purse = require(ReplicatedStorage.Purse) @@ -121,4 +120,4 @@ Fires when an item is removed from the backpack. [BindableEvent]: https://create.roblox.com/docs/reference/engine/classes/BindableEvent [boolean]: https://create.roblox.com/docs/luau/booleans - [string]: https://create.roblox.com/docs/luau/strings \ No newline at end of file + [string]: https://create.roblox.com/docs/luau/strings