GregTechCE / GregTech

GregTech rewrite for modern versions of Minecraft
GNU Lesser General Public License v3.0
268 stars 150 forks source link

[Suggestion] Crafting station - mark missing items in red. #1707

Open jk1895 opened 3 years ago

jk1895 commented 3 years ago

Hello, It would be great if the crafting station would mark missing items in red. I and I'm sure a lot of others would be very grateful for that.

Thanks a lot

bruberu commented 3 years ago

In fact, I was already working on implementing this feature in a fork of GTCE, and if enough people want it here, I can easily also bring it to GTCE itself.

warjort commented 3 years ago

This looks like it might be quite complicated to implement. The issue is that there are three different representations of the crafting recipe items and they are not easily linked because of all the wrapping/delegation.

Further:

So the first issue is how to link the recipes subitems to the slot status on the screen CachedRecipeData.requiredItems -> CraftingGrid.SlotWidget(s) This will be required to set the slot status as it changes from missing to present and vice versa The solution to this is not clear to me.

NOTE: The processing that highlights slots should be clever enough to give an indication of what is missing. e.g. if you have 8 iron ingots and want to make an iron block (9 ingots), it should only hightlight the last slot, not all of them

The other issue is probably to introduce a "mixin" interface that lets a Slot choose an override background color. The slot widgets used by the Crafting Station can then provide a red color override if the slot has been flagged as missing.