1
1
package me .desht .modularrouters .client .gui .module ;
2
2
3
+ import me .desht .modularrouters .client .gui .ISendToServer ;
3
4
import me .desht .modularrouters .client .gui .widgets .button .ItemStackButton ;
4
5
import me .desht .modularrouters .client .gui .widgets .button .TexturedCyclerButton ;
5
6
import me .desht .modularrouters .client .gui .widgets .button .TexturedToggleButton ;
@@ -38,9 +39,9 @@ public void init() {
38
39
39
40
CompiledDistributorModule cdm = new CompiledDistributorModule (null , moduleItemStack );
40
41
41
- addRenderableWidget (new TooltipButton (leftPos + 127 , topPos + 23 ));
42
- addRenderableWidget (sb = new StrategyButton (leftPos + 147 , topPos + 23 , 16 , 16 , cdm .getDistributionStrategy ()));
43
- addRenderableWidget (db = new DirectionButton (leftPos + 147 , topPos + 43 , cdm .isPulling ()));
42
+ addRenderableWidget (new TooltipButton (leftPos + 127 , topPos + 23 , ModItems . DISTRIBUTOR_MODULE . toStack () ));
43
+ addRenderableWidget (sb = new StrategyButton (leftPos + 147 , topPos + 23 , 16 , 16 , cdm .getDistributionStrategy (), this ));
44
+ addRenderableWidget (db = new DirectionButton (leftPos + 147 , topPos + 43 , cdm .isPulling (), this ));
44
45
45
46
getMouseOverHelp ().addHelpRegion (leftPos + 125 , topPos + 21 , leftPos + 165 , topPos + 41 ,
46
47
xlate ("modularrouters.guiText.popup.distributor.strategy" ).withStyle (ChatFormatting .YELLOW ));
@@ -65,9 +66,9 @@ protected void renderBg(GuiGraphics graphics, float partialTicks, int mouseX, in
65
66
graphics .renderItem (ROUTER_STACK , leftPos + 127 , topPos + 43 );
66
67
}
67
68
68
- private class StrategyButton extends TexturedCyclerButton <DistributionStrategy > {
69
- StrategyButton (int x , int y , int width , int height , DistributionStrategy initialVal ) {
70
- super (x , y , width , height , initialVal , DistributorModuleScreen . this );
69
+ static class StrategyButton extends TexturedCyclerButton <DistributionStrategy > {
70
+ StrategyButton (int x , int y , int width , int height , DistributionStrategy initialVal , ISendToServer sendToServer ) {
71
+ super (x , y , width , height , initialVal , sendToServer );
71
72
}
72
73
73
74
@ Override
@@ -76,12 +77,12 @@ protected XYPoint getTextureXY() {
76
77
}
77
78
}
78
79
79
- private class DirectionButton extends TexturedToggleButton {
80
+ static class DirectionButton extends TexturedToggleButton {
80
81
private static final XYPoint TEXTURE_XY = new XYPoint (176 , 16 );
81
82
private static final XYPoint TEXTURE_XY_TOGGLED = new XYPoint (160 , 16 );
82
83
83
- public DirectionButton (int x , int y , boolean initialVal ) {
84
- super (x , y , 16 , 16 , initialVal , DistributorModuleScreen . this );
84
+ public DirectionButton (int x , int y , boolean initialVal , ISendToServer sender ) {
85
+ super (x , y , 16 , 16 , initialVal , sender );
85
86
86
87
setTooltips (xlate ("modularrouters.itemText.transfer_direction.from_router" ),xlate ("modularrouters.itemText.transfer_direction.to_router" ));
87
88
}
@@ -92,11 +93,11 @@ protected XYPoint getTextureXY() {
92
93
}
93
94
}
94
95
95
- private static class TooltipButton extends ItemStackButton {
96
+ static class TooltipButton extends ItemStackButton {
96
97
private static final XYPoint TEXTURE_XY = new XYPoint (176 , 16 );
97
98
98
- TooltipButton (int x , int y ) {
99
- super (x , y , 16 , 16 , new ItemStack ( ModItems . DISTRIBUTOR_MODULE . get ()) , true , p -> {});
99
+ TooltipButton (int x , int y , ItemStack stack ) {
100
+ super (x , y , 16 , 16 , stack , true , p -> {});
100
101
setTooltip (Tooltip .create (xlate ("modularrouters.guiText.tooltip.distributor.strategy" )));
101
102
}
102
103
0 commit comments