2026-07-05 19:26:33 +02:00
|
|
|
package de.fullrisk.citrusDev.client;
|
|
|
|
|
|
2026-07-11 09:53:19 +02:00
|
|
|
|
2026-07-08 15:34:04 +02:00
|
|
|
import de.fullrisk.citrusDev.Config;
|
2026-07-11 14:58:57 +02:00
|
|
|
import de.fullrisk.citrusDev.UI.*;
|
2026-07-06 18:52:02 +02:00
|
|
|
import io.wispforest.owo.ui.hud.Hud;
|
2026-07-05 19:26:33 +02:00
|
|
|
import net.fabricmc.api.ClientModInitializer;
|
|
|
|
|
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
|
|
|
|
import net.fabricmc.fabric.api.client.keymapping.v1.KeyMappingHelper;
|
|
|
|
|
import net.minecraft.client.KeyMapping;
|
|
|
|
|
import net.minecraft.resources.Identifier;
|
|
|
|
|
import org.lwjgl.glfw.GLFW;
|
|
|
|
|
|
|
|
|
|
public class CitrusDevClient implements ClientModInitializer {
|
|
|
|
|
|
|
|
|
|
private static KeyMapping openScreenKey;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onInitializeClient() {
|
2026-07-06 18:52:02 +02:00
|
|
|
Module_FPS.register();
|
2026-07-11 10:46:47 +02:00
|
|
|
Module_KeyStrokes.register();
|
2026-07-11 14:58:57 +02:00
|
|
|
Module_Coords.register();
|
2026-07-06 18:52:02 +02:00
|
|
|
|
2026-07-05 19:26:33 +02:00
|
|
|
KeyMapping.Category category = KeyMapping.Category.register(
|
|
|
|
|
Identifier.fromNamespaceAndPath("citrus-dev", "general"));
|
|
|
|
|
|
|
|
|
|
openScreenKey = KeyMappingHelper.registerKeyMapping(new KeyMapping(
|
|
|
|
|
"key.citrus-dev.open_screen",
|
2026-07-06 18:52:02 +02:00
|
|
|
GLFW.GLFW_KEY_RIGHT_SHIFT,
|
|
|
|
|
category
|
|
|
|
|
));
|
2026-07-05 19:26:33 +02:00
|
|
|
|
|
|
|
|
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
2026-07-11 09:53:19 +02:00
|
|
|
if (client.player != null && !client.isPaused()) {
|
|
|
|
|
PlaytimeTracker.tick();
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-11 10:46:47 +02:00
|
|
|
Module_FPS.tick();
|
|
|
|
|
Module_KeyStrokes.tick();
|
2026-07-11 14:58:57 +02:00
|
|
|
Module_Coords.tick();
|
2026-07-06 18:52:02 +02:00
|
|
|
|
2026-07-11 12:30:16 +02:00
|
|
|
while (openScreenKey.consumeClick()) {
|
|
|
|
|
if (client.player != null && client.player.isShiftKeyDown()) {
|
|
|
|
|
String lastModule = Config.get().lastModule;
|
|
|
|
|
client.setScreen(new MyScreen(lastModule)); // sneak + RShift: last module
|
|
|
|
|
} else {
|
|
|
|
|
client.setScreen(new MyScreen(null)); // RShift alone: general tab
|
|
|
|
|
}
|
2026-07-06 18:52:02 +02:00
|
|
|
}
|
2026-07-05 19:26:33 +02:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|