mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-16 10:55:39 +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;
|
viaFabricPlus$addressField = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the button
|
|
||||||
ButtonWidget.Builder buttonBuilder = ButtonWidget.builder(forcedVersion == null ? Text.translatable("base.viafabricplus.set_version") : Text.literal(forcedVersion.getName()), 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
|
// Store current input in case the user cancels the version selection
|
||||||
viaFabricPlus$nameField = serverNameField.getText();
|
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)));
|
client.setScreen(new PerServerVersionScreen(this, version -> ((IServerInfo) server).viaFabricPlus$forceVersion(version)));
|
||||||
}).size(98, 20);
|
}).size(98, 20);
|
||||||
|
|
||||||
// Set the button's position according to the configured orientation
|
// Set the button's position according to the configured orientation and add the button to the screen
|
||||||
buttonBuilder = GeneralSettings.withOrientation(buttonBuilder, buttonPosition, width, height);
|
this.addDrawableChild(GeneralSettings.withOrientation(buttonBuilder, buttonPosition, width, height).build());
|
||||||
|
|
||||||
// Add the button to the screen
|
|
||||||
this.addDrawableChild(buttonBuilder.build());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -43,15 +43,10 @@ public abstract class MixinDirectConnectScreen extends Screen {
|
|||||||
if (buttonPosition == 0) { // Off
|
if (buttonPosition == 0) { // Off
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the button
|
|
||||||
ButtonWidget.Builder builder = ButtonWidget.builder(Text.literal("ViaFabricPlus"), button -> ProtocolSelectionScreen.INSTANCE.open(this)).size(98, 20);
|
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
|
// Set the button's position according to the configured orientation and add the button to the screen
|
||||||
builder = GeneralSettings.withOrientation(builder, buttonPosition, width, height);
|
this.addDrawableChild(GeneralSettings.withOrientation(builder, buttonPosition, width, height).build());
|
||||||
|
|
||||||
// Add the button to the screen
|
|
||||||
this.addDrawableChild(builder.build());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -43,15 +43,10 @@ public abstract class MixinMultiplayerScreen extends Screen {
|
|||||||
if (buttonPosition == 0) { // Off
|
if (buttonPosition == 0) { // Off
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the button
|
|
||||||
ButtonWidget.Builder builder = ButtonWidget.builder(Text.literal("ViaFabricPlus"), button -> ProtocolSelectionScreen.INSTANCE.open(this)).size(98, 20);
|
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
|
// Set the button's position according to the configured orientation and add the button to the screen
|
||||||
builder = GeneralSettings.withOrientation(builder, buttonPosition, width, height);
|
this.addDrawableChild(GeneralSettings.withOrientation(builder, buttonPosition, width, height).build());
|
||||||
|
|
||||||
// Add the button to the screen
|
|
||||||
this.addDrawableChild(builder.build());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user