Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a deconstruct query with item list #74440

Merged
merged 7 commits into from
Jun 13, 2024

Conversation

Procyonae
Copy link
Contributor

@Procyonae Procyonae commented Jun 10, 2024

Summary

Features "Deconstructing now prompts with potential items, can be toggled off in settings"

Purpose of change

Fixes #69848

Describe the solution

After you select a tile to deconstruct it prompts you with the items you can get and requires confirmation to start akin to the disassembly query.
Adds an option to disable this (screenshot of where the option is below)
Changes names/categories of the deconstructions to reflect that they also work on terrain
Updated QUERY_DISASSEMBLY message because it also applies to non butchery "B" disassembly (notably doesn't hook into item -> "D" disassembly though, I'll look into that)

I wanted to write some kind of function akin to Item_group::create() that would walk the group and write a map of itypes and numeric_interval<int>s corresponding to the minimum and maximum number of that item possible to get from the group but that's a bit beyond me today, this still seems like a big improvement on having to solely rely on the json or hhg to know what you can get in advance. Snup helped me figure this out ^^

Describe alternatives you've considered

Not adding the query to simple deconstruct or making the option have 3 values, true, false and complex only
Not adding temporary handling for the number of items instead just always doing "- plural" or "- singular"
Adding a bool to partial_con to determine whether to do turn is run instead of repeated counter == 0 checks
Ordering the item list

Testing

Tested that selecting Yes starts the construction as expected with no further prompts including on resuming
Tested that selecting No cancels the construction as expected
Tested the yields were within the bounds shown by the query for a console inc charges
Tested that the potential skill practise message displays/doesn't display as expected

Additional context

Setting location:
image
Example query:
image

image

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Crafting / Construction / Recipes Includes: Uncrafting / Disassembling [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) <Enhancement / Feature> New features, or enhancements on existing labels Jun 10, 2024
Copy link
Contributor

Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details.

Click to expand
  • If true, will query before deconstructimg terrain/furniture.

This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to tools/spell_checker/dictionary.txt so they will not trigger an alert next time.

Hints for adding a new word to the dictionary
  • If the word is normally in all lowercase, such as the noun word or the verb does, add it in its lower-case form; if the word is a proper noun, such as the surname George, add it in its initial-caps form; if the word is an acronym or has special letter case, such as the acronym CDDA or the unit mW, add it by preserving the case of all the letters. A word in the dictionary will also match its initial-caps form (if the word is in all lowercase) and all-uppercase form, so a word should be added to the dictionary in its normal letter case even if used in a different letter case in a sentence.
  • For a word to be added to the dictionary, it should either be a real, properly-spelled modern American English word, a foreign loan word (including romanized foreign names), or a foreign or made-up word that is used consistently and commonly enough in the game. Intentional misspelling (including eye dialect) of a word should not be added unless it has become a common terminology in the game, because while someone may have a legitimate use for it, another person may spell it that way accidentally.

@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Jun 10, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jun 11, 2024
@Procyonae Procyonae marked this pull request as draft June 11, 2024 15:42
@Procyonae
Copy link
Contributor Author

Drafting bc I've almost got the min max count/charges working

@Procyonae Procyonae marked this pull request as ready for review June 11, 2024 16:06
@Procyonae Procyonae marked this pull request as draft June 11, 2024 16:34
@Procyonae Procyonae marked this pull request as ready for review June 11, 2024 16:50
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jun 11, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jun 12, 2024
@dseguin dseguin merged commit cb44970 into CleverRaven:master Jun 13, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling <Enhancement / Feature> New features, or enhancements on existing [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deconstructing furniture should show possible results prior to deconstrution
2 participants