Open protocol-1903 opened 3 months ago
To have more context, could you please describe the use case that requires several copies of the same recipe?
I often use the fluid boilers in pY to burn of excess fluids from the coal gas (raw coal -> coal -> coke -> ash) and tar chain (tar refining, middle oil refining, and pitch refining) to make steam for the rest of the process. The result is anywhere from 2-8 fluid boilers, each with a different input. I use those to check if I am producing enough steam to keep the process going, along with whatever other processes I am running (agar, clay, latex, etc). Allowing quick duplication of similar recipes, generally with the fuel input changed, would be useful in similar situations.
What do you think about getting rid of this warning altogether? What's the best use case for it?
The one I can imagine is when a user erroneously adds a duplicate recipe, but it's not used by Yafc, so it stays at zero. The confusion could be prevented by this warning.
I think there are two problems with my example:
Is there a better use case for the warning?
Maybe you could add a little warning symbol with a tooltip on the unused recipe (do this for unused recipes in general) that says: "This recipe is a duplicate. It is not being used"
You could then remove the warning if the module configuration is different, or any other case where the recipes are same but different.
Maybe you could add a little warning symbol with a tooltip on the unused recipe (do this for unused recipes in general) that says: "This recipe is a duplicate. It is not being used"
There is no flag in the Yafc Model that indicates that the recipe as a duplicate. The recipe is checked for duplicates only at the time of insertion into the table.
If the duplicate flag existed, then controlling its correctness would be a problem, for instance when nested tables come into play. In general, adding another flag would make the code harder to understand because it is another thing to consider when reading and writing the logic, so we have to weigh the advantages against the complexity it brings, and the picure is not in its favor so far.
I would consider nested duplicates to be a non-issue. Consider if you are working a recipe chain in pY, and it has multiple recipes that take barrels of water. Most likely, you would want to nest each recipe with it's own barreling machine, to know how many you need per recipe. You wouldn't want the notification for every single barreling machine.
I agree, adding a flag might be difficult. I see no issue with removing the popup entirely, we could put it to a poll on discord to see what people think.
I would consider nested duplicates to be a non-issue.
I mentioned a nested table for the following reason: There's an option to unpack a nested table. If there's an indicator of duplicates, then Yafc would need to see if there are duplicates in the resulting page and mark them accordingly.
That is an example that came to mind where we'd need to make a custom check. I believe there are more such edge cases that would pollute the code, so that's why I don't want to bother with this flag.
I see. In that case, I think that it would be best to remove the check entirely and allow duplicate recipes with no warning
Echo what i wrote on discord: I hate the duplicate recipe warning. I would rather see an extension of the already existing mark for existing recipes,. We could add a new marker for 1) recipes already linked and 2) recipes already used elsewhere on this page. The current duplicate warning detects neither of those i think, and is this pointless. The only case where it does work is if the recipe is already there on the current nest level, and in that case you will easily spot it anyway.
Also, you can already skip this dialog with ctrl+click in some cases.
Or at least add multiple copies and then click the ok button multiple times. That seems to be a bug on itself. Removing the dialog would fix that.
I like having this dialog. It's not uncommon for me to get click-happy and accidentally add a recipe I already have at that level, especially when trying to add all the recipes and links needed for consuming crude oil in more complicated mods. On the flip side, I don't want a dialog that warns that I'm making gears in a different nested table in my factory. That's expected, since I don't put gears on the bus.
I was thinking shift-clicking the recipe would be a good override.
I like this idea better than either of the alternatives I've come up with. My first thought was that it should work in the large recipe selection windows as well, but the use case is "add five copies of this recipe", which can't be done in SelectMultiObjectPanel
.
(My alternatives were to make it "smarter", for some hard-to-define version of "smarter"; and to add a setting in the preferences that suppresses that warning.)
Or at least add multiple copies and then click the ok button multiple times. That seems to be a bug on itself.
This is a wart, but not a bug. Each OK button applies to one recipe; if you add several duplicate recipes with different names, the dialog will show those different names.
Another note i would like to add (was planning to make a separate issue but so far i haven't found time to work on it myself yet:)
The option to select 'any' for fuel or temperature selection options, and let YaFC-CE pick any option, under water all recipes would be added. I'm not sure yet if this is viable to be implemented (for Py with the nr of fuels it might require a fuel whiltelist similar to 'allow overproduction)', but this would eliminate my need to skip over the duplicate recipes dialog, since i would no longer need duplicate recipes.
I don't want a dialog that warns that I'm making gears in a different nested table in my factory
From my tests, it considers a nested table a separate entity. In other words, it doesn't mark a recipe as a duplicate if it's not in the same nested table.
As a sync up with the Discord, there's a reply from an endgame player (ComoNaD) that they find the warning useful.
With all of that, I withdraw my idea of deleting it. I got provided with the use cases that justify the warning.
It would be nice to have a way to override the "are you sure you want to add another copy of this recipe" popup so that it never shows up in the first place. I was thinking shift-clicking the recipe would be a good override. If nobody wants to do it, just let me know and I can make a pull request and maybe figure it out myself.