You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Guide.md
+22-14Lines changed: 22 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,7 +106,7 @@ Both of the above would remove 10 items with the ID `"wood"` and 5 items with th
106
106
> [!TIP]
107
107
> If the inventory doesn't contain an item it's asked to drop, nothing happens. No errors will be thrown, and the items that are present in the command, if any, will be removed as normal. Please be careful as this may hide some bugs.
108
108
109
-
You can also remove all of the items in one inventory from another inventory by <em>**un**merging</em> the latter drom the former. Like merging, unmerging does not affect the giving inventory, if you want to remove the items from one inventory and add them to another, see [transfers](#transfers) below.
109
+
You can also remove all of the items in one inventory from another inventory by <em>**un**merging</em> the latter from the former. Like merging, unmerging does not affect the giving inventory, if you want to remove the items from one inventory and add them to another, see [transfers](#transfers) below.
110
110
111
111
```
112
112
<<newinv _stolenItems>>
@@ -282,7 +282,15 @@ Want to add an option to drop all items? And how about a way to inspect the item
282
282
283
283

284
284
285
-
You may also provide the flag`stack` to allow players to drop/transfer entire stacks of items all at once:
285
+
There is also a built-in search/filter UI element you can add with the `filter` flag. This will allow players to type to filter the inventory.
286
+
287
+
```
288
+
<<inv $backpack use drop inspect all filter>>
289
+
```
290
+
291
+

292
+
293
+
You may also provide the flag `stack` to allow players to drop/transfer entire stacks of items all at once:
286
294
287
295
```
288
296
<<inv $backpack use drop inspect stack all>>
@@ -317,23 +325,23 @@ You can change the default strings used by the built-in interfaces, for example,
317
325
318
326
The strings that can be changed in the special passage are as follows:
319
327
320
-
-`inspect`: **not used** in the default interface, since the user clicks on the names of items to see their descriptions, however, a link for inspecting items may be needed in the future or by users. Default: `"Inspect"`
321
-
-`drop`: appears as link text when users can drop items in the interface. Default: `"Drop"`
322
-
-`take`: can appear as link text when users can transfer items in the interface. Default: `"Take"`
323
-
-`give`: can appear as link text when users can transfer items in the interface. Default: `"Give"`
324
-
-`use`: link text for the action allowing consumables to be used. Default: `"Use"`
325
-
-`stack`: the text used to refer to an item stack when dropping or transferring whole stacks in the default interface. Default: `"stack"`
326
-
-`stackPre`: string appears before the item stack counts. Default: `" × "` (that is, × )
327
-
-`stackPost`: string appears after the item stack counts. Default: `" "`
328
-
-`empty`: this string appears when an empty inventory is displayed. In the API, this is handled by a separate property, `Inventory.emptyMessage`, passing this value to `Inventory.strings` won't have any effect! Default: `"…"`
328
+
-`inspect`: **not used** in the default interface, since the user clicks on the names of items to see their descriptions, however, a link for inspecting items may be needed in the future or by users. Default: `Inspect`
329
+
-`drop`: appears as link text when users can drop items in the interface. Default: `Drop`
330
+
-`take`: can appear as link text when users can transfer items in the interface. Default: `Take`
331
+
-`give`: can appear as link text when users can transfer items in the interface. Default: `Give`
332
+
-`use`: link text for the action allowing consumables to be used. Default: `Use`
333
+
-`stack`: the text used to refer to an item stack when dropping or transferring whole stacks in the default interface. Default: `stack`
334
+
-`stackPre`: string appears before the item stack counts. Default: ` × ` (that is, × )
335
+
-`stackPost`: string appears after the item stack counts. Default: ` `
336
+
-`empty`: this string appears when an empty inventory is displayed. In the API, this is handled by a separate property, `Inventory.emptyMessage`, passing this value to `Inventory.strings` won't have any effect! Default: `…`
329
337
330
338
For example, an `inventory.strings` special passage may look like this:
331
339
332
340
```
333
341
:: inventory.strings
334
-
use: "Activate"
335
-
take: "Swipe"
336
-
empty: "The inventory is empty!"
342
+
use: Activate
343
+
take: Swipe
344
+
empty: The inventory is empty!
337
345
```
338
346
339
347
To do the same thing with the API, the JavaScript code would look like this:
Copy file name to clipboardExpand all lines: docs/Macros.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -205,6 +205,7 @@ These macros can be used to show the default user-interface components for manag
205
205
-`use` allows the player to "use" an item if it is considered a consumable, and using it will expend one of the items and cause it's use code, if any, to be run. Refer to the `<<item>>` macro below.
206
206
-`stack` shows a "Drop/Give/Take stack" option at the end of each item listing with more than 1 item in it.
207
207
-`all` shows a "Drop/Give/Take all" option at the bottom of the inventory list.
208
+
-`filter` shows filter/search box for players to filter their inventories with.
208
209
209
210
#### Examples
210
211
@@ -226,6 +227,12 @@ These macros can be used to show the default user-interface components for manag
226
227
227
228

Copy file name to clipboardExpand all lines: docs/README.md
+14-16Lines changed: 14 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
# Simple Inventory 3
2
2
3
-
> [!NOTE]
4
-
> Simple Inventory v3 is in beta right now. It should work, but there may be bugs and rough edges. Please [report any issues](https://github.com/ChapelR/simple-inventory/issues/new) you encounter!
3
+
The new simple inventory system. No longer a part of [my macro collection](https://macros.twinelab.net/), it's now its own thing. If you need the old version, grab [an older release (v2.10.0 or lower) of my custom macro collection](https://github.com/ChapelR/custom-macros-for-sugarcube-2/releases). If you find any bugs or have any issues, please [let me know](https://github.com/ChapelR/simple-inventory/issues/new)!
5
4
6
-
The new version of my simple inventory system. No longer a part of [my macro collection](https://macros.twinelab.net/), it's now its own thing. If you need the old version, grab [an older release (v2.10.0 or lower) of my custom macro collection](https://github.com/ChapelR/custom-macros-for-sugarcube-2/releases).
5
+
> [!TIP]
6
+
> New to Simple Inventory? Start with the [guide](Guide.md) and [recipes](Recipes.md) to see what the system is capable of!
Version 3 includes most of the features and functionality of v2, and adds:
24
-
25
-
- Consumables. Items can be associated with SugarCube code (sort of like a widget) or a callback function that can be executed when the item is "used."
26
-
- Item descriptions (as dialogs).
27
-
- Item names. You can provide items with both names and IDs, using the ID in code while the name will be used for displaying it in the game.
28
-
- Item and inventory tags. You can add tags to items and inventories as metadata.
29
-
- Item stacking. Duplicate items in an inventory can now *stack* meaning they'll take up one visual "slot" in the inventory, but will have a counter showing how many are present.
30
-
- More robust built-in UI options and components.
31
-
- A cleaned up, mostly simplified API and code structure.
32
-
33
-
Most new features are optional; you don't have to define items, for example. With the exception of stacking, it's possible to use this inventory in almost exactly the same way as v2.
34
-
35
-
This new simple inventory is totally incompatible with previous versions. Updating will require rewrites, so you may want to stick with v2 in ongoing projects.
23
+
Features:
24
+
- Support for an arbitrary number of inventories, so they can be used as player inventories, chests, rooms, NPC inventories, etc.
25
+
- Simple interfaces for complex operations, like inventory transfers, merges, and comparisons.
26
+
- Items can optionally be predefined, but you may also just use bare strings for ultimate simplicity.
27
+
- Premade logic for unique and un-tradeable items.
28
+
- Built-in support for "consumables" like potions, which can be paired with a code "handler" for easy item creation.
29
+
- Duplicate items in a given inventory "stack" automatically.
30
+
- A suite of customizable UI components for displaying and allowing users to manage inventories easily.
31
+
- Text search/filter system built-in as an optional UI component.
32
+
33
+
Most features are optional; you don't have to define items, for example. With the exception of stacking, it's possible to use this inventory in almost exactly the same way as v2. Note that this new simple inventory is totally incompatible with previous versions. Updating will require code rewrites, so you may want to stick with v2 in ongoing projects.
0 commit comments