diff --git a/src/main/kotlin/me/cael/capes/menu/OtherMenu.kt b/src/main/kotlin/me/cael/capes/menu/OtherMenu.kt index f7f3e96..472961d 100644 --- a/src/main/kotlin/me/cael/capes/menu/OtherMenu.kt +++ b/src/main/kotlin/me/cael/capes/menu/OtherMenu.kt @@ -1,13 +1,10 @@ package me.cael.capes.menu -import me.cael.capes.CapeType -import me.cael.capes.Capes -import net.fabricmc.loader.api.FabricLoader import net.minecraft.client.gui.screen.ConfirmChatLinkScreen import net.minecraft.client.gui.screen.Screen -import net.minecraft.screen.ScreenTexts import net.minecraft.client.gui.widget.ButtonWidget import net.minecraft.client.option.GameOptions +import net.minecraft.screen.ScreenTexts import net.minecraft.text.Text import net.minecraft.util.Util import java.math.BigInteger @@ -20,7 +17,7 @@ class OtherMenu(parent: Screen, gameOptions: GameOptions) : MainMenu(parent, gam val buttonW = 200 - addDrawableChild(ButtonWidget((width/2) - (buttonW / 2), 60, buttonW, 20, Text.translatable("options.capes.optifineeditor")) { buttonWidget: ButtonWidget -> + addDrawableChild(ButtonWidget((width/2) - (buttonW / 2), height / 7 + 24, buttonW, 20, Text.translatable("options.capes.optifineeditor")) { buttonWidget: ButtonWidget -> try { val random1Bi = BigInteger(128, Random()) val random2Bi = BigInteger(128, Random(System.identityHashCode(Object()).toLong())) @@ -37,6 +34,10 @@ class OtherMenu(parent: Screen, gameOptions: GameOptions) : MainMenu(parent, gam exception.printStackTrace() } }) + + addDrawableChild(ButtonWidget((width/2) - (buttonW / 2), height / 7 + 2 * 24, buttonW, 20, ScreenTexts.DONE) { buttonWidget: ButtonWidget -> + client!!.setScreen(parent) + }) } } \ No newline at end of file diff --git a/src/main/kotlin/me/cael/capes/menu/SelectorMenu.kt b/src/main/kotlin/me/cael/capes/menu/SelectorMenu.kt index adddacb..9f5c999 100644 --- a/src/main/kotlin/me/cael/capes/menu/SelectorMenu.kt +++ b/src/main/kotlin/me/cael/capes/menu/SelectorMenu.kt @@ -2,11 +2,9 @@ package me.cael.capes.menu import com.mojang.blaze3d.systems.RenderSystem import me.cael.capes.Capes -import me.cael.capes.handler.PlayerHandler import me.cael.capes.mixins.AccessorPlayerEntityModel import me.cael.capes.mixins.AccessorPlayerListEntry import me.cael.capes.utils.FakePlayer -import net.fabricmc.loader.api.FabricLoader import net.minecraft.client.MinecraftClient import net.minecraft.client.gui.screen.Screen import net.minecraft.client.gui.widget.ButtonWidget @@ -43,6 +41,10 @@ class SelectorMenu(parent: Screen, gameOptions: GameOptions) : MainMenu(parent, } }) + addDrawableChild(ButtonWidget((width/2) - (buttonW / 2), 220, buttonW, 20, ScreenTexts.DONE) { buttonWidget: ButtonWidget -> + client!!.setScreen(parent) + }) + buttonW = 100 addDrawableChild(ButtonWidget((width/4) - (buttonW / 2), 120, buttonW, 20, Text.translatable("options.capes.selector.elytra")) { buttonWidget: ButtonWidget -> diff --git a/src/main/kotlin/me/cael/capes/menu/ToggleMenu.kt b/src/main/kotlin/me/cael/capes/menu/ToggleMenu.kt index ae3e42d..0df022b 100644 --- a/src/main/kotlin/me/cael/capes/menu/ToggleMenu.kt +++ b/src/main/kotlin/me/cael/capes/menu/ToggleMenu.kt @@ -16,48 +16,52 @@ class ToggleMenu(parent: Screen, gameOptions: GameOptions) : MainMenu(parent, ga val config = Capes.CONFIG - addDrawableChild(ButtonWidget(width / 2 - 155, height / 6 + 24, 150, 20, CapeType.OPTIFINE.getToggleText(config.enableOptifine)) { buttonWidget: ButtonWidget -> + addDrawableChild(ButtonWidget(width / 2 - 155, height / 7 + 24, 150, 20, CapeType.OPTIFINE.getToggleText(config.enableOptifine)) { buttonWidget: ButtonWidget -> config.enableOptifine = !config.enableOptifine config.save() buttonWidget.message = CapeType.OPTIFINE.getToggleText(config.enableOptifine) }) - addDrawableChild(ButtonWidget(width / 2 - 155 + 160, height / 6 + 24, 150, 20, CapeType.LABYMOD.getToggleText(config.enableLabyMod)) { buttonWidget: ButtonWidget -> + addDrawableChild(ButtonWidget(width / 2 - 155 + 160, height / 7 + 24, 150, 20, CapeType.LABYMOD.getToggleText(config.enableLabyMod)) { buttonWidget: ButtonWidget -> config.enableLabyMod = !config.enableLabyMod config.save() buttonWidget.message = CapeType.LABYMOD.getToggleText(config.enableLabyMod) }) - addDrawableChild(ButtonWidget(width / 2 - 155, height / 6 + 2 * 24, 150, 20, CapeType.MINECRAFTCAPES.getToggleText(config.enableMinecraftCapesMod)) { buttonWidget: ButtonWidget -> + addDrawableChild(ButtonWidget(width / 2 - 155, height / 7 + 2 * 24, 150, 20, CapeType.MINECRAFTCAPES.getToggleText(config.enableMinecraftCapesMod)) { buttonWidget: ButtonWidget -> config.enableMinecraftCapesMod = !config.enableMinecraftCapesMod config.save() buttonWidget.message = CapeType.MINECRAFTCAPES.getToggleText(config.enableMinecraftCapesMod) }) - addDrawableChild(ButtonWidget(width / 2 - 155 + 160, height / 6 + 2 * 24, 150, 20, CapeType.WYNNTILS.getToggleText(config.enableWynntils)) { buttonWidget: ButtonWidget -> + addDrawableChild(ButtonWidget(width / 2 - 155 + 160, height / 7 + 2 * 24, 150, 20, CapeType.WYNNTILS.getToggleText(config.enableWynntils)) { buttonWidget: ButtonWidget -> config.enableWynntils = !config.enableWynntils config.save() buttonWidget.message = CapeType.WYNNTILS.getToggleText(config.enableWynntils) }) - addDrawableChild(ButtonWidget(width / 2 - 155, height / 6 + 3 * 24, 150, 20, CapeType.COSMETICA.getToggleText(config.enableCosmetica)) { buttonWidget: ButtonWidget -> + addDrawableChild(ButtonWidget(width / 2 - 155, height / 7 + 3 * 24, 150, 20, CapeType.COSMETICA.getToggleText(config.enableCosmetica)) { buttonWidget: ButtonWidget -> config.enableCosmetica = !config.enableCosmetica config.save() buttonWidget.message = CapeType.COSMETICA.getToggleText(config.enableCosmetica) }) - addDrawableChild(ButtonWidget(width / 2 - 155 + 160, height / 6 + 3 * 24, 150, 20, CapeType.CLOAKSPLUS.getToggleText(config.enableCloaksPlus)) { buttonWidget: ButtonWidget -> + addDrawableChild(ButtonWidget(width / 2 - 155 + 160, height / 7 + 3 * 24, 150, 20, CapeType.CLOAKSPLUS.getToggleText(config.enableCloaksPlus)) { buttonWidget: ButtonWidget -> config.enableCloaksPlus = !config.enableCloaksPlus config.save() buttonWidget.message = CapeType.CLOAKSPLUS.getToggleText(config.enableCloaksPlus) }) - addDrawableChild(ButtonWidget((width/2) - (200 / 2), height / 6 + 4 * 24, 200, 20, elytraMessage(config.enableElytraTexture)) { buttonWidget: ButtonWidget -> + addDrawableChild(ButtonWidget((width/2) - (200 / 2), height / 7 + 4 * 24, 200, 20, elytraMessage(config.enableElytraTexture)) { buttonWidget: ButtonWidget -> config.enableElytraTexture = !config.enableElytraTexture config.save() buttonWidget.message = elytraMessage(config.enableElytraTexture) }).active = !FabricLoader.getInstance().getModContainer("capetweaks").isPresent + addDrawableChild(ButtonWidget((width/2) - (200 / 2), height / 7 + 5 * 24, 200, 20, ScreenTexts.DONE) { buttonWidget: ButtonWidget -> + client!!.setScreen(parent) + }) + } private fun elytraMessage(enabled: Boolean) = ScreenTexts.composeToggleText(Text.translatable("options.capes.elytra"), enabled)