Skip to content

Commit

Permalink
Merge branch 'main' into topbar-plus
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanLua committed Jun 18, 2024
2 parents a9de920 + f7c1a76 commit a81efdc
Show file tree
Hide file tree
Showing 46 changed files with 339 additions and 196 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[*.lua]
[*.luau]
indent_style = tab
indent_size = 4
charset = utf-8
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ on:
paths-ignore:
- "**"
- "!.github/workflows/ci.ya?ml"
- "!**.lua"
- "!**.luau"

push:
paths-ignore:
- "**"
- "!.github/workflows/ci.ya?ml"
- "!**.lua"
- "!**.luau"

permissions:
contents: read
Expand Down
3 changes: 2 additions & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"MD013": false,
"MD024": false,
"MD033": false,
"MD041": false
"MD041": false,
"MD046": false
}
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"yaml.schemas": {
"https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yml"
},
"yaml.customTags": [
"!ENV scalar",
"!ENV sequence",
"!relative scalar",
"tag:yaml.org,2002:python/name:material.extensions.emoji.to_svg",
"tag:yaml.org,2002:python/name:material.extensions.emoji.twemoji",
"tag:yaml.org,2002:python/name:pymdownx.superfences.fence_code_format"
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
[![GitHub license](https://img.shields.io/github/license/RyanLua/Satchel?logo=mozilla&color=00a2ff&style=for-the-badge)](LICENSE.txt)
[![Discord](https://img.shields.io/discord/1162303282002272359?style=for-the-badge&label=discord&logo=discord&color=00a2ff&logoColor=white)](https://discord.gg/hYU4rvT7DK)

[![Download](https://gist.githubusercontent.com/RyanLua/d507e8ad7581fe264deb91606954b920/raw/8013a784d7518ddd465512d31f4f51e18d35c06c/GitHubDownloadBadge.svg)](https://github.com/RyanLua/Satchel/releases/latest/download/Satchel.rbxm)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/RyanLua/Satchel?quickstart=1)

</div>

Satchel is a modern open-source alternative to Roblox's default backpack. Satchel aims to be more customizable and easier to use than the default backpack while still having a "vanilla" feel. Installation of Satchel is as simple as dropping the module into your game and setting up a few properties if you like to customize it. It has a familiar feel and structure as to the default backpack for ease of use for both developers and players.
Expand Down
Binary file modified assets/CreatorMarketplace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/GitHubReleases.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/InsertFromFile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/MarketplaceCard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/PlayStationThumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/SatchelIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/SatchelIconSquare.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/SatchelThumbnail1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/SatchelThumbnail2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/SatchelThumbnail3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/SatchelThumbnail4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/SelectFile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/XboxThumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion default.project.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Satchel",
"globIgnorePaths": ["**/*.spec.lua"],
"globIgnorePaths": ["**/*.spec.luau"],
"tree": {
"$path": "src"
}
Expand Down
5 changes: 0 additions & 5 deletions docs/alternatives.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
title: Alternatives
description: Alternatives to Satchel along with pros and cons.
icon: material/card-multiple-outline
comments: true
tags:
- Others
- Comparison
- Third-party
---

Satchel isn't the best backpack system out there or the only one but it does offer some advantages against others. Some free and open-souce alternaves of Satchel.
Expand Down
156 changes: 146 additions & 10 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,56 @@
title: API Reference
description: Satchel is a reskin of the default BackpackGui. Satchel acts very similar to the default backpack and is based on a fork on the default backpack.
icon: material/book-outline
comments: true
tags:
- API
- Summary
- Documentation
---

<style>
.md-typeset__table {
width: 100%;
}

.md-typeset__table table:not([class]) {
display: table
}
</style>

Satchel is a reskin of the default BackpackGui located in [CoreGui](https://create.roblox.com/docs/reference/engine/classes/CoreGui). Satchel acts very similar to the default backpack and is based on a fork on the default backpack. Behaviors between the two should remain the same with both of them managing the [Backpack](https://create.roblox.com/docs/reference/engine/classes/Backpack).

#### Code Samples

This code sample makes a TextButton that toggles the inventory when clicked.

```lua title="Toggle Satchel" linenums="1"
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Satchel = require(ReplicatedStorage:WaitForChild("Satchel"))

local button = Instance.new("TextButton")
button.AnchorPoint = Vector2.new(0.5, 0.5)
button.Position = UDim2.new(0.5, 0, 0.5, 0)
button.Text = "Toggle Inventory"
button.MouseButton1Click:Connect(function()
if Satchel:GetBackpackEnabled() then
Satchel.SetBackpackEnabled(false)
else
Satchel.SetBackpackEnabled(true)
end
end)
```

This code sample detects when the inventory is opened or closed.

```lua title="Detect Inventory State" linenums="1"
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Satchel = require(ReplicatedStorage:WaitForChild("Satchel"))

Satchel.GetStateChangedEvent():Connect(function(isOpened: boolean)
if isOpened then
print("Inventory opened")
else
print("Inventory closed")
end
end)
```

## Summary

### Attributes
Expand Down Expand Up @@ -52,26 +93,38 @@ Satchel is a reskin of the default BackpackGui located in [CoreGui](https://crea

### BackgroundColor3

[`Color3`](https://create.roblox.com/docs/reference/engine/datatypes/Color3)

Determines the background color of the default inventory window and slots. Changing this will update the background color for all elements excluding the search box background for visibility purposes.

### BackgroundTransparency

[`number`](https://create.roblox.com/docs/luau/numbers)

Determines the background transparency of the default inventory window and slots. This will change how the hot bar looks in its locked state and the inventory background.

### CornerRadius

[`UDim`](https://create.roblox.com/docs/reference/engine/datatypes/UDim)

Determines the radius, in pixels, of the default inventory window and slots. This will affect all elements with a visible rounded corner. The corner radius for the search bar is calculated automatically based on this value.

### EquipBorderColor3

[`Color3`](https://create.roblox.com/docs/reference/engine/datatypes/Color3)

Determines the color of the equip border when a slot is equipped. The drag outline color of the slot will not changed by this.

### EquipBorderSizePixel

[`number`](https://create.roblox.com/docs/luau/numbers)

Determines the pixel width of the equip border when a slot is equipped. This additionally controls the padding of tool icons.

### FontFace

[`Enum.Font`](https://create.roblox.com/docs/reference/engine/enums/Font)

Determines the font of the default inventory window and slots. This includes all text in the Satchel UI.

!!! bug
Expand All @@ -80,26 +133,38 @@ Determines the font of the default inventory window and slots. This includes all

### InsetIconPadding

[`bool`](https://create.roblox.com/docs/luau/booleans)

Determines whether or not the tool icon is padded in the default inventory window and slots. Changing this will change how the tool icon is padded in the slot or not.

### OutlineEquipBorder

[`bool`](https://create.roblox.com/docs/luau/booleans)

Determines whether or not the equip border is outline or inset when a slot is equipped. Changing this will make the equip border either border will outline or inset the slot.

### TextColor3

[`Color3`](https://create.roblox.com/docs/reference/engine/datatypes/Color3)

Determines the color of the text in default inventory window and slots. This will change the color of all text.

### TextSize

[`number`](https://create.roblox.com/docs/luau/numbers)

Determines the size of the text in the default inventory window and slots. This will change the text size of the tool names and will not change other text like search text, hotkey number, and gamepad hints.

### TextStrokeColor3

[`Color3`](https://create.roblox.com/docs/reference/engine/datatypes/Color3)

Determines the color of the text stroke of text in default inventory window and slots. This will change the color of all text strokes which are visible.

### TextStrokeTransparency

[`number`](https://create.roblox.com/docs/luau/numbers)

Determines the transparency of the text stroke of text in default chat window and slots. This will change all text strokes in which text strokes are visible.

## Methods
Expand All @@ -108,34 +173,105 @@ Determines the transparency of the text stroke of text in default chat window an

Returns whether the inventory is opened or not.

#### Code Samples

This code sample will return whether the inventory is opened or not.

```lua title="Is Opened" linenums="1"
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Satchel = require(ReplicatedStorage:WaitForChild("Satchel"))

local isOpened = Satchel.IsOpened()
```

#### Returns

```boolean```
<table>
<tr>
<td><a href="https://create.roblox.com/docs/luau/booleans">bool</a></td>
</tr>
</table>

### SetBackpackEnabled

Sets whether the backpack gui is enabled or disabled.

#### Code Samples

This code sample will disable the backpack gui.

```lua title="Disable Backpack" linenums="1"
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Satchel = require(ReplicatedStorage:WaitForChild("Satchel"))

Satchel.SetBackpackEnabled(false)
```

#### Parameters

```enabled: boolean```
<table>
<tr>
<td>enabled: <a href="https://create.roblox.com/docs/luau/booleans">bool</a></td>
<td>Whether to enable or disable the Backpack</td>
</tr>
</table>

#### Returns

```void```
<table>
<tr>
<td>void</td>
</tr>
</table>

### GetBackpackEnabled

Returns whether the backpack gui is enabled or disabled.

#### Code Samples

This code sample will return whether the backpack gui is enabled or disabled.

```lua title="Get Backpack Enabled" linenums="1"
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Satchel = require(ReplicatedStorage:WaitForChild("Satchel"))

local isEnabled = Satchel.GetBackpackEnabled()
```

#### Returns

```boolean```
<table>
<tr>
<td><a href="https://create.roblox.com/docs/luau/booleans">bool</a></td>
</tr>
</table>

### GetStateChangedEvent

Returns a signal that fires when the inventory is opened or closed.

#### Code Samples

This code sample detects when the inventory is opened or closed.

```lua title="Detect Inventory State" linenums="1"
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Satchel = require(ReplicatedStorage:WaitForChild("Satchel"))

Satchel.GetStateChangedEvent():Connect(function(isOpened: boolean)
if isOpened then
print("Inventory opened")
else
print("Inventory closed")
end
end)
```

#### Returns

```RBXScriptSignal```
<table>
<tr>
<td><a href="https://create.roblox.com/docs/reference/engine/datatypes/RBXScriptSignal">RBXScriptSignal</a></td>
</tr>
</table>
24 changes: 24 additions & 0 deletions docs/app.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "Satchel Documentation",
"short_name": "Satchel",
"icons": [
{
"src": "/icons/512.png",
"type": "image/png",
"sizes": "512x512"
},
{
"src": "/icons/512-maskable.png",
"type": "image/png",
"sizes": "512x512",
"purpose": "maskable"
}
],
"start_url": "/",
"display": "standalone",
"theme_color": "#00a2ff",
"background_color": "#00a2ff",
"lang": "en",
"description": "Documentation for Satchel, a modern open-source alternative to Roblox's default backpack",
"categories": ["utilities", "reference", "developer"]
}
1 change: 1 addition & 0 deletions docs/assets/satchel-black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/assets/satchel-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 0 additions & 5 deletions docs/benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
title: Benchmarks
description: Satchel benchmarks on performance and speed.
icon: material/speedometer
comments: true
tags:
- Tests
- Speed
- Performance
---

Built for speed, optimized scripting allows Satchel to be blazingly fast. As faster or even faster than the default speed.
Expand Down
Loading

0 comments on commit a81efdc

Please sign in to comment.