2222import gregtech .api .util .GTHashMaps ;
2323import gregtech .client .renderer .texture .Textures ;
2424import gregtech .client .renderer .texture .cube .SimpleOverlayRenderer ;
25+ import gregtech .integration .jei .recipe .IntCircuitCategory ;
2526import it .unimi .dsi .fastutil .objects .Object2IntMap ;
2627import net .minecraft .client .resources .I18n ;
2728import net .minecraft .entity .player .EntityPlayer ;
@@ -274,7 +275,7 @@ private ModularUI.Builder createUITemplate(EntityPlayer player, int gridSize) {
274275
275276 SlotWidget circuitSlot = new GhostCircuitSlotWidget (circuitInventory , 0 , circuitX , circuitY )
276277 .setBackgroundTexture (GuiTextures .SLOT , getCircuitSlotOverlay ());
277- builder .widget (getCircuitSlotTooltip ( circuitSlot ));
278+ builder .widget (circuitSlot . setConsumer ( this :: getCircuitSlotTooltip ));
278279 }
279280
280281 return builder .bindPlayerInventory (player .inventory , GuiTextures .SLOT , inventoryStartX , inventoryStartY );
@@ -291,8 +292,15 @@ protected TextureArea getCircuitSlotOverlay() {
291292 }
292293
293294 // Method provided to override
294- protected SlotWidget getCircuitSlotTooltip (@ Nonnull SlotWidget widget ) {
295- return widget .setTooltipText ("gregtech.gui.configurator_slot.tooltip" );
295+ protected void getCircuitSlotTooltip (@ Nonnull SlotWidget widget ) {
296+ String configString ;
297+ if (circuitInventory == null || circuitInventory .getCircuitValue () == GhostCircuitItemStackHandler .NO_CONFIG ) {
298+ configString = new TextComponentTranslation ("gregtech.gui.configurator_slot.no_value" ).getFormattedText ();
299+ } else {
300+ configString = String .valueOf (circuitInventory .getCircuitValue ());
301+ }
302+
303+ widget .setTooltipText ("gregtech.gui.configurator_slot.tooltip" , configString );
296304 }
297305
298306 private static void collapseInventorySlotContents (IItemHandlerModifiable inventory ) {
0 commit comments