2026-07-05 19:26:33 +02:00
|
|
|
package de.fullrisk.citrusDev.client;
|
|
|
|
|
|
2026-07-08 15:34:04 +02:00
|
|
|
import de.fullrisk.citrusDev.Config;
|
2026-07-06 18:52:02 +02:00
|
|
|
import de.fullrisk.citrusDev.UI.Module_FPS;
|
2026-07-05 21:14:50 +02:00
|
|
|
import de.fullrisk.citrusDev.UI.MyScreen;
|
2026-07-06 18:52:02 +02:00
|
|
|
import de.fullrisk.citrusDev.UI.OverviewScreen;
|
|
|
|
|
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;
|
2026-07-06 18:52:02 +02:00
|
|
|
private static KeyMapping openOverviewKey;
|
2026-07-05 19:26:33 +02:00
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onInitializeClient() {
|
2026-07-06 18:52:02 +02:00
|
|
|
Module_FPS.register();
|
|
|
|
|
|
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",
|
|
|
|
|
GLFW.GLFW_KEY_G,
|
|
|
|
|
category
|
|
|
|
|
));
|
2026-07-06 18:52:02 +02:00
|
|
|
openOverviewKey = KeyMappingHelper.registerKeyMapping(new KeyMapping(
|
|
|
|
|
"key.citrus-dev.open_ui",
|
|
|
|
|
GLFW.GLFW_KEY_RIGHT_SHIFT,
|
|
|
|
|
category
|
|
|
|
|
));
|
2026-07-05 19:26:33 +02:00
|
|
|
|
|
|
|
|
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
2026-07-06 18:52:02 +02:00
|
|
|
Module_FPS.tick(); // update every tick, unconditionally
|
2026-07-05 19:26:33 +02:00
|
|
|
while (openScreenKey.consumeClick()) {
|
2026-07-08 15:34:04 +02:00
|
|
|
client.setScreen(new MyScreen(null)); // always general tab
|
2026-07-05 19:26:33 +02:00
|
|
|
}
|
2026-07-06 18:52:02 +02:00
|
|
|
|
|
|
|
|
while (openOverviewKey.consumeClick()) {
|
2026-07-08 15:34:04 +02:00
|
|
|
String lastModule = Config.get().lastModule;
|
|
|
|
|
client.setScreen(new MyScreen(lastModule)); // switch no longer even needed
|
2026-07-06 18:52:02 +02:00
|
|
|
}
|
2026-07-08 15:34:04 +02:00
|
|
|
|
2026-07-05 19:26:33 +02:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|