I love the crafting calculator, but one issue I've always had is the amount of context switching you have to do while collecting items and following the crafting steps. Here's how I do it:
Open the calculator, select the item and setup it's crafting recipes;
For every item in the input slot:
Open the calculator, check what item and how much of it I need;
Find the item and add it to my inventory.
Add all of the items in the steps page to JEI favorites;
For every item in the steps page:
Open the calculator, to check what item and how much of it to craft next;
Open the JEI crafting information page for the item, press the "+" button to move items to the crafting area and craft the items.
Done.
This change aims to skip the steps of putting all of the items to JEI favorites and opening the calculator for every input and crafting step - making the whole experience more efficient and less frustrating. This is done by adding a function to enable a mini crafting widget for every container screen, where you can see a miniature version of the crafting calculator with the inputs and steps - exactly as you would on the full sized one.
It works as you might expect:
Displays the item selected in the crafting calculator. Does not support inserting a new item - you still need the full sized calculator to select the item and setup the crafting recipes.
Switch between input/output/catalysts/steps pages, enable/disable inventory.
Functionality to change the crafting amount.
The widget is not displayed by default, must be enabled in the full sized calculator.
The widget can be dragged around like a little window. The little "x" button closes it.
Multiple widgets are supported if you have multiple crafting calculators. The widgets overlap with each other like you would expect - clicking on the window moves it to the top.
JEI "extra GUI areas" are implemented to handle cases where the calculator is moved over the JEI overlays.
The widgets are updated when the inventory contents change.
The widget UI reflects the settings of the full sized calculator and vice versa.
The widget can not be moved outside of the screen.
Refactor the checkbox to handle clicking the label to toggle widget or replace the checkbox with an icon button. Maybe add a tooltip to better explain what the option does.
Should be possible to implement a mini math calculator, just for completeness sake.
The widget is rendered wrong when it is moved over inventory items. Not a big deal, because it's outside the inventory by default, it can be moved anywhere on the screen and JEI reflows to make space for them. I have no idea how to fix this, but it's not a deal-breaker for me anyway.
Apologies for the large pull request.
I love the crafting calculator, but one issue I've always had is the amount of context switching you have to do while collecting items and following the crafting steps. Here's how I do it:
This change aims to skip the steps of putting all of the items to JEI favorites and opening the calculator for every input and crafting step - making the whole experience more efficient and less frustrating. This is done by adding a function to enable a mini crafting widget for every container screen, where you can see a miniature version of the crafting calculator with the inputs and steps - exactly as you would on the full sized one.
It works as you might expect:
https://user-images.githubusercontent.com/1730245/132209013-045dcd72-dff4-4967-9648-9ca633c77ff0.mp4
Some possible improvements for the future: