@@ -86,6 +86,7 @@ public final class AltManagerScreen extends Screen
8686
8787 private Button importButton ;
8888 private Button exportButton ;
89+ private Button disconnectRandomReconnectToggleButton ;
8990 private Button checkButton ;
9091 private Button logoutButton ;
9192
@@ -157,7 +158,7 @@ public void init()
157158
158159 addRenderableWidget (randomButton = Button
159160 .builder (Component .literal ("Login Random" ), b -> pressLoginRandom ())
160- .bounds (width / 2 + 158 , height - 52 , 100 , 20 ).build ());
161+ .bounds (width - 50 - 8 - 52 - 52 - 100 - 6 , 8 , 100 , 20 ).build ());
161162
162163 addRenderableWidget (Button
163164 .builder (Component .literal ("Direct Login" ),
@@ -196,6 +197,11 @@ public void init()
196197 Button .builder (Component .literal ("Export" ), b -> pressExportAlts ())
197198 .bounds (58 , 8 , 50 , 20 ).build ());
198199
200+ addRenderableWidget (disconnectRandomReconnectToggleButton = Button
201+ .builder (getDisconnectRandomReconnectLabel (),
202+ b -> pressToggleDisconnectRandomReconnect ())
203+ .bounds (114 , 8 , 170 , 20 ).build ());
204+
199205 addRenderableWidget (checkButton =
200206 Button .builder (Component .literal ("Check" ), b -> pressCheckAlts ())
201207 .bounds (width - 50 - 8 - 52 , 8 , 50 , 20 ).build ());
@@ -231,6 +237,8 @@ private void updateAltButtons()
231237 importButton .active = false ;
232238 if (exportButton != null )
233239 exportButton .active = false ;
240+ if (disconnectRandomReconnectToggleButton != null )
241+ disconnectRandomReconnectToggleButton .active = false ;
234242 return ;
235243 }
236244
@@ -248,6 +256,8 @@ private void updateAltButtons()
248256 importButton .active = false ;
249257 if (exportButton != null )
250258 exportButton .active = false ;
259+ if (disconnectRandomReconnectToggleButton != null )
260+ disconnectRandomReconnectToggleButton .active = false ;
251261 return ;
252262 }
253263
@@ -274,6 +284,26 @@ private void updateAltButtons()
274284 if (exportButton != null )
275285 exportButton .active =
276286 !importInProgress && !minecraft .options .fullscreen ().get ();
287+
288+ if (disconnectRandomReconnectToggleButton != null )
289+ disconnectRandomReconnectToggleButton .active = true ;
290+ }
291+
292+ private void pressToggleDisconnectRandomReconnect ()
293+ {
294+ boolean enabled = !altManager .isDisconnectRandomAltReconnectEnabled ();
295+ altManager .setDisconnectRandomAltReconnectEnabled (enabled );
296+
297+ if (disconnectRandomReconnectToggleButton != null )
298+ disconnectRandomReconnectToggleButton
299+ .setMessage (getDisconnectRandomReconnectLabel ());
300+ }
301+
302+ private Component getDisconnectRandomReconnectLabel ()
303+ {
304+ return Component .literal ("Toggle Random Reconnect: "
305+ + (altManager .isDisconnectRandomAltReconnectEnabled () ? "ON"
306+ : "OFF" ));
277307 }
278308
279309 @ Override
0 commit comments