mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-17 05:56:02 +01:00
better documentation layout
- seperated the 2000+ lines in ReadMe.md into seperate files. - useful if things expand - better readability for users - more organised layout
This commit is contained in:
39
documentation/main_functions/crafting.md
Normal file
39
documentation/main_functions/crafting.md
Normal file
@@ -0,0 +1,39 @@
|
||||
### crafting.lua
|
||||
|
||||
These functions support crafting logic, such as opening crafting menus, handling multi-craft operations, and creating item data from recipes.
|
||||
|
||||
- **craftingMenu(data)**
|
||||
|
||||
- Opens a menu for selecting the quantity to craft.
|
||||
- Presents the player with multiple crafting quantities based on `Config.Crafting.MultiCraftAmounts`.
|
||||
- **Parameters:**
|
||||
- `item` (`string`): The item to craft.
|
||||
- `craft` (`table`): The crafting recipe.
|
||||
- `craftable` (`table`): Crafting options.
|
||||
- `coords` (`vector3`): Where crafting occurs.
|
||||
- `stashName` (`string`): The stash name(s) for item availability.
|
||||
- `onBack` (`function`): Callback when returning.
|
||||
- `metadata` (`table`, optional): Metadata for the crafted item.
|
||||
- **Example:**
|
||||
```lua
|
||||
craftingMenu({
|
||||
craftable = {
|
||||
Header = "Weapon Crafting",
|
||||
Recipes = {
|
||||
[1] = {
|
||||
["weapon_pistol"] = { ["steel"] = 5, ["plastic"] = 2 },
|
||||
amount = 1,
|
||||
},
|
||||
-- More recipes...
|
||||
},
|
||||
Anims = {
|
||||
animDict = "amb@prop_human_parking_meter@male@idle_a",
|
||||
anim = "idle_a",
|
||||
},
|
||||
},
|
||||
coords = vector3(100.0, 200.0, 300.0),
|
||||
stashTable = "crafting_stash",
|
||||
job = "mechanic",
|
||||
onBack = function() print("Returning to previous menu") end,
|
||||
})
|
||||
```
|
||||
Reference in New Issue
Block a user