Basically, my thinking was to add an option to the item details menu to mark any item to be treated the same way worn clothes are treated, i.e. excluded from crafting ingredients and the advanced inventory menu (since you rarely drop your important items).
I don’t touch your code. Basing your understanding of anything I say off of actual code is not going to work. By flag I mean it has a toggle-able setting. 1 or 0. It’s true or false. If it’s true for that particular item (and that item only) it excludes it from all crafting that would use it up. Aka, it’s a preservation setting for that item. Not a flag on all items of a specific type. For instance…
I take a flashlight that I want to use. I make an extra batteries mod for it. Fill it up with batteries. I don’t want it expended when adding headlights to vehicles. This has happened to me more then once…
I’m sorry the word flag seems to have thrown you off. Forget it then. Call it a toggle for that particular item. Call it whatever you want. But it’s very annoying to lose something important just because I hit the craft button one too many times.
Also, with this, I suggest you move the choosing of components to before time is elapsed in crafting and give the option to cancel crafting when in the choosing components menu.