Skip to content

Commit

Permalink
Fixes crafting menu (#3787)
Browse files Browse the repository at this point in the history
* Fixing crafting menu [wip]

* This needs to have a reqs apparently

Co-authored-by: Bloop <[email protected]>
  • Loading branch information
Steals-The-PRs and vinylspiders authored Jun 12, 2024
1 parent 57df0ee commit b4fda27
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
1 change: 1 addition & 0 deletions modular_nova/modules/tribal_extended/code/recipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@

/datum/crafting_recipe/torch
name = "Torch"
reqs = list(/obj/item/grown/log = 1)
result = /obj/item/flashlight/flare/torch
category = CAT_MISC
non_craftable = TRUE
Expand Down
28 changes: 18 additions & 10 deletions tgui/packages/tgui/interfaces/PersonalCrafting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,23 @@ const MaterialContent = (props) => {

const FoodtypeContent = (props) => {
const { type, diet, craftableCount } = props;
let iconName = '',
iconColor = '';

// We use iconName in the return to see if this went through.
if (type !== 'Can Make' && diet) {
if (diet.liked_food.includes(type)) {
iconName = 'face-laugh-beam';
iconColor = 'good';
} else if (diet.disliked_food.includes(type)) {
iconName = 'face-tired';
iconColor = 'average';
} else if (diet.toxic_food.includes(type)) {
iconName = 'skull-crossbones';
iconColor = 'bad';
}
}

return (
<Stack>
<Stack.Item width="14px" textAlign="center">
Expand All @@ -606,16 +623,7 @@ const FoodtypeContent = (props) => {
<Stack.Item>
{type === 'Can Make'
? craftableCount
: diet &&
(diet.liked_food.includes(type) ? (
<Icon name="face-laugh-beam" color={'good'} />
) : diet.disliked_food.includes(type) ? (
<Icon name="face-tired" color={'average'} />
) : (
diet.toxic_food.includes(type) && (
<Icon name="skull-crossbones" color={'bad'} />
)
))}
: iconName && <Icon name={iconName} color={iconColor} />}
</Stack.Item>
</Stack>
);
Expand Down

0 comments on commit b4fda27

Please sign in to comment.