@@ -26,12 +26,14 @@ protected CScreen(int width, int height) {
2626
2727 @ Override
2828 public void render (@ NotNull DrawContext context , int mouseX , int mouseY , float tickDelta ) {
29- renderBackground (context );
29+ //renderBackground(context, mouseX, mouseY, tickDelta);
30+ super .render (context , mouseX , mouseY , tickDelta );
3031 context .getMatrices ().push ();
3132 MinecraftClient mc = DFScript .MC ;
3233
3334 MatrixStack stack = context .getMatrices ();
3435
36+ assert mc .currentScreen != null ;
3537 stack .translate (mc .currentScreen .width /2f , mc .currentScreen .height /2f , 0 );
3638
3739// float scaleFactor = (float) mc.getWindow().getScaleFactor();
@@ -58,7 +60,6 @@ public void render(@NotNull DrawContext context, int mouseX, int mouseY, float t
5860 cWidget .renderOverlay (context , mouseX , mouseY , tickDelta );
5961 }
6062 stack .pop ();
61- super .render (context , mouseX , mouseY , tickDelta );
6263 }
6364
6465 @ Override
@@ -100,20 +101,21 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) {
100101 }
101102
102103 @ Override
103- public boolean mouseScrolled (double mouseX , double mouseY , double amount ) {
104+ public boolean mouseScrolled (double mouseX , double mouseY , double horizontal , double vertical ) {
104105 mouseX = translateMouseX (mouseX );
105106 mouseY = translateMouseY (mouseY );
106107
107108 for (CWidget cWidget : widgets ) {
108- cWidget .mouseScrolled (mouseX , mouseY , amount );
109+ cWidget .mouseScrolled (mouseX , mouseY , vertical , horizontal );
109110 }
110- return super .mouseScrolled (mouseX , mouseY , amount );
111+ return super .mouseScrolled (mouseX , mouseY , horizontal , vertical );
111112 }
112113
113114 public double translateMouseX (double mouseX ) {
114115 MinecraftClient mc = DFScript .MC ;
115116// float s = (float) mc.getWindow().getScaleFactor();
116117 float scaleFactor = 2 ;
118+ assert mc .currentScreen != null ;
117119 mouseX += -mc .currentScreen .width /2f ;
118120 mouseX /= scaleFactor ;
119121 mouseX += width /2f ;
@@ -124,6 +126,7 @@ public double translateMouseY(double mouseY) {
124126 MinecraftClient mc = DFScript .MC ;
125127// float scaleFactor = (float) mc.getWindow().getScaleFactor();
126128 float scaleFactor = 2 ;
129+ assert mc .currentScreen != null ;
127130 mouseY += -mc .currentScreen .height /2f ;
128131 mouseY /= scaleFactor ;
129132 mouseY += height /2f ;
0 commit comments