From 1f68d31ee1de44ac30c1cf643d5d5658e1f8d70f Mon Sep 17 00:00:00 2001 From: desyncfy Date: Wed, 24 Jul 2024 14:16:06 -0700 Subject: [PATCH] Finally, show if features are enabled in Menu. --- README.md | 2 +- .../kotlin/chickenmanfy/scify/modules/Menu.kt | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b17d0b1..aa647ca 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ I then remembered when one of my friends (BearCat865) suggested making a Dungeon --- # Roadmap _Currently in beta so expect bugs._ -- Right shift menu to enable and disable mods (90%) +- Right shift menu to enable and disable mods (100%) - Health & Food bars replaced with dynamic bar similar to EXP bar (100%) - Auto-Welcome (20%) **WARNING: This feature may prove to be annoying, in which case we will remove it.** - City NPCs (Lively Mode) (0%) diff --git a/src/client/kotlin/chickenmanfy/scify/modules/Menu.kt b/src/client/kotlin/chickenmanfy/scify/modules/Menu.kt index d940ad9..7ddcce2 100644 --- a/src/client/kotlin/chickenmanfy/scify/modules/Menu.kt +++ b/src/client/kotlin/chickenmanfy/scify/modules/Menu.kt @@ -2,6 +2,7 @@ package chickenmanfy.scify.modules import net.fabricmc.api.EnvType import net.fabricmc.api.Environment +import net.minecraft.client.MinecraftClient import net.minecraft.client.gui.DrawContext import net.minecraft.client.gui.screen.Screen import net.minecraft.client.gui.tooltip.Tooltip @@ -36,39 +37,45 @@ class Menu : Screen(Text.literal("SciFy Menu")) { dynamicBars = ButtonWidget.builder(Text.literal("Custom Health/Mana")) { Bars().toggleBars() // Call the function toggleBars() from the bars.kt module + MinecraftClient.getInstance().setScreen(Menu()) } .dimensions(width / 2 - 205, 84, 200, 20) - .tooltip(Tooltip.of(Text.literal("Custom Health and Mana bars."))) + .tooltip(Tooltip.of(Text.literal("Custom Health and Mana bars. (${if (barsToggle) "Enabled" else "Disabled"})"))) .build() fishingNotif = ButtonWidget.builder(Text.literal("Fishing Notifications")) { FishingNotif().toggleFishingNotif() // Call the function toggleFishingNotif() from the FishingNotif.kt module + MinecraftClient.getInstance().setScreen(Menu()) } .dimensions(width / 2 + 5, 84, 200, 20) - .tooltip(Tooltip.of(Text.literal("Fishing Notifications"))) + .tooltip(Tooltip.of(Text.literal("Fishing Notifications (${if (fishingToggle) "Enabled" else "Disabled"})"))) .build() watermark = ButtonWidget.builder(Text.literal("Show Watermark")) { Watermark().toggleWaterMark() // Call the function toggleWaterMark() from the Watermark.kt module + MinecraftClient.getInstance().setScreen(Menu()) } .dimensions(width / 2 - 205, 164, 200, 20) - .tooltip(Tooltip.of(Text.literal("Enable/Disable the small text in the bottom right displaying the mod name."))) + .tooltip(Tooltip.of(Text.literal("Enable/Disable the small text in the bottom right displaying the mod name. (${if (watermarkToggle) "Enabled" else "Disabled"})"))) .build() autoWelcome = ButtonWidget.builder(Text.literal("Auto Welcome Back")) { AutoWelcome().toggleAutoWelcome() // Call the function toggleAutoWelcome() from the AutoWelcome.kt module + MinecraftClient.getInstance().setScreen(Menu()) } .dimensions(width / 2 - 205, 124, 200, 20) - .tooltip(Tooltip.of(Text.literal("Automatically sends \"wb\" when a player joins."))) + .tooltip(Tooltip.of(Text.literal("Automatically sends \"wb\" when a player joins. (${if (autoWelcomeToggle) "Enabled" else "Disabled"})"))) .build() livelyMode = ButtonWidget.builder(Text.literal("City NPCs (Lively Mode)")) { LivelyMode().toggleLivelyMode() // Call the function toggleLivelyMode() from the LivelyMode.kt module + MinecraftClient.getInstance().setScreen(Menu()) } .dimensions(width / 2 - 205, 164, 200, 20) - .tooltip(Tooltip.of(Text.literal("Replaces Villagers with player NPCs"))) + .tooltip(Tooltip.of(Text.literal("Replaces Villagers with player NPCs (${if (livelyModeToggle) "Enabled" else "Disabled"})"))) .build() resourcePack = ButtonWidget.builder(Text.literal("Toggle Resource Pack")) { // TODO: Implement Resource pack + MinecraftClient.getInstance().setScreen(Menu()) } .dimensions(width / 2 + 5, 124, 200, 20) - .tooltip(Tooltip.of(Text.literal("Toggles the community resource pack."))) + .tooltip(Tooltip.of(Text.literal("Toggles the community resource pack. (${if (fishingToggle) "Enabled" else "Disabled"})"))) .build() addDrawableChild(dynamicBars)