mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-11-16 10:45:15 +01:00
Fixed Via Button in 1.20.2
This commit is contained in:
parent
bec1c76415
commit
0e538ee6e8
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
@ -22,11 +22,9 @@ public class ViaFabricClient implements ClientModInitializer {
|
|||||||
try {
|
try {
|
||||||
ScreenEvents.AFTER_INIT.register((client, screen, scaledWidth, scaledHeight) -> {
|
ScreenEvents.AFTER_INIT.register((client, screen, scaledWidth, scaledHeight) -> {
|
||||||
if (!(screen instanceof MultiplayerScreen)) return;
|
if (!(screen instanceof MultiplayerScreen)) return;
|
||||||
// TODO This is broken
|
|
||||||
Identifier widgetIdentifier = new Identifier("viafabric:textures/gui/widgets.png");
|
|
||||||
ButtonWidget enableClientSideViaVersion = new TexturedButtonWidget(scaledWidth / 2 + 113, 10,
|
ButtonWidget enableClientSideViaVersion = new TexturedButtonWidget(scaledWidth / 2 + 113, 10,
|
||||||
40, 20, // Size
|
40, 20, // Size
|
||||||
new ButtonTextures(widgetIdentifier, widgetIdentifier),
|
new ButtonTextures(new Identifier("viafabric", "widget_unfocused"), new Identifier("viafabric", "widget_focused")),
|
||||||
it -> MinecraftClient.getInstance().setScreen(new ViaConfigScreen(screen)),
|
it -> MinecraftClient.getInstance().setScreen(new ViaConfigScreen(screen)),
|
||||||
Text.translatable("gui.via_button"));
|
Text.translatable("gui.via_button"));
|
||||||
if (ViaFabric.config.isHideButton()) enableClientSideViaVersion.visible = false;
|
if (ViaFabric.config.isHideButton()) enableClientSideViaVersion.visible = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user