forked from Clones/Controlify
immediately fast compat
This commit is contained in:
@ -95,6 +95,9 @@ dependencies {
|
||||
modImplementation(libs.iris)
|
||||
modRuntimeOnly("org.anarres:jcpp:1.4.14")
|
||||
modRuntimeOnly("io.github.douira:glsl-transformer:2.0.0-pre9")
|
||||
// immediately-fast compat
|
||||
modImplementation(libs.immediately.fast)
|
||||
modRuntimeOnly("net.lenni0451:Reflect:1.1.0")
|
||||
|
||||
// testmod
|
||||
"testmodImplementation"(sourceSets.main.get().output)
|
||||
|
@ -22,6 +22,7 @@ Due to this being the first full release, all features from betas will be listed
|
||||
- Steam Deck support
|
||||
- Chat offset for on-screen keyboards
|
||||
- Keyboard-like movement setting for over-zealous anti-cheats
|
||||
- Immediately-fast HUD batching
|
||||
|
||||
## Compatibility
|
||||
|
||||
@ -29,6 +30,7 @@ Due to this being the first full release, all features from betas will be listed
|
||||
- YACL support
|
||||
- Sodium support
|
||||
- Iris support
|
||||
- Explicit immediately-fast support for button guide hud batching
|
||||
|
||||
## New since 0.3.0
|
||||
|
||||
|
@ -18,6 +18,7 @@ hid4java = "0.7.0"
|
||||
quilt_json5 = "1.0.3"
|
||||
sodium = "mc1.19.4-0.4.10"
|
||||
iris = "1.5.2+1.19.4"
|
||||
immediately_fast = "1.1.10+1.19.4"
|
||||
|
||||
[libraries]
|
||||
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
|
||||
@ -31,6 +32,7 @@ hid4java = { module = "org.hid4java:hid4java", version.ref = "hid4java" }
|
||||
quilt_json5 = { module = "org.quiltmc:quilt-json5", version.ref = "quilt_json5" }
|
||||
sodium = { module = "maven.modrinth:sodium", version.ref = "sodium" }
|
||||
iris = { module = "maven.modrinth:iris", version.ref = "iris" }
|
||||
immediately_fast = { module = "maven.modrinth:immediatelyfast", version.ref = "immediately_fast" }
|
||||
|
||||
test_fabric_loader = { module = "net.fabricmc:fabric-loader-junit", version.ref = "fabric_loader" }
|
||||
|
||||
|
@ -0,0 +1,24 @@
|
||||
package dev.isxander.controlify.compatibility;
|
||||
|
||||
import dev.isxander.controlify.compatibility.immediatelyfast.ImmediatelyFastCompat;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
|
||||
public class ControlifyCompat {
|
||||
public static final boolean IMMEDIATELY_FAST = mod("immediatelyfast");
|
||||
|
||||
public static void ifBeginHudBatching() {
|
||||
if (IMMEDIATELY_FAST) {
|
||||
ImmediatelyFastCompat.beginHudBatching();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ifEndHudBatching() {
|
||||
if (IMMEDIATELY_FAST) {
|
||||
ImmediatelyFastCompat.endHudBatching();
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean mod(String id) {
|
||||
return FabricLoader.getInstance().isModLoaded(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package dev.isxander.controlify.compatibility.immediatelyfast;
|
||||
|
||||
import net.raphimc.immediatelyfast.feature.batching.BatchingBuffers;
|
||||
|
||||
public class ImmediatelyFastCompat {
|
||||
public static void beginHudBatching() {
|
||||
BatchingBuffers.beginHudBatching();
|
||||
}
|
||||
|
||||
public static void endHudBatching() {
|
||||
BatchingBuffers.endHudBatching();
|
||||
}
|
||||
}
|
@ -36,7 +36,7 @@ public class ControllerHIDService implements HidServicesListener {
|
||||
services.scan();
|
||||
try {
|
||||
// wait for scan to complete on separate thread
|
||||
Thread.sleep(200);
|
||||
Thread.sleep(800);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import dev.isxander.controlify.api.buttonguide.ActionPriority;
|
||||
import dev.isxander.controlify.api.buttonguide.ButtonGuideRegistry;
|
||||
import dev.isxander.controlify.api.buttonguide.GuideActionNameSupplier;
|
||||
import dev.isxander.controlify.bindings.ControllerBinding;
|
||||
import dev.isxander.controlify.compatibility.ControlifyCompat;
|
||||
import dev.isxander.controlify.controller.Controller;
|
||||
import dev.isxander.controlify.api.event.ControlifyEvents;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -44,6 +45,8 @@ public class InGameButtonGuide implements ButtonGuideRegistry {
|
||||
if (!controller.config().showGuide || minecraft.screen != null || minecraft.options.renderDebug)
|
||||
return;
|
||||
|
||||
ControlifyCompat.ifBeginHudBatching();
|
||||
|
||||
{
|
||||
var offset = 0;
|
||||
for (var action : leftGuides) {
|
||||
@ -87,6 +90,8 @@ public class InGameButtonGuide implements ButtonGuideRegistry {
|
||||
offset += drawSize.height() + 2;
|
||||
}
|
||||
}
|
||||
|
||||
ControlifyCompat.ifEndHudBatching();
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
|
Reference in New Issue
Block a user