Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/kotlin/me/cael/capes/CapeConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class CapeConfig : Config {
var enableMinecraftCapesMod = false
var enableCosmetica = false
var enableCloaksPlus = false
var enableAdvancedCapes = false
var enableElytraTexture = true

override fun getName(): String = "capes"
Expand Down
6 changes: 4 additions & 2 deletions src/main/kotlin/me/cael/capes/CapeType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.screen.ScreenTexts
import net.minecraft.text.Text

enum class CapeType(val stylized: String) {
MINECRAFT("Minecraft"), OPTIFINE("OptiFine"), LABYMOD("LabyMod"), WYNNTILS("Wynntils"), MINECRAFTCAPES("MinecraftCapes"), COSMETICA("Cosmetica"), CLOAKSPLUS("Cloaks+");
MINECRAFT("Minecraft"), OPTIFINE("OptiFine"), LABYMOD("LabyMod"), WYNNTILS("Wynntils"), MINECRAFTCAPES("MinecraftCapes"), COSMETICA("Cosmetica"), CLOAKSPLUS("Cloaks+"), ADVANCEDCAPES("AdvancedCapes");

fun cycle() = when(this) {
MINECRAFT -> OPTIFINE
Expand All @@ -14,7 +14,8 @@ enum class CapeType(val stylized: String) {
WYNNTILS -> COSMETICA
COSMETICA -> MINECRAFTCAPES
MINECRAFTCAPES -> CLOAKSPLUS
CLOAKSPLUS -> MINECRAFT
CLOAKSPLUS -> ADVANCEDCAPES
ADVANCEDCAPES -> MINECRAFT
}

fun getURL(profile: GameProfile): String? {
Expand All @@ -26,6 +27,7 @@ enum class CapeType(val stylized: String) {
COSMETICA -> if(config.enableCosmetica) "http://api.cosmetica.cc/get/cloak?username=${profile.name}&uuid=${profile.id}&nothirdparty" else null
MINECRAFTCAPES -> if(config.enableMinecraftCapesMod) "https://minecraftcapes.net/profile/${profile.id.toString().replace("-", "")}" else null
CLOAKSPLUS -> if(config.enableCloaksPlus) "http://161.35.130.99/capes/${profile.name}.png" else null
ADVANCEDCAPES -> if(config.enableAdvancedCapes) "https://advancedcapes.nl/cape/${profile.name}" else null
MINECRAFT -> null
}
}
Expand Down
10 changes: 8 additions & 2 deletions src/main/kotlin/me/cael/capes/menu/ToggleMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,19 @@ class ToggleMenu(parent: Screen, gameOptions: GameOptions) : MainMenu(parent, ga
buttonWidget.message = CapeType.CLOAKSPLUS.getToggleText(config.enableCloaksPlus)
})

addDrawableChild(ButtonWidget((width/2) - (200 / 2), height / 7 + 4 * 24, 200, 20, elytraMessage(config.enableElytraTexture)) { buttonWidget: ButtonWidget ->
addDrawableChild(ButtonWidget(width / 2 - 155, height / 7 + 4 * 24, 150, 20, CapeType.ADVANCEDCAPES.getToggleText(config.enableAdvancedCapes)) { buttonWidget: ButtonWidget ->
config.enableAdvancedCapes = !config.enableAdvancedCapes
config.save()
buttonWidget.message = CapeType.ADVANCEDCAPES.getToggleText(config.enableAdvancedCapes)
})

addDrawableChild(ButtonWidget((width/2) - (200 / 2), height / 7 + 5 * 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 ->
addDrawableChild(ButtonWidget((width/2) - (200 / 2), height / 7 + 6 * 24, 200, 20, ScreenTexts.DONE) { buttonWidget: ButtonWidget ->
client!!.setScreen(parent)
})

Expand Down