Menu almost complete. All that I need to do is add colours to see what is enabled.
This commit is contained in:
@@ -10,7 +10,7 @@ I then remembered when one of my friends (BearCat865) suggested making a Dungeon
|
|||||||
---
|
---
|
||||||
# Roadmap
|
# Roadmap
|
||||||
_Currently in super beta so don't expect something working for a while._
|
_Currently in super beta so don't expect something working for a while._
|
||||||
- Right shift menu to enable and disable mods (50%)
|
- Right shift menu to enable and disable mods (90%)
|
||||||
- Health & Food bars replaced with dynamic bar similar to EXP bar (0%)
|
- Health & Food bars replaced with dynamic bar similar to EXP bar (0%)
|
||||||
- Custom GUIs (0%)
|
- Custom GUIs (0%)
|
||||||
- Built-in guide (CANCELED) **This feature is being worked on in a different mod called "Mythicfy", so it will not be added to this one. We recommend you download that mod.**
|
- Built-in guide (CANCELED) **This feature is being worked on in a different mod called "Mythicfy", so it will not be added to this one. We recommend you download that mod.**
|
||||||
|
|||||||
@@ -2,37 +2,81 @@ package chickenmanfy.scify.Modules
|
|||||||
|
|
||||||
import net.fabricmc.api.EnvType
|
import net.fabricmc.api.EnvType
|
||||||
import net.fabricmc.api.Environment
|
import net.fabricmc.api.Environment
|
||||||
|
import net.minecraft.client.gui.DrawContext
|
||||||
import net.minecraft.client.gui.screen.Screen
|
import net.minecraft.client.gui.screen.Screen
|
||||||
import net.minecraft.client.gui.tooltip.Tooltip
|
import net.minecraft.client.gui.tooltip.Tooltip
|
||||||
import net.minecraft.client.gui.widget.ButtonWidget
|
import net.minecraft.client.gui.widget.ButtonWidget
|
||||||
import net.minecraft.text.Text
|
import net.minecraft.text.Text
|
||||||
|
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
class Menu : Screen(Text.literal("My tutorial screen")) {
|
class Menu : Screen(Text.literal("SciFy Menu")) {
|
||||||
var button1: ButtonWidget? = null
|
private var dynamicBars: ButtonWidget? = null
|
||||||
var button2: ButtonWidget? = null
|
private var fishingNotif: ButtonWidget? = null
|
||||||
|
private var warpHotkeys: ButtonWidget? = null
|
||||||
|
private var autoWelcome: ButtonWidget? = null
|
||||||
|
private var livelyMode: ButtonWidget? = null
|
||||||
|
private var resourcePack: ButtonWidget? = null
|
||||||
|
|
||||||
init {
|
init {
|
||||||
// The parameter is the title of the screen,
|
// The parameter is the title of the screen,
|
||||||
// which will be narrated when you enter the screen.
|
// which will be narrated when you enter the screen.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun render(context: DrawContext, mouseX: Int, mouseY: Int, delta: Float) {
|
||||||
|
super.render(context, mouseX, mouseY, delta)
|
||||||
|
context.drawCenteredTextWithShadow(
|
||||||
|
textRenderer,
|
||||||
|
Text.literal("SciFy Menu"),
|
||||||
|
width / 2,
|
||||||
|
5,
|
||||||
|
0xff00ff
|
||||||
|
)
|
||||||
|
}
|
||||||
public override fun init() {
|
public override fun init() {
|
||||||
button1 = ButtonWidget.builder(Text.literal("Button 1")) { button: ButtonWidget? ->
|
|
||||||
println("You clicked button1!")
|
dynamicBars = ButtonWidget.builder(Text.literal("Dynamic Health")) {
|
||||||
|
bars().toggleBars() // Call the function toggleBars() from the bars.kt module
|
||||||
}
|
}
|
||||||
.dimensions(width / 2 - 205, 20, 200, 20)
|
.dimensions(width / 2 - 205, 20, 200, 20)
|
||||||
.tooltip(Tooltip.of(Text.literal("Tooltip of button1")))
|
.tooltip(Tooltip.of(Text.literal("Health bar similar to XP")))
|
||||||
.build()
|
.build()
|
||||||
button2 = ButtonWidget.builder(Text.literal("Button 2")) { button: ButtonWidget? ->
|
fishingNotif = ButtonWidget.builder(Text.literal("Fishing Notifications")) {
|
||||||
println("You clicked button2!")
|
fishingnotif().toggleFishingNotif() // Call the function toggleFishingNotif() from the fishingnotif.kt module
|
||||||
}
|
}
|
||||||
.dimensions(width / 2 + 5, 20, 200, 20)
|
.dimensions(width / 2 + 5, 20, 200, 20)
|
||||||
.tooltip(Tooltip.of(Text.literal("Tooltip of button2")))
|
.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
|
||||||
|
}
|
||||||
|
.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
|
||||||
|
}
|
||||||
|
.dimensions(width / 2 + 5, 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
|
||||||
|
}
|
||||||
|
.dimensions(width / 2 - 205, 100, 200, 20)
|
||||||
|
.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
|
||||||
|
}
|
||||||
|
.dimensions(width / 2 + 5, 100, 200, 20)
|
||||||
|
.tooltip(Tooltip.of(Text.literal("Toggles the community resource pack.")))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
addDrawableChild(button1)
|
addDrawableChild(dynamicBars)
|
||||||
addDrawableChild(button2)
|
addDrawableChild(fishingNotif)
|
||||||
|
addDrawableChild(warpHotkeys)
|
||||||
|
addDrawableChild(autoWelcome)
|
||||||
|
addDrawableChild(livelyMode)
|
||||||
|
addDrawableChild(resourcePack)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,10 @@
|
|||||||
package chickenmanfy.scify.Modules
|
package chickenmanfy.scify.Modules
|
||||||
|
|
||||||
class bars {
|
class bars {
|
||||||
|
fun toggleBars() {
|
||||||
|
println("Bars")
|
||||||
|
}
|
||||||
|
fun bars() {
|
||||||
|
println("Bars")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,10 @@
|
|||||||
package chickenmanfy.scify.Modules
|
package chickenmanfy.scify.Modules
|
||||||
|
|
||||||
class fishingnotif {
|
class fishingnotif {
|
||||||
|
// Fishing Notification Toggle
|
||||||
|
fun toggleFishingNotif() {
|
||||||
|
}
|
||||||
|
|
||||||
|
fun fishingNotif() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
9
src/client/kotlin/chickenmanfy/scify/Modules/hotkey.kt
Normal file
9
src/client/kotlin/chickenmanfy/scify/Modules/hotkey.kt
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
package chickenmanfy.scify.Modules
|
||||||
|
|
||||||
|
import net.fabricmc.fabric.impl.command.client.ClientCommandInternals.executeCommand
|
||||||
|
|
||||||
|
class hotkey {
|
||||||
|
fun hotkey() {
|
||||||
|
// TODO: Implement hotkeys in this file.
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,6 +14,7 @@ import org.lwjgl.glfw.GLFW
|
|||||||
|
|
||||||
object SciFyClient : ClientModInitializer {
|
object SciFyClient : ClientModInitializer {
|
||||||
override fun onInitializeClient() {
|
override fun onInitializeClient() {
|
||||||
|
// Open Menu Hotkey
|
||||||
val menu = KeyBindingHelper.registerKeyBinding(
|
val menu = KeyBindingHelper.registerKeyBinding(
|
||||||
KeyBinding(
|
KeyBinding(
|
||||||
"Menu",
|
"Menu",
|
||||||
@@ -22,6 +23,8 @@ object SciFyClient : ClientModInitializer {
|
|||||||
"SciFy"
|
"SciFy"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
ClientTickEvents.END_CLIENT_TICK.register(ClientTickEvents.EndTick { client: MinecraftClient ->
|
ClientTickEvents.END_CLIENT_TICK.register(ClientTickEvents.EndTick { client: MinecraftClient ->
|
||||||
while (menu.wasPressed()) {
|
while (menu.wasPressed()) {
|
||||||
// Debug
|
// Debug
|
||||||
|
|||||||
Reference in New Issue
Block a user