mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-12-22 16:48:25 +01:00
Random code cleanup
This commit is contained in:
parent
aa4be98e71
commit
5507ad3bc5
@ -78,7 +78,6 @@ public abstract class MixinAddServerScreen extends Screen {
|
||||
viaFabricPlus$addressField = null;
|
||||
}
|
||||
|
||||
// Create the button
|
||||
ButtonWidget.Builder buttonBuilder = ButtonWidget.builder(forcedVersion == null ? Text.translatable("base.viafabricplus.set_version") : Text.literal(forcedVersion.getName()), button -> {
|
||||
// Store current input in case the user cancels the version selection
|
||||
viaFabricPlus$nameField = serverNameField.getText();
|
||||
@ -87,11 +86,8 @@ public abstract class MixinAddServerScreen extends Screen {
|
||||
client.setScreen(new PerServerVersionScreen(this, version -> ((IServerInfo) server).viaFabricPlus$forceVersion(version)));
|
||||
}).size(98, 20);
|
||||
|
||||
// Set the button's position according to the configured orientation
|
||||
buttonBuilder = GeneralSettings.withOrientation(buttonBuilder, buttonPosition, width, height);
|
||||
|
||||
// Add the button to the screen
|
||||
this.addDrawableChild(buttonBuilder.build());
|
||||
// Set the button's position according to the configured orientation and add the button to the screen
|
||||
this.addDrawableChild(GeneralSettings.withOrientation(buttonBuilder, buttonPosition, width, height).build());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -43,15 +43,10 @@ public abstract class MixinDirectConnectScreen extends Screen {
|
||||
if (buttonPosition == 0) { // Off
|
||||
return;
|
||||
}
|
||||
|
||||
// Create the button
|
||||
ButtonWidget.Builder builder = ButtonWidget.builder(Text.literal("ViaFabricPlus"), button -> ProtocolSelectionScreen.INSTANCE.open(this)).size(98, 20);
|
||||
|
||||
// Set the button's position according to the configured orientation
|
||||
builder = GeneralSettings.withOrientation(builder, buttonPosition, width, height);
|
||||
|
||||
// Add the button to the screen
|
||||
this.addDrawableChild(builder.build());
|
||||
// Set the button's position according to the configured orientation and add the button to the screen
|
||||
this.addDrawableChild(GeneralSettings.withOrientation(builder, buttonPosition, width, height).build());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -43,15 +43,10 @@ public abstract class MixinMultiplayerScreen extends Screen {
|
||||
if (buttonPosition == 0) { // Off
|
||||
return;
|
||||
}
|
||||
|
||||
// Create the button
|
||||
ButtonWidget.Builder builder = ButtonWidget.builder(Text.literal("ViaFabricPlus"), button -> ProtocolSelectionScreen.INSTANCE.open(this)).size(98, 20);
|
||||
|
||||
// Set the button's position according to the configured orientation
|
||||
builder = GeneralSettings.withOrientation(builder, buttonPosition, width, height);
|
||||
|
||||
// Add the button to the screen
|
||||
this.addDrawableChild(builder.build());
|
||||
// Set the button's position according to the configured orientation and add the button to the screen
|
||||
this.addDrawableChild(GeneralSettings.withOrientation(builder, buttonPosition, width, height).build());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user