fixed classic loading

added spacer to buttons
This commit is contained in:
FlorianMichael 2023-03-20 17:07:44 +01:00
parent d8841be601
commit 19a2d1715b
5 changed files with 9 additions and 10 deletions

View File

@ -48,6 +48,8 @@ public class ViaFabricPlus {
PreLoadCallback.EVENT.invoker().onLoad(); PreLoadCallback.EVENT.invoker().onLoad();
CustomClassicProtocolExtensions.create(); CustomClassicProtocolExtensions.create();
ClassicItemSelectionScreen.create();
new ProtocolHack(); new ProtocolHack();
FinishMinecraftLoadCallback.EVENT.register(() -> { FinishMinecraftLoadCallback.EVENT.register(() -> {
@ -62,7 +64,6 @@ public class ViaFabricPlus {
// Classic Stuff // Classic Stuff
ChatLengthDefinition.create(); ChatLengthDefinition.create();
ClassicItemSelectionScreen.create();
ClassicProtocolCommands.create(); ClassicProtocolCommands.create();
// Bedrock Stuff // Bedrock Stuff

View File

@ -41,10 +41,10 @@ public class MixinMultiplayerScreen extends Screen {
final int orientation = GeneralSettings.INSTANCE.mainButtonOrientation.getIndex(); final int orientation = GeneralSettings.INSTANCE.mainButtonOrientation.getIndex();
switch (orientation) { switch (orientation) {
case 0 -> builder = builder.position(0, 0); case 0 -> builder = builder.position(5, 5);
case 1 -> builder = builder.position(width - 98, 0); case 1 -> builder = builder.position(width - 98 - 5, 5);
case 2 -> builder = builder.position(0, height - 20); case 2 -> builder = builder.position(5, height - 20 - 5);
case 3 -> builder = builder.position(width - 98, height - 20); case 5 -> builder = builder.position(width - 98 - 5, height - 20 - 5);
} }
this.addDrawableChild(builder.size(98, 20).build()); this.addDrawableChild(builder.size(98, 20).build());

View File

@ -17,9 +17,7 @@
*/ */
package de.florianmichael.viafabricplus.injection.mixin.bridge; package de.florianmichael.viafabricplus.injection.mixin.bridge;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import de.florianmichael.viafabricplus.settings.groups.BridgeSettings; import de.florianmichael.viafabricplus.settings.groups.BridgeSettings;
import de.florianmichael.vialoadingbase.ViaLoadingBase;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.option.OptionsScreen; import net.minecraft.client.gui.screen.option.OptionsScreen;

View File

@ -65,9 +65,9 @@ public class ProtocolSelectionScreen extends Screen {
super.init(); super.init();
this.addDrawableChild(new SlotList(this.client, width, height, 3 + 3 /* start offset */ + (textRenderer.fontHeight + 2) * 3 /* title is 2 */, height + 5, textRenderer.fontHeight + 4)); this.addDrawableChild(new SlotList(this.client, width, height, 3 + 3 /* start offset */ + (textRenderer.fontHeight + 2) * 3 /* title is 2 */, height + 5, textRenderer.fontHeight + 4));
this.addDrawableChild(ButtonWidget.builder(Text.literal("<-"), button -> this.close()).position(0, 0).size(20, 20).build()); this.addDrawableChild(ButtonWidget.builder(Text.literal("<-"), button -> this.close()).position(5, 5).size(20, 20).build());
this.addDrawableChild(ButtonWidget.builder(Text.translatable("words.viafabricplus.settings"), button -> client.setScreen(SettingsScreen.get(this))).position(width - 98, 0).size(98, 20).build()); this.addDrawableChild(ButtonWidget.builder(Text.translatable("words.viafabricplus.settings"), button -> client.setScreen(SettingsScreen.get(this))).position(width - 98 - 5, 5).size(98, 20).build());
} }
@Override @Override

View File

@ -60,7 +60,7 @@ public class SettingsScreen extends Screen {
super.init(); super.init();
this.addDrawableChild(new SlotList(this.client, width, height, 3 + 3 /* start offset */ + (textRenderer.fontHeight + 2) * 3 /* title is 2 */, height + 5, (textRenderer.fontHeight + 2) * 2)); this.addDrawableChild(new SlotList(this.client, width, height, 3 + 3 /* start offset */ + (textRenderer.fontHeight + 2) * 3 /* title is 2 */, height + 5, (textRenderer.fontHeight + 2) * 2));
this.addDrawableChild(ButtonWidget.builder(Text.literal("<-"), button -> this.close()).position(0, 0).size(20, 20).build()); this.addDrawableChild(ButtonWidget.builder(Text.literal("<-"), button -> this.close()).position(5, 5).size(20, 20).build());
} }
@Override @Override