Skip to content

Conversation

@shmakota
Copy link
Collaborator

@shmakota shmakota commented Aug 9, 2025

Purpose of change (The Why)

Player QOL. The crafting menu can be annoying to navigate and find recipes quickly. This helps to group them more finely than just armor/foods/etc.

Describe the solution (The How)

ports change CleverRaven/Cataclysm-DDA#59924 to begin allowing nested crafting categories.

This means we can now define a nested_category, which will display in the recipe selection screen, and once selected will transfer you to the NESTED tab with a selection of everything from that nested category.

Describe alternatives you've considered

porting DDA change CleverRaven/Cataclysm-DDA#60761. This seems to be out of my skill level, as it has a bunch of prerequisite PR's that I don't know how to properly sift through and apply. (I have attempted though, to no success)

Additionally, to improve the quality of life, we could port CleverRaven/Cataclysm-DDA#60378, CleverRaven/Cataclysm-DDA#60683. Note that a large portion of the code changes made in these PRs are ripped out for 60701, so if we could just jump ahead and implement that, it would save a lot of time & effort.

Testing

Created a nested_category "sandwiches" and moved the sandwich recipes under this new category. Loaded in and attempted to craft a recipe from the nested sandwiches category successfully.

Additional context

Before merging, we need to fix the issue that nested categories display a lot of useless, irrelevant information about the item that was previously displayed. I think this may have been tackled in the original PR, and I just don't have it implemented properly?

It does seem weird to have to move these recipes out of the main list, but I think will make more sense once we get a majority of relevant items converted into nested categories.

Example nested category: (intended to be put into a new file, nested.json or a similar name for organization)

[
  {
    "id": "nested_example",
    "//": "this is an example of how a nested category should be defined",
    "type": "nested_category",
    "category": "CC_FOOD",
    "subcategory": "CSC_FOOD_OTHER",
    "nested_name": "example sandwiches",
    "description": "Recipes related to constructing example sandwiches.",
    "skill_used": "fabrication",
    "nested_category_data": [
      "sandwich_t",
      "sandwich_pb",
      "sandwich_pbj",
      "sandwich_pbh",
      "sandwich_pbm",
      "sandwich_deluxe",
      "sandwich_deluxe_nocheese",
      "fish_sandwich",
      "sandwich_veggy"
    ],
    "difficulty": 0,
    "autolearn": true
  }
]

Additionally, each of these items needs to be moved from subcategory CSC_FOOD_VEGGI to CSC_*_NESTED.

 {
    "type": "recipe",
    "result": "sandwich_pb",
    - "category": "CC_FOOD",
    - "subcategory": "CSC_FOOD_VEGGI",
    + "category": "CC_*",
    + "subcategory": "CSC_*_NESTED",
    "skill_used": "cooking",
    "time": "1 m",
    "autolearn": true,
    "components": [ [ [ "bread_sandwich", 2, "LIST" ] ], [ [ "peanutbutter", 1 ], [ "peanutbutter_imitation", 1 ] ] ]
},
📸 Screenshots image image

Checklist

Mandatory

Optional

  • This PR ports commits from DDA or other cataclysm forks.
    • I have attributed original authors in the commit messages adding Co-Authored-By in the commit message.
    • I have linked the URL of original PR(s) in the description.
  • This is a C++ PR that modifies JSON loading or behavior.
    • I have documented the changes in the appropriate location in the doc/ folder.
    • If documentation for this feature does not exist, please write it or at least note its lack in PR description.
    • New localizable fields need to be added to the lang/bn_extract_json_strings.sh script if it does not support them yet.
    • If applicable, add checks on game load that would validate the loaded data.
    • If it modifies format of save files, please add migration from the old format.

ports change CleverRaven/Cataclysm-DDA#59924
needs refined

Co-Authored-By: Dillon Matchett <[email protected]>
@github-actions github-actions bot added src changes related to source code. JSON related to game datas in JSON format. labels Aug 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JSON related to game datas in JSON format. src changes related to source code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant