From 70dbd17d0dfe7f6ed4eb1ad4bf3ab7c13e0a6546 Mon Sep 17 00:00:00 2001 From: desyncfy Date: Sun, 16 Jun 2024 15:10:26 -0700 Subject: [PATCH] Implement toggle, update class names. --- .../chickenmanfy/scify/Modules/AutoWelcome.kt | 15 ++ .../kotlin/chickenmanfy/scify/Modules/Bars.kt | 15 ++ .../scify/Modules/FishingNotif.kt | 20 +++ .../scify/Modules/{hotkey.kt => Hotkey.kt} | 2 +- .../chickenmanfy/scify/Modules/LivelyMode.kt | 15 ++ .../kotlin/chickenmanfy/scify/Modules/Menu.kt | 8 +- .../chickenmanfy/scify/Modules/autowelcome.kt | 10 -- .../kotlin/chickenmanfy/scify/Modules/bars.kt | 10 -- .../scify/Modules/fishingnotif.kt | 10 -- .../chickenmanfy/scify/Modules/livelymode.kt | 4 - .../scify/Modules/resourcepack.kt | 170 ------------------ .../kotlin/chickenmanfy/scify/SciFyClient.kt | 4 +- 12 files changed, 72 insertions(+), 211 deletions(-) create mode 100644 src/client/kotlin/chickenmanfy/scify/Modules/AutoWelcome.kt create mode 100644 src/client/kotlin/chickenmanfy/scify/Modules/Bars.kt create mode 100644 src/client/kotlin/chickenmanfy/scify/Modules/FishingNotif.kt rename src/client/kotlin/chickenmanfy/scify/Modules/{hotkey.kt => Hotkey.kt} (99%) create mode 100644 src/client/kotlin/chickenmanfy/scify/Modules/LivelyMode.kt delete mode 100644 src/client/kotlin/chickenmanfy/scify/Modules/autowelcome.kt delete mode 100644 src/client/kotlin/chickenmanfy/scify/Modules/bars.kt delete mode 100644 src/client/kotlin/chickenmanfy/scify/Modules/fishingnotif.kt delete mode 100644 src/client/kotlin/chickenmanfy/scify/Modules/livelymode.kt delete mode 100644 src/client/kotlin/chickenmanfy/scify/Modules/resourcepack.kt diff --git a/src/client/kotlin/chickenmanfy/scify/Modules/AutoWelcome.kt b/src/client/kotlin/chickenmanfy/scify/Modules/AutoWelcome.kt new file mode 100644 index 0000000..093a433 --- /dev/null +++ b/src/client/kotlin/chickenmanfy/scify/Modules/AutoWelcome.kt @@ -0,0 +1,15 @@ +package chickenmanfy.scify.Modules + +var autoWelcomeToggle: Boolean = false +class AutoWelcome() { + fun toggleAutoWelcome() { + autoWelcomeToggle = !autoWelcomeToggle + if (autoWelcomeToggle) { + autoWelcome() + } + } + + private fun autoWelcome() { + println("Auto Welcome") + } +} \ No newline at end of file diff --git a/src/client/kotlin/chickenmanfy/scify/Modules/Bars.kt b/src/client/kotlin/chickenmanfy/scify/Modules/Bars.kt new file mode 100644 index 0000000..b317345 --- /dev/null +++ b/src/client/kotlin/chickenmanfy/scify/Modules/Bars.kt @@ -0,0 +1,15 @@ +package chickenmanfy.scify.Modules + +var barsToggle: Boolean = false +class Bars { + fun toggleBars() { + barsToggle = !barsToggle + if (barsToggle) { + bars() + } + } + + private fun bars() { + println("Bars") + } +} \ No newline at end of file diff --git a/src/client/kotlin/chickenmanfy/scify/Modules/FishingNotif.kt b/src/client/kotlin/chickenmanfy/scify/Modules/FishingNotif.kt new file mode 100644 index 0000000..d640dba --- /dev/null +++ b/src/client/kotlin/chickenmanfy/scify/Modules/FishingNotif.kt @@ -0,0 +1,20 @@ +package chickenmanfy.scify.Modules + +var fishingToggle: Boolean = false +class FishingNotif { + // Fishing Notification Toggle + fun toggleFishingNotif() { + fishingToggle = !fishingToggle + if (fishingToggle) { + fishingNotif() + } + } + + + // Code in Menu.kt: + // toggleFishingNotif() + + private fun fishingNotif() { + TODO("Finish this") + } +} \ No newline at end of file diff --git a/src/client/kotlin/chickenmanfy/scify/Modules/hotkey.kt b/src/client/kotlin/chickenmanfy/scify/Modules/Hotkey.kt similarity index 99% rename from src/client/kotlin/chickenmanfy/scify/Modules/hotkey.kt rename to src/client/kotlin/chickenmanfy/scify/Modules/Hotkey.kt index 9de3a50..80d2b6e 100644 --- a/src/client/kotlin/chickenmanfy/scify/Modules/hotkey.kt +++ b/src/client/kotlin/chickenmanfy/scify/Modules/Hotkey.kt @@ -8,7 +8,7 @@ import net.minecraft.client.util.InputUtil import org.lwjgl.glfw.GLFW -class hotkey { +class Hotkey { fun hotkeys() { // Register Keys diff --git a/src/client/kotlin/chickenmanfy/scify/Modules/LivelyMode.kt b/src/client/kotlin/chickenmanfy/scify/Modules/LivelyMode.kt new file mode 100644 index 0000000..cce5c50 --- /dev/null +++ b/src/client/kotlin/chickenmanfy/scify/Modules/LivelyMode.kt @@ -0,0 +1,15 @@ +package chickenmanfy.scify.Modules + +var livelyModeToggle: Boolean = false +class LivelyMode() { + fun toggleLivelyMode() { + livelyModeToggle = !livelyModeToggle + if (livelyModeToggle) { + livelyMode() + } + } + + private fun livelyMode() { + println("Lively Mode") + } +} \ No newline at end of file diff --git a/src/client/kotlin/chickenmanfy/scify/Modules/Menu.kt b/src/client/kotlin/chickenmanfy/scify/Modules/Menu.kt index 202ee45..ad9ea81 100644 --- a/src/client/kotlin/chickenmanfy/scify/Modules/Menu.kt +++ b/src/client/kotlin/chickenmanfy/scify/Modules/Menu.kt @@ -36,13 +36,13 @@ class Menu : Screen(Text.literal("SciFy Menu")) { public override fun init() { dynamicBars = ButtonWidget.builder(Text.literal("Dynamic Health")) { - bars().toggleBars() // Call the function toggleBars() from the bars.kt module + Bars().toggleBars() // Call the function toggleBars() from the bars.kt module } .dimensions(width / 2 - 205, 20, 200, 20) .tooltip(Tooltip.of(Text.literal("Health bar similar to XP"))) .build() fishingNotif = ButtonWidget.builder(Text.literal("Fishing Notifications")) { - fishingnotif().toggleFishingNotif() // Call the function toggleFishingNotif() from the fishingnotif.kt module + FishingNotif().toggleFishingNotif() // If toggleFishingNotif() is true, run the fishing notification script. } .dimensions(width / 2 + 5, 20, 200, 20) .tooltip(Tooltip.of(Text.literal("Fishing Notifications"))) @@ -54,13 +54,13 @@ class Menu : Screen(Text.literal("SciFy Menu")) { .tooltip(Tooltip.of(Text.literal("Enable/Disable hotkeys."))) .build() autoWelcome = ButtonWidget.builder(Text.literal("Auto-Welcome")) { - autowelcome().toggleAutoWelcome() // Call the function toggleAutoWelcome() from the fishingnotif.kt module + AutoWelcome().toggleAutoWelcome() // Call the function toggleAutoWelcome() from the fishingnotif.kt module } .dimensions(width / 2 - 205, 60, 200, 20) .tooltip(Tooltip.of(Text.literal("Automatically welcomes new players."))) .build() livelyMode = ButtonWidget.builder(Text.literal("City NPCs (Lively Mode)")) { - fishingnotif().toggleFishingNotif() // Call the function toggleFishingNotif() from the fishingnotif.kt module + FishingNotif().toggleFishingNotif() // Call the function toggleFishingNotif() from the fishingnotif.kt module } .dimensions(width / 2 - 205, 100, 200, 20) .tooltip(Tooltip.of(Text.literal("Replaces Villagers with player NPCs"))) diff --git a/src/client/kotlin/chickenmanfy/scify/Modules/autowelcome.kt b/src/client/kotlin/chickenmanfy/scify/Modules/autowelcome.kt deleted file mode 100644 index cc3d507..0000000 --- a/src/client/kotlin/chickenmanfy/scify/Modules/autowelcome.kt +++ /dev/null @@ -1,10 +0,0 @@ -package chickenmanfy.scify.Modules - - - -class autowelcome() { - fun toggleAutoWelcome() { - } - fun autoWelcome() { - } -} \ No newline at end of file diff --git a/src/client/kotlin/chickenmanfy/scify/Modules/bars.kt b/src/client/kotlin/chickenmanfy/scify/Modules/bars.kt deleted file mode 100644 index 344e8b4..0000000 --- a/src/client/kotlin/chickenmanfy/scify/Modules/bars.kt +++ /dev/null @@ -1,10 +0,0 @@ -package chickenmanfy.scify.Modules - -class bars { - fun toggleBars() { - println("Bars") - } - fun bars() { - println("Bars") - } -} \ No newline at end of file diff --git a/src/client/kotlin/chickenmanfy/scify/Modules/fishingnotif.kt b/src/client/kotlin/chickenmanfy/scify/Modules/fishingnotif.kt deleted file mode 100644 index acba4e7..0000000 --- a/src/client/kotlin/chickenmanfy/scify/Modules/fishingnotif.kt +++ /dev/null @@ -1,10 +0,0 @@ -package chickenmanfy.scify.Modules - -class fishingnotif { - // Fishing Notification Toggle - fun toggleFishingNotif() { - } - - fun fishingNotif() { - } -} \ No newline at end of file diff --git a/src/client/kotlin/chickenmanfy/scify/Modules/livelymode.kt b/src/client/kotlin/chickenmanfy/scify/Modules/livelymode.kt deleted file mode 100644 index 65d112c..0000000 --- a/src/client/kotlin/chickenmanfy/scify/Modules/livelymode.kt +++ /dev/null @@ -1,4 +0,0 @@ -package chickenmanfy.scify.Modules - -class livelymode { -} \ No newline at end of file diff --git a/src/client/kotlin/chickenmanfy/scify/Modules/resourcepack.kt b/src/client/kotlin/chickenmanfy/scify/Modules/resourcepack.kt deleted file mode 100644 index 3ad33ae..0000000 --- a/src/client/kotlin/chickenmanfy/scify/Modules/resourcepack.kt +++ /dev/null @@ -1,170 +0,0 @@ -package chickenmanfy.scify.Modules -/* Credits to pack creators -Chickenmanfy: (2 items) -Hasty Rod -Sugar Cane Hoe - -Rotlx: (6 items) -Butcher Axe (v1) -Lily Rod -Hematite Drill -Soul Breaker Chestplate (Item Form) -Dirt Helmet (Item Form) -Nether Wart Hoe - -Repriat: (1 item) -Prismarine Blade - -Andy1515: (12 items) -Holy Charm (v1) -Golden Ring -Slingshot -Contained Soul (v1) -Contained Soul (v2) -Hematite Ring -Sword in the Ice (v3) -Dark Wizard Staff -Charm of the Hive -Pufferfish Rod -Sheep Horn -Sweet Pie - -enookfy: (2 items) -Sword of the Overgrown (Unused) -clientfy - -lemo: (5 items) -witherein ak -Sword in the Ice (v2) -susbuck -Charm of the Hive (v2) -Executioner's Axe - -Hund43rd: (9 items) -Sword in the Ice (v1) -Bone Club -Vorpal Warp (v1) -Hematite Crystal (v1) -Legends Essence -El Mundo -Axe of the Underworld (v1) -Axe of the Underworld (v2) -Axe of the Underworld (v3) - -Daniel_Sparky: (14 items) -Greg Coin -Golden Egg -Void Pickaxe (v1) -Void Pickaxe (v2) -Ruby Crystal (recoloured for amethyst, sapphire, amber, jade & quartz) (v1) -Tuna -Submerged Scrap -Ruby Crystal & Quartz Crystal (v2) -Hematite Crystal (v2) -Drill (Base) -All Drills (t1-3) -Ruby Powder - -faeblood: (1 item) -Soul Gauntlet (v1) - -Hypertywe (Resistance Gang): (3 items) -Starter Blade -Blue Pill -Red Pill - -HazardousCarrot: (1 item) -Carrot Dagger (v1) - -stevendetroit: (1 item) -Wildfire (v1) - -GamerGridYT: (1 item) -Wildfire (v2) - -dragon: (1 item) -Void Pickaxe (v3) - -ashhyy: (14+ items) -Dreya -Carrot Scythe -Corrupted Chestplate (3d & Item) -Clock Part -Magician's Cloak -Holy Charm (v2) -Hamburger -Exceedingly Shiny Diamond -Compressed Exceedingly Shiny Diamond -Carrot Dagger (v2) -Wither Soldier's Dagger (v3) -Warpol -Clock Engine -Every 3d Texture - -AA2B: (3 items) -Wither Soldier's Dagger (v1) -Wither Soldier's Dagger (v2) -Melon Boots (Item) - -Hikarify: (20+ items) -Ice Drill -Cow Rod (Cast & Uncast) -Voidcast Dagger (v1) -Zombie Lord Armor (3d & Item) -Fungus Sword -Aspect of the Mountain -Knight's Blade -Sword in the Ice (v4) -Corn -Axe of the Underworld (v4) -Pocket Clock -Soul Essence -Bullfrog Boots (v4) (Item) -Bullfrog Boots (v5) (item) -Bullfrog Boots (v6) (item) -Bullfrog Boots (3d) -Wither Skeleton Longsword (v2) -Mjolnir (32x) - -Prizzident of the United States: (32 items) -Bullfrog Boots (v1) (Item) -Bullfrog Boots (v2) (Item) -Bullfrog Boots (v3) (Item) -Shattered Soul Shield -Shattered Soul -Wither Skeleton Longsword (v1) -Final Sting -Artisan's Necklace -Butcher's Axe (v2) -Voidcast Dagger (v2) -Seasonal Axe -Burntfire Wand -Kindlefire Wand -Azure Cloak -Ice Pick -Vorpal Warp (v2) -Void Pickaxe (v4) -Robo's Favorite Yarn -Void Key (v1) -Blaze Soul -Melon Soul -Dusty Soul -Cactus Soul -Pig Soul -Banana Soul -Void Key (v2) -Lightning Dust -Wither Soldier Armor Chunk -Wither Soldier Armor Shard -Azure Gem -Amethyst, Amber, Quartz, Jade & Sapphire Gems (v3) -Genichiro Katana -Bowstaff (staff) -Bowstaff (Bow) - -Pokey Lizard: (1) -Dwarven Axe -*/ - -class resourcepack { -} \ No newline at end of file diff --git a/src/client/kotlin/chickenmanfy/scify/SciFyClient.kt b/src/client/kotlin/chickenmanfy/scify/SciFyClient.kt index 480bd17..78eab37 100644 --- a/src/client/kotlin/chickenmanfy/scify/SciFyClient.kt +++ b/src/client/kotlin/chickenmanfy/scify/SciFyClient.kt @@ -1,7 +1,7 @@ package chickenmanfy.scify import chickenmanfy.scify.Modules.Menu -import chickenmanfy.scify.Modules.hotkey +import chickenmanfy.scify.Modules.Hotkey import net.fabricmc.api.ClientModInitializer import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper @@ -15,7 +15,7 @@ import org.lwjgl.glfw.GLFW object SciFyClient : ClientModInitializer { override fun onInitializeClient() { - hotkey().hotkeys() + Hotkey().hotkeys() // Open Menu Hotkey val menu = KeyBindingHelper.registerKeyBinding( KeyBinding(