forked from Clones/Controlify
immediately fast compat
This commit is contained in:
@ -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