Finish hotkeys, clean up menu code.
This commit is contained in:
@@ -17,3 +17,4 @@ _Currently in super beta so don't expect something working for a while._
|
||||
- Auto-Welcome (20%) **WARNING: This feature may prove to be annoying, in which case we will remove it.**
|
||||
- City NPCs (Lively Mode) (0%)
|
||||
- Fishing notifications (0%)
|
||||
- Macros (100%)
|
||||
@@ -48,15 +48,15 @@ class Menu : Screen(Text.literal("SciFy Menu")) {
|
||||
.tooltip(Tooltip.of(Text.literal("Fishing Notifications")))
|
||||
.build()
|
||||
warpHotkeys = ButtonWidget.builder(Text.literal("Toggle hotkeys")) {
|
||||
fishingnotif().toggleFishingNotif() // Call the function toggleFishingNotif() from the fishingnotif.kt module
|
||||
// I don't think we actually need this module at all. TODO: replace with something else
|
||||
}
|
||||
.dimensions(width / 2 - 205, 60, 200, 20)
|
||||
.tooltip(Tooltip.of(Text.literal("Enable/Disable hotkeys.")))
|
||||
.build()
|
||||
autoWelcome = ButtonWidget.builder(Text.literal("Auto-Welcome")) {
|
||||
fishingnotif().toggleFishingNotif() // Call the function toggleFishingNotif() from the fishingnotif.kt module
|
||||
autowelcome().toggleAutoWelcome() // Call the function toggleAutoWelcome() from the fishingnotif.kt module
|
||||
}
|
||||
.dimensions(width / 2 + 5, 60, 200, 20)
|
||||
.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)")) {
|
||||
@@ -66,17 +66,17 @@ class Menu : Screen(Text.literal("SciFy Menu")) {
|
||||
.tooltip(Tooltip.of(Text.literal("Replaces Villagers with player NPCs")))
|
||||
.build()
|
||||
resourcePack = ButtonWidget.builder(Text.literal("Toggle Resource Pack")) {
|
||||
fishingnotif().toggleFishingNotif() // Call the function toggleFishingNotif() from the fishingnotif.kt module
|
||||
// TODO: Implement Resource pack
|
||||
}
|
||||
.dimensions(width / 2 + 5, 100, 200, 20)
|
||||
.dimensions(width / 2 + 5, 60, 200, 20)
|
||||
.tooltip(Tooltip.of(Text.literal("Toggles the community resource pack.")))
|
||||
.build()
|
||||
|
||||
addDrawableChild(dynamicBars)
|
||||
addDrawableChild(fishingNotif)
|
||||
addDrawableChild(warpHotkeys)
|
||||
//addDrawableChild(warpHotkeys)
|
||||
addDrawableChild(autoWelcome)
|
||||
addDrawableChild(livelyMode)
|
||||
//addDrawableChild(livelyMode)
|
||||
addDrawableChild(resourcePack)
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,10 @@
|
||||
package chickenmanfy.scify.Modules
|
||||
|
||||
import net.minecraft.client.MinecraftClient
|
||||
import net.minecraft.text.Text
|
||||
|
||||
fun autowelcome() {
|
||||
val minecraftClient = MinecraftClient.getInstance()
|
||||
val message: Text = Text.literal("Hi!")
|
||||
if (minecraftClient?.player != null) {
|
||||
minecraftClient.player!!.sendMessage(message, false)
|
||||
} else {
|
||||
println("MinecraftClient or player is null!")
|
||||
|
||||
class autowelcome() {
|
||||
fun toggleAutoWelcome() {
|
||||
}
|
||||
fun autoWelcome() {
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,57 @@
|
||||
package chickenmanfy.scify.Modules
|
||||
|
||||
import net.fabricmc.fabric.impl.command.client.ClientCommandInternals.executeCommand
|
||||
import io.netty.buffer.ByteBuf
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents
|
||||
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper
|
||||
import net.minecraft.client.MinecraftClient
|
||||
import net.minecraft.client.option.KeyBinding
|
||||
import net.minecraft.client.util.InputUtil
|
||||
import net.minecraft.network.PacketByteBuf
|
||||
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket
|
||||
import net.minecraft.text.Text
|
||||
import org.lwjgl.glfw.GLFW
|
||||
|
||||
|
||||
class hotkey {
|
||||
fun hotkey() {
|
||||
// TODO: Implement hotkeys in this file.
|
||||
fun hotkeys() {
|
||||
|
||||
// Register Keys
|
||||
val warp = KeyBindingHelper.registerKeyBinding(
|
||||
KeyBinding(
|
||||
"Open Warp Menu (/warp)",
|
||||
InputUtil.Type.KEYSYM,
|
||||
GLFW.GLFW_KEY_V,
|
||||
"SciFy"
|
||||
)
|
||||
)
|
||||
val enderchest = KeyBindingHelper.registerKeyBinding(
|
||||
KeyBinding(
|
||||
"Open Ender Chest (/ec)",
|
||||
InputUtil.Type.KEYSYM,
|
||||
GLFW.GLFW_KEY_Z,
|
||||
"SciFy"
|
||||
)
|
||||
)
|
||||
val guide = KeyBindingHelper.registerKeyBinding(
|
||||
KeyBinding(
|
||||
"Open Guide Book (/guide)",
|
||||
InputUtil.Type.KEYSYM,
|
||||
GLFW.GLFW_KEY_SEMICOLON,
|
||||
"SciFy"
|
||||
)
|
||||
)
|
||||
ClientTickEvents.END_CLIENT_TICK.register(ClientTickEvents.EndTick { client: MinecraftClient ->
|
||||
while (warp.wasPressed()) {
|
||||
MinecraftClient.getInstance().networkHandler!!.sendChatCommand("warp")
|
||||
}
|
||||
while (enderchest.wasPressed()) {
|
||||
MinecraftClient.getInstance().networkHandler!!.sendChatCommand("ec")
|
||||
}
|
||||
while (guide.wasPressed()) {
|
||||
MinecraftClient.getInstance().networkHandler!!.sendChatCommand("guide")
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package chickenmanfy.scify
|
||||
|
||||
import chickenmanfy.scify.Modules.Menu
|
||||
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
|
||||
@@ -14,6 +15,7 @@ import org.lwjgl.glfw.GLFW
|
||||
|
||||
object SciFyClient : ClientModInitializer {
|
||||
override fun onInitializeClient() {
|
||||
hotkey().hotkeys()
|
||||
// Open Menu Hotkey
|
||||
val menu = KeyBindingHelper.registerKeyBinding(
|
||||
KeyBinding(
|
||||
|
||||
Reference in New Issue
Block a user