{"id":"upliftgames/satchel","name":"satchel","scope":"upliftgames","platform":"roblox","description":"A modern open-source alternative to Roblox's default backpack.","version":"1.8.0","latest":"1.8.0","versions":["1.5.0","1.5.1","1.6.0","1.7.0","1.7.1","1.8.0"],"license":"MPL-2.0","licenseRating":"caution","licenseCaveats":["File-level copyleft: if you modify this package's own source files, those modified files must be made available under MPL-2.0. Using it unmodified in a closed-source game is fine.","The package archive does not include its license text; the license is declared in its manifest metadata."],"licenseVerified":false,"dependencies":{"1foreverhd/topbarplus":{"version":"^3.4.0","alias":"topbarplus"}},"integrity":"d31757456b8e1e2785729e7bfe59ea161d37a9edf86c205dd2f6e317716fcc2f","likes":0,"downloads":0,"install":"forest install upliftgames/satchel","url":"https://forest.dev/p/roblox/upliftgames/satchel","files":"https://api.forest.dev/ai/package/roblox/upliftgames/satchel/files","readme":"<h1 align=\"center\">\r\n  <img src=\"docs/assets/favicon.svg\" width=\"64\">\r\n  <br>\r\n  Satchel\r\n</h1>\r\n\r\n<div align=\"center\">\r\n\r\n  [![CI](https://github.com/ryanlua/satchel/actions/workflows/ci.yml/badge.svg)](https://github.com/ryanlua/satchel/actions/workflows/ci.yml)\r\n  [![GitHub Release](https://img.shields.io/github/v/release/ryanlua/satchel)](https://github.com/ryanlua/satchel/releases)\r\n  [![Docs](https://img.shields.io/badge/docs-website-green)](https://satchel.luau.page/)\r\n  [![Playground](https://img.shields.io/badge/playground-experience-blue)](https://www.roblox.com/join/iedaw)\r\n  [![Discord](https://discord.com/api/guilds/1162303282002272359/widget.png)](https://discord.gg/N2KEnHzrsW)\r\n  [![Mentioned in Awesome Roblox](https://awesome.re/mentioned-badge.svg)](https://github.com/awesome-roblox/awesome-roblox)\r\n\r\n</div>\r\n\r\n> [!WARNING]\r\n> Satchel v1 is unmaintained to focus on v2 development. For a maintained alternative, see [Purse](https://purse.luau.page/).\r\n\r\nSatchel 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.\r\n\r\n<img alt=\"Satchel on computer\" src=\"assets/computer-thumbnail.png\" style=\"width: 49%;\"> <img alt=\"Satchel on computer with inventory open\" src=\"assets/computer-inventory-thumbnail.png\" style=\"width: 49%;\">\r\n<img alt=\"Satchel on mobile\" src=\"assets/phone-thumbnail.png\" style=\"width: 49%;\"> <img alt=\"Satchel on mobile with inventory open\" src=\"assets/phone-inventory-thumbnail.png\" style=\"width: 49%;\">\r\n\r\n<https://github.com/ryanlua/satchel/assets/80087248/2cd3f164-6bf3-4c3b-a682-67a386f576d5>\r\n\r\n## Documentation\r\n\r\nSee the [documentation site](https://satchel.luau.page) for more about Satchel. Find guides on how to get started, learn about the API, understand what Satchel is, and more.\r\n\r\nIf you see anything wrong, open a new [documentation issue](https://github.com/ryanlua/satchel/issues/new?template=documentation_issue.yml).\r\n\r\n## Slot decorator (upliftgames fork)\r\n\r\n`Satchel:SetSlotDecorator(decorator)` lets game code draw the hotbar and inventory slots. Satchel still owns the slot logic: filling and clearing, dragging and reordering, hotkeys, gamepad selection and search.\r\n\r\n```luau\r\nexport type SlotState = {\r\n\tframe: TextButton, -- the slot's frame, mount your visuals in here\r\n\ttool: Tool?, -- nil when the slot is empty\r\n\tisEquipped: boolean,\r\n\tindex: number,\r\n\tisHotbar: boolean,\r\n}\r\n\r\nSatchel:SetSlotDecorator(decorator: ((state: SlotState) -> (() -> ())?)?)\r\n```\r\n\r\n- Satchel calls the decorator whenever a slot's visual state may have changed: equip, unequip, a tool being added or removed, drag/swap/reorder, moving between hotbar and inventory, and changes to the tool's `Name` or its `TextureId`/`Title`/`ToolTip` attributes.\r\n- Calls are keyed to the slot frame, not the tool. Tools move between frames, so redraw from `state` every time and don't cache anything per tool.\r\n- The decorator must not yield. If it errors, Satchel `warn`s with a traceback and the backpack keeps working.\r\n- The decorator can return a cleanup function. Satchel calls it before the next decorate call on the same slot, when the slot frame is destroyed, and when the decorator is replaced.\r\n- While a decorator is set, Satchel hides its own slot background, equip border, tool icon and tool name. The slot number, tooltip, gamepad selection and drag border are still drawn by Satchel.\r\n- Calling `SetSlotDecorator(fn)` decorates every existing slot right away. `SetSlotDecorator(nil)` puts the default visuals back.\r\n\r\n```luau\r\nSatchel:SetSlotDecorator(function(state)\r\n\tlocal backing = Instance.new(\"ImageLabel\")\r\n\tbacking.Size = UDim2.fromScale(1, 1)\r\n\tbacking.BackgroundTransparency = 1\r\n\tbacking.Image = if state.isEquipped then EQUIPPED_BACKING else BACKING\r\n\tbacking.Parent = state.frame\r\n\r\n\treturn function()\r\n\t\tbacking:Destroy()\r\n\tend\r\nend)\r\n```\r\n\r\n## Icon size (upliftgames fork)\r\n\r\n`Satchel:SetIconSize(pixels, bufferPixels)` sets the size of the hotbar and inventory slots in pixels.\r\n\r\n```luau\r\nSatchel:SetIconSize(pixels: number?, bufferPixels: number?)\r\nSatchel:GetIconSize(): (number, number) -- the size and gap in use\r\n```\r\n\r\n- `pixels` is the slot's width and height. `nil` restores the default: 60, or 100 on ten-foot interfaces (console).\r\n- `bufferPixels` is the gap between slots and around the hotbar. By default it scales with the size, from 5px at the default size. For example, 80 gets a 7px gap. Pass a number to fix the gap instead.\r\n- Values are rounded to whole pixels. `pixels` must be at least 1 and `bufferPixels` at least 0. Anything else, including `NaN` and infinity, raises an error.\r\n- The change takes effect straight away, including while the inventory is open. Existing slots are resized and repositioned, and the inventory is laid out again above the hotbar.\r\n- Fitting to the screen: a custom size is reduced, if needed, so the hotbar fits the screen width and the hotbar plus the open inventory fit below the topbar. The hotbar has 10 slots on desktop and 6 on phones. It is re-fitted when the screen changes size, such as a phone rotating. For example, on an 852×393 phone, 80 fits and 100 becomes 84. Use `GetIconSize` to read the size that is actually in use. The default size is never fitted, so it behaves as in 1.7.1.\r\n- The slot decorator is called again after a resize. Size decorator visuals with `Scale`, such as `UDim2.fromScale(1, 1)`, so they fill the slot at any size.\r\n\r\n```luau\r\nSatchel:SetIconSize(80) -- bigger slots with a 7px gap\r\nSatchel:SetIconSize(80, 10) -- bigger slots with a 10px gap\r\nSatchel:SetIconSize(nil) -- back to the default\r\n```\r\n\r\n## Sponsors\r\n\r\nSpecial thanks for our sponsors for supporting Satchel and it's future development. We distribute Satchel and provide updates for free, for anyone to use or modify.\r\n\r\n<br>\r\n\r\n<p align=\"center\">\r\n  <a href=\"https://dobig.com/\" target=_blank>\r\n    <picture>\r\n      <source media=\"(prefers-color-scheme: dark)\" srcset=\"docs/assets/sponsors/do-big-dark.png\" height=\"60\">\r\n      <source media=\"(prefers-color-scheme: light)\" srcset=\"docs/assets/sponsors/do-big-light.png\" height=\"60\">\r\n      <img alt=\"Do Big Studios\" src=\"docs/assets/sponsors/do-big-light.png\" height=\"60\">\r\n    </picture>\r\n    <br>\r\n    Do Big Studios\r\n  </a>\r\n</p>\r\n\r\n<p align=\"center\">\r\n  <br>\r\n  <a href=\"https://github.com/5KFubi\" target=\"_blank\">\r\n    <img src=\"https://github.com/5KFubi.png\" width=\"64\">\r\n    <br>\r\n    5KFubi\r\n  </a>\r\n</p>\r\n\r\n<br>\r\n\r\n[Become a sponsor](https://github.com/sponsors/ryanlua)\r\n\r\n## Contributing\r\n\r\nWe welcome all contributions from the community. See the [contributing guidelines](.github/CONTRIBUTING.md) for details.\r\n\r\n## License\r\n\r\nSatchel is available under the Mozilla Public License 2.0 license. See [LICENSE.md](LICENSE.md) for details.\r\n","readmeTruncated":false}