1414import gregtech .api .gui .GuiTextures ;
1515import gregtech .api .gui .ModularUI ;
1616import gregtech .api .gui .resources .TextureArea ;
17- import gregtech .api .gui .widgets .GhostCircuitSlotWidget ;
18- import gregtech .api .gui .widgets .ImageWidget ;
19- import gregtech .api .gui .widgets .LabelWidget ;
20- import gregtech .api .gui .widgets .SlotWidget ;
21- import gregtech .api .gui .widgets .ToggleButtonWidget ;
2217import gregtech .api .items .itemhandlers .GTItemStackHandler ;
2318import gregtech .api .metatileentity .interfaces .IGregTechTileEntity ;
2419import gregtech .api .mui .GTGuiTextures ;
2520import gregtech .api .mui .GTGuis ;
21+ import gregtech .api .mui .widget .GhostCircuitSlotWidget ;
2622import gregtech .api .recipes .RecipeMap ;
2723import gregtech .api .util .GTTransferUtils ;
2824import gregtech .api .util .GTUtility ;
@@ -506,13 +502,12 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager guiSyncManager)
506502 }
507503
508504 ModularPanel panel = GTGuis .createPanel (this , 176 , 166 + yOffset );
509- Widget <?> widget = workableRecipeMap .getRecipeMapUI ().buildWidget (workable ::getProgressPercent , importItems ,
510- exportItems , importFluids , exportFluids , yOffset , guiSyncManager );
511505
512506 BooleanSyncValue hasEnergy = new BooleanSyncValue (workable ::isHasNotEnoughEnergy );
513507 guiSyncManager .syncValue ("has_energy" , hasEnergy );
514508
515- panel .child (widget )
509+ workableRecipeMap .getRecipeMapUI ().constructPanel (panel , workable ::getProgressPercent ,
510+ importItems , exportItems , importFluids , exportFluids , yOffset , guiSyncManager )
516511 .child (IKey .lang (getMetaFullName ()).asWidget ().pos (5 , 5 ))
517512 .child (new ItemSlot ()
518513 .slot (SyncHandlers .itemSlot (chargerInventory , 0 ))
@@ -558,7 +553,7 @@ public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager guiSyncManager)
558553 .background (GTGuiTextures .getLogo (getUITheme ())));
559554
560555 if (hasGhostCircuitInventory () && circuitInventory != null ) {
561- panel .child (new gregtech . api . mui . widget . GhostCircuitSlotWidget ()
556+ panel .child (new GhostCircuitSlotWidget ()
562557 .pos (124 , 62 + yOffset )
563558 .slot (SyncHandlers .itemSlot (circuitInventory , 0 ))
564559 .background (GTGuiTextures .SLOT , GTGuiTextures .INT_CIRCUIT_OVERLAY ));
@@ -584,38 +579,42 @@ protected ModularUI.Builder createGuiTemplate(EntityPlayer player) {
584579 ModularUI .Builder builder = workableRecipeMap .getRecipeMapUI ()
585580 .createUITemplate (workable ::getProgressPercent , importItems , exportItems , importFluids , exportFluids ,
586581 yOffset )
587- .widget (new LabelWidget (5 , 5 , getMetaFullName ()))
588- .widget (new SlotWidget (chargerInventory , 0 , 79 , 62 + yOffset , true , true , false )
589- .setBackgroundTexture (GuiTextures .SLOT , GuiTextures .CHARGER_OVERLAY )
590- .setTooltipText ("gregtech.gui.charger_slot.tooltip" , GTValues .VNF [getTier ()],
591- GTValues .VNF [getTier ()]))
592- .widget (new ImageWidget (79 , 42 + yOffset , 18 , 18 , GuiTextures .INDICATOR_NO_ENERGY ).setIgnoreColor (true )
593- .setPredicate (workable ::isHasNotEnoughEnergy ))
582+ .widget (new gregtech .api .gui .widgets .LabelWidget (5 , 5 , getMetaFullName ()))
583+ .widget (new gregtech .api .gui .widgets .SlotWidget (chargerInventory , 0 , 79 , 62 + yOffset , true , true ,
584+ false )
585+ .setBackgroundTexture (GuiTextures .SLOT , GuiTextures .CHARGER_OVERLAY )
586+ .setTooltipText ("gregtech.gui.charger_slot.tooltip" , GTValues .VNF [getTier ()],
587+ GTValues .VNF [getTier ()]))
588+ .widget (new gregtech .api .gui .widgets .ImageWidget (79 , 42 + yOffset , 18 , 18 ,
589+ GuiTextures .INDICATOR_NO_ENERGY ).setIgnoreColor (true )
590+ .setPredicate (workable ::isHasNotEnoughEnergy ))
594591 .bindPlayerInventory (player .inventory , GuiTextures .SLOT , yOffset );
595592
596593 int leftButtonStartX = 7 ;
597594
598595 if (exportItems .getSlots () > 0 ) {
599- builder .widget (new ToggleButtonWidget (leftButtonStartX , 62 + yOffset , 18 , 18 ,
596+ builder .widget (new gregtech . api . gui . widgets . ToggleButtonWidget (leftButtonStartX , 62 + yOffset , 18 , 18 ,
600597 GuiTextures .BUTTON_ITEM_OUTPUT , this ::isAutoOutputItems , this ::setAutoOutputItems )
601598 .setTooltipText ("gregtech.gui.item_auto_output.tooltip" )
602599 .shouldUseBaseBackground ());
603600 leftButtonStartX += 18 ;
604601 }
605602 if (exportFluids .getTanks () > 0 ) {
606- builder .widget (new ToggleButtonWidget (leftButtonStartX , 62 + yOffset , 18 , 18 ,
603+ builder .widget (new gregtech . api . gui . widgets . ToggleButtonWidget (leftButtonStartX , 62 + yOffset , 18 , 18 ,
607604 GuiTextures .BUTTON_FLUID_OUTPUT , this ::isAutoOutputFluids , this ::setAutoOutputFluids )
608605 .setTooltipText ("gregtech.gui.fluid_auto_output.tooltip" )
609606 .shouldUseBaseBackground ());
610607 }
611608
612609 if (exportItems .getSlots () + exportFluids .getTanks () <= 9 ) {
613- ImageWidget logo = new ImageWidget (152 , 63 + yOffset , 17 , 17 ,
610+ gregtech .api .gui .widgets .ImageWidget logo = new gregtech .api .gui .widgets .ImageWidget (152 , 63 + yOffset , 17 ,
611+ 17 ,
614612 GTValues .XMAS .get () ? getXmasLogo () : getLogo ()).setIgnoreColor (true );
615613
616614 if (this .circuitInventory != null ) {
617- SlotWidget circuitSlot = new GhostCircuitSlotWidget (circuitInventory , 0 , 124 , 62 + yOffset )
618- .setBackgroundTexture (GuiTextures .SLOT , getCircuitSlotOverlay ());
615+ gregtech .api .gui .widgets .SlotWidget circuitSlot = new gregtech .api .gui .widgets .GhostCircuitSlotWidget (
616+ circuitInventory , 0 , 124 , 62 + yOffset )
617+ .setBackgroundTexture (GuiTextures .SLOT , getCircuitSlotOverlay ());
619618 builder .widget (circuitSlot .setConsumer (this ::getCircuitSlotTooltip )).widget (logo );
620619 }
621620 }
@@ -641,7 +640,7 @@ protected TextureArea getCircuitSlotOverlay() {
641640 }
642641
643642 // Method provided to override
644- protected void getCircuitSlotTooltip (SlotWidget widget ) {
643+ protected void getCircuitSlotTooltip (gregtech . api . gui . widgets . SlotWidget widget ) {
645644 String configString ;
646645 if (circuitInventory == null || circuitInventory .getCircuitValue () == GhostCircuitItemStackHandler .NO_CONFIG ) {
647646 configString = new TextComponentTranslation ("gregtech.gui.configurator_slot.no_value" ).getFormattedText ();
0 commit comments