Skip to content

Commit

Permalink
Upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
dima-dencep committed Dec 8, 2023
1 parent 4c6705c commit c17d423
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ loom {
"oculus-batched-entity-rendering.mixins.json",
"mixins.oculus.compat.sodium.json",
"mixins.oculus.compat.indigo.json",
"mixins.oculus.compat.dh.json",
"mixins.oculus.compat.indium.json"
]
}
Expand Down
33 changes: 0 additions & 33 deletions src/main/java/net/coderbot/iris/mixin/gui/MixinForgeGui.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package net.coderbot.iris.mixin.gui;

import net.coderbot.iris.Iris;
import net.coderbot.iris.gui.screen.HudHideable;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.Screen;
import net.minecraftforge.client.gui.overlay.ForgeGui;
Expand All @@ -13,9 +11,6 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.ArrayList;
import java.util.List;

@Mixin(ForgeGui.class)
public class MixinForgeGui {

Expand All @@ -32,32 +27,4 @@ public Minecraft getMinecraft() {
ci.cancel();
}
}

// TODO: Move this to a more appropriate mixin
@Inject(method = "render", at = @At("RETURN"))
public void iris$displayBigSodiumWarning(GuiGraphics guiGraphics, float pFloat1, CallbackInfo ci) {
if (Iris.isSodiumInstalled()
|| Minecraft.getInstance().options.renderDebug
|| !Iris.getCurrentPack().isPresent()) {
return;
}

Font font = Minecraft.getInstance().font;

List<String> warningLines = new ArrayList<>();
warningLines.add("[" + Iris.MODNAME + "] Rubidium isn't installed; you will have poor performance.");
warningLines.add("[" + Iris.MODNAME + "] Install Rubidium if you want to run benchmarks or get higher FPS!");

for (int i = 0; i < warningLines.size(); ++i) {
String string = warningLines.get(i);

final int lineHeight = 9;
final int lineWidth = font.width(string);
final int y = 2 + lineHeight * i;

guiGraphics.fill(1, y - 1, 2 + lineWidth + 1, y + lineHeight - 1, 0x9050504E);
guiGraphics.drawString(font, string, 2, y, 0xFFFF55);
}
}

}

0 comments on commit c17d423

Please sign in to comment.