44import com .daqem .uilib .gui .widget .ButtonWidget ;
55import com .daqem .uilib .gui .widget .CustomButtonWidget ;
66import com .github .kd_gaming1 .packcore .gui .util .GuiHelper ;
7+ import com .github .kd_gaming1 .packcore .gui .wizard .page .ScamScreenerPage ;
78import com .github .kd_gaming1 .packcore .metadata .ModpackMetadata ;
89import net .minecraft .client .gui .components .Tooltip ;
910import net .minecraft .client .gui .components .WidgetSprites ;
@@ -32,6 +33,11 @@ public class WizardButtonBar extends EmptyComponent {
3233 Identifier .fromNamespaceAndPath (MOD_ID , "menu/buttons/disabled_continue_gray_button" ),
3334 Identifier .fromNamespaceAndPath (MOD_ID , "menu/buttons/hover_continue_gray_button" )
3435 );
36+ private static final WidgetSprites SCAM_SCREENER_CONTINUE_BUTTON = new WidgetSprites (
37+ Identifier .fromNamespaceAndPath (MOD_ID , "menu/buttons/continue_gray_button" ),
38+ Identifier .fromNamespaceAndPath (MOD_ID , "menu/buttons/continue_gray_button" ),
39+ Identifier .fromNamespaceAndPath (MOD_ID , "menu/buttons/hover_continue_gray_button" )
40+ );
3541
3642 private static final WidgetSprites PREVIOUS_BUTTON = new WidgetSprites (
3743 Identifier .fromNamespaceAndPath (MOD_ID , "menu/buttons/previous_gray_button" ),
@@ -64,6 +70,7 @@ public class WizardButtonBar extends EmptyComponent {
6470 private final ButtonWidget backButton ;
6571 private final ButtonWidget skipButton ;
6672 private final ButtonWidget continueButton ;
73+ private final ButtonWidget scamScreenerContinueButton ;
6774 private final ButtonWidget finishButton ;
6875
6976 public WizardButtonBar (WizardNavigator navigator , int width , int height ) {
@@ -99,6 +106,12 @@ public WizardButtonBar(WizardNavigator navigator, int width, int height) {
99106 CONTINUE_BUTTON ,
100107 btn -> navigator .nextPage ()
101108 );
109+ scamScreenerContinueButton = new CustomButtonWidget (
110+ width - BTN_WIDTH - BTN_GAP , btnY , BTN_WIDTH , BTN_HEIGHT ,
111+ Component .translatable ("gui.packcore.wizard.button.continue" ),
112+ SCAM_SCREENER_CONTINUE_BUTTON ,
113+ btn -> navigator .nextPage ()
114+ );
102115
103116 backButton = new CustomButtonWidget (
104117 width - BTN_WIDTH * 2 - BTN_GAP * 2 , btnY , BTN_WIDTH , BTN_HEIGHT ,
@@ -132,6 +145,7 @@ public WizardButtonBar(WizardNavigator navigator, int width, int height) {
132145 this .addWidget (skipButton );
133146 this .addWidget (backButton );
134147 this .addWidget (continueButton );
148+ this .addWidget (scamScreenerContinueButton );
135149 this .addWidget (finishButton );
136150
137151 refresh ();
@@ -141,12 +155,16 @@ public WizardButtonBar(WizardNavigator navigator, int width, int height) {
141155 public void refresh () {
142156 boolean hasBack = navigator .hasPrevious ();
143157 boolean isLastPage = navigator .isOnLastPage ();
158+ boolean isScamScreenerPage = navigator .getCurrentPage () instanceof ScamScreenerPage ;
144159
145160 backButton .visible = hasBack ;
146161 backButton .active = hasBack ;
147162
148- continueButton .visible = !isLastPage ;
149- continueButton .active = !isLastPage ;
163+ continueButton .visible = !isLastPage && !isScamScreenerPage ;
164+ continueButton .active = !isLastPage && !isScamScreenerPage ;
165+
166+ scamScreenerContinueButton .visible = !isLastPage && isScamScreenerPage ;
167+ scamScreenerContinueButton .active = !isLastPage && isScamScreenerPage ;
150168
151169 skipButton .visible = isLastPage ;
152170 skipButton .active = isLastPage ;
@@ -192,4 +210,4 @@ private static void openUrlSafely(String url) {
192210 LOGGER .warn ("Couldn't open uri '{}' " , url , e );
193211 }
194212 }
195- }
213+ }
0 commit comments