Skip to content

Commit

Permalink
docs: Updates user docs to reflect new features introduced in 0.9.0 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
misterpotts authored Sep 13, 2023
1 parent 8544304 commit 3ada661
Show file tree
Hide file tree
Showing 21 changed files with 64 additions and 39 deletions.
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title: Fabricate 0.9.9
title: Fabricate 0.9.10
email: [email protected]
description: >-
End user documentation for the Foundry Virtual Tabletop (VTT) Module, "Fabricate".
Expand Down
7 changes: 6 additions & 1 deletion docs/components/editing.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ Then, click the "Edit" button.
This will open the component editor.
Once here, you can drag and drop components from the available components in the right column, to the salvage option on the left.

You can add other components as salvage results, or catalysts.
Catalysts are components that are required to salvage the component, but are not consumed during the process.
For example, a "Forge" might be required to salvage a "Broken Sword", but the forge is not consumed in the process.
Salvage results are the components that are produced by salvaging the component.

Dragging another of the same component will **increase** the quantity.
However, the quickest way to do that is to left-click a component already present in the salvage option.
You can **reduce** the quantity of components and remove them from salvage by right-clicking (or shift-clicking) them.
Expand All @@ -52,7 +57,7 @@ You can **reduce** the quantity of components and remove them from salvage by ri
You can specify multiple options for component salvage.
This will provide players with a choice when salvaging the component.

To add anew option, simply click "New" next to the current option.
To add a new option, simply click "New" next to the current option.
Then, drag and drop a component into the drop zone to create an additional salvage option.
You can edit this option in the same way as others.
You can rename options, changing the text that is displayed to players when choosing between them.
Expand Down
Binary file modified docs/img/adding-component-salvage.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/img/adding-recipe-requirements-and-results.gif
Binary file not shown.
Binary file added docs/img/adding-recipe-requirements.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/adding-recipe-results.gif
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 docs/img/craft-a-recipe.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/img/manage-recipe-essences.gif
Binary file not shown.
Binary file modified docs/img/multiple-component-salvage-options.gif
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 docs/img/multiple-recipe-options.gif
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 docs/img/salvage-a-component.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 34 additions & 17 deletions docs/recipes/editing.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,21 @@ Fabricate will add the recipe to the crafting system and display a notification

![](/fabricate/img/adding-recipes.gif)

## Adding recipe ingredients, catalysts and results
## Adding recipe requirement options

A recipe needs results to produce something when crafted.
Most simple recipes require a specific set of ingredients, and may also require catalysts to be present.
Most recipes require a specific set of components to be present in the actor's inventory in order to be crafted.
The simplest (and often best) recipes have only one requirement option, but you can add multiple requirement options to a recipe.
If a recipe has multiple requirement options, the player will be able to choose which option they want to use when crafting.

A requirement option can specify up to three things it needs to be present in the actor's inventory in order to be used:

- **Ingredients:** These are [components](/fabricate/components) that are consumed when the recipe is crafted.
- **Catalysts:** These are [components](/fabricate/components) that are required to craft the recipe, but are not consumed during the process.
- **Essences**: These are the [essences](/fabricate/essences) that are required to craft the recipe from amongst other ingredients, in addition to any catalysts and specific ingredients.
They maybe sourced from any components in the actor's inventory that contain the required essences.

Most simple recipes only require ingredients.
However, a recipe requirement option may have only essences, catalysts or ingredients, or any combination of the three.

To add these to your recipe, find the recipe in the recipe browser.
Then, click the "Edit" button.
Expand All @@ -46,29 +57,35 @@ Dragging another of the same component will **increase** the quantity.
However, the quickest way to do that is to left-click a component already present in the salvage option.
You can **reduce** the quantity of components and remove them from requirements by right-clicking (or shift-clicking) them.

To manage results, simply switch to the results tab and do the same.
You can add and remove your crafting system's [essences](/fabricate/essences) from a recipe requirement option easily.
Use the "+" (plus) and "-" (minus) buttons to the left and right of each essence name to increment or decrement the quantity required by the recipe.

![](/fabricate/img/adding-recipe-requirements.gif)

## Adding recipe result options

A recipe needs results to produce something when crafted.
The simplest (and often best) recipes have only one result option, but you can add multiple result options to a recipe.
If a recipe has multiple result options, the player will be able to choose which result they want when crafting.

A result option specifies only the components that are produced when the recipe is crafted.

![](/fabricate/img/adding-recipe-requirements-and-results.gif)
To add these to your recipe, find the recipe in the recipe browser.
Then, click the "Edit" button.
This will open the recipe editor.
Just switch to the "Results" tab, and edit the result options the same way you would modify the recipe requirements.

![](/fabricate/img/adding-recipe-results.gif)

## Multiple requirement and result options

You can specify multiple options for recipe requirements, as well as results.
This will provide players with a choice when salvaging the component.

To add anew option for either requirements or results, simply click "New" next to the current option.
To add a new option for either requirements or results, simply click "New" next to the current option.
Then, drag and drop a component into the drop zone to create an additional option.
You can edit this option in the same way as others.
You can rename options, changing the text that is displayed to players when choosing between them.
Additionally, you can remove an option by clicking "Delete" to the right of the option name.

![](/fabricate/img/multiple-recipe-options.gif)

## Manage recipe essences

You can add and remove your crafting system's [essences](/fabricate/essences) from a recipe's requirements easily.
Just open up the recipe editor and scroll down to the "Essences" section.
Use the "+" (plus) and "-" (minus) buttons to the left and right of each essence name to increment or decrement the quantity required by the recipe.
These essences are required in addition to any catalysts and specific ingredients.
However, they maybe sourced from any components in the actor's inventory.

![](/fabricate/img/manage-recipe-essences.gif)
![](/fabricate/img/multiple-recipe-options.gif)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fabricate",
"version": "0.9.9",
"version": "0.9.10",
"description": "A system-agnostic, flexible crafting module for FoundryVT",
"main": "index.js",
"type": "module",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DefaultComponentSalvageAppFactory implements ComponentSalvageAppFactory {
id: appId,
resizable: false,
width: 540,
height: 514
height: 620
};

const componentSalvageManager = new DefaultComponentSalvageManager({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
async function incrementEssence(essence, requirementOption) {
requirementOption.addEssence(essence.id);
$selectedRecipe.saveRequirementOption(requirementOption)
$selectedRecipe.setRequirementOption(requirementOption)
await recipeEditor.saveRecipe($selectedRecipe);
}
Expand All @@ -85,7 +85,7 @@
await deleteRequirementOption(requirementOption);
return;
}
$selectedRecipe.saveRequirementOption(requirementOption);
$selectedRecipe.setRequirementOption(requirementOption);
await recipeEditor.saveRecipe($selectedRecipe);
}
Expand Down Expand Up @@ -143,7 +143,7 @@
} else {
resultOption.addIngredient(component.id);
}
$selectedRecipe.setResultOption(resultOption);
$selectedRecipe.setRequirementOption(resultOption);
await recipeEditor.saveRecipe($selectedRecipe);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
export let craftingAttempt;
function selectNextOption() {
dispatch("nextRequirementOptionSelected", {});
dispatch("nextOptionSelected", {});
}
function selectPreviousOption() {
dispatch("previousRequirementOptionSelected", {});
dispatch("previousOptionSelected", {});
}
</script>
Expand All @@ -32,9 +32,9 @@
</div>
<div class="fab-component-grid-wrapper">
<CraftingAttemptGrid columns={columns}
ingredients={craftingAttempt.ingredients}
catalysts={craftingAttempt.catalysts}
essences={craftingAttempt.essences} />
ingredients={craftingAttempt.selectedComponents.ingredients}
catalysts={craftingAttempt.selectedComponents.catalysts}
essences={craftingAttempt.selectedComponents.essences} />
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
export let craftingAttempt;
function selectNextOption() {
dispatch("nextResultOptionSelected", {});
dispatch("nextOptionSelected", {});
}
function selectPreviousOption() {
dispatch("previousResultOptionSelected", {});
dispatch("previousOptionSelected", {});
}
</script>
Expand Down
8 changes: 4 additions & 4 deletions src/applications/recipeCraftingApp/RecipeCraftingApp.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@
{#if recipeCraftingManager.hasRequirementChoices}
<CraftingAttemptCarousel columns={3}
craftingAttempt={craftingAttempt}
on:nextIngredientOptionSelected={selectNextRequirementOption()}
on:previousIngredientOptionSelected={selectPreviousRequirementOption()} />
on:nextOptionSelected={selectNextRequirementOption}
on:previousOptionSelected={selectPreviousRequirementOption} />
{:else}
<div class="fab-component-grid-wrapper">
<CraftingAttemptGrid
Expand All @@ -133,8 +133,8 @@
{#if recipeCraftingManager.hasResultChoices}
<CraftingResultCarousel columns={3}
craftingAttempt={craftingAttempt}
on:nextResultOptionSelected={selectNextResultOption()}
on:previousResultOptionSelected={selectPreviousResultOption()}>
on:nextOptionSelected={selectNextResultOption}
on:previousOptionSelected={selectPreviousResultOption}>
<h3 slot="description">{localization.localize(`${Properties.module.id}.typeNames.result.plural`)}</h3>
</CraftingResultCarousel>
{:else}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DefaultRecipeCraftingAppFactory implements RecipeCraftingAppFactory {
id: appId,
resizable: false,
width: 680,
height: 620
height: 720
}

const allCraftingSystemComponentsById = await this._componentAPI.getAllByCraftingSystemId(recipe.craftingSystemId);
Expand Down
2 changes: 1 addition & 1 deletion src/public/module.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "fabricate",
"title": "Fabricate",
"version": "0.9.9",
"version": "0.9.10",
"description": "A system-agnostic, flexible crafting module for FoundryVTT",
"authors": [
{
Expand Down
7 changes: 5 additions & 2 deletions src/scripts/api/CraftingAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -816,13 +816,16 @@ class DefaultCraftingAPI implements CraftingAPI {
});
}

await Promise.all(includedEssences.map(essence => essence.load()));
const essencesToLoad = await Promise.all(includedEssences
.filter(essence => essence.hasActiveEffectSource)
.map(essence => essence.load()));

const essencesWithErrors = includedEssences.filter(essence => essence.activeEffectSource.hasErrors);
const essencesWithErrors = essencesToLoad.filter(essence => essence.activeEffectSource.hasErrors);
if (essencesWithErrors.length > 0) {
const message = this.localizationService.format(
`${DefaultCraftingAPI._LOCALIZATION_PATH}.recipe.invalidEssenceItemData`,
{
recipeName: recipe.name,
essenceIds: essencesWithErrors.map(essence => essence.id).join(", ")
}
);
Expand Down

0 comments on commit 3ada661

Please sign in to comment.