Skip to content

Commit

Permalink
Draw map UI even if F3 is up
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeltumn committed Oct 27, 2024
1 parent 4003276 commit 5a456e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,26 @@ public abstract class GuiHookMixin {
* Adds a new rendered element to the UI with the given condition and layer.
*/
@Unique
private void noxesium$addRenderLayer(LayeredDraw.Layer layer, Supplier<Boolean> condition) {
private void noxesium$addRenderLayer(LayeredDraw.Layer layer, boolean removeIfDebugScreen, Supplier<Boolean> condition) {
var overlay = new LayeredDraw();
overlay.add(layer);
this.layers.add(overlay, () ->
// Check that the main GUI is not hidden
!Minecraft.getInstance().options.hideGui &&
// Check that the debug screen is not up
!this.getDebugOverlay().showDebugScreen() &&
// Check that the condition is met
condition.get()
// Check that the main GUI is not hidden
!Minecraft.getInstance().options.hideGui &&
// Check that the debug screen is not up
(!removeIfDebugScreen || !this.getDebugOverlay().showDebugScreen()) &&
// Check that the condition is met
condition.get()
);
}

@Inject(method = "<init>", at = @At("TAIL"))
public void onInit(Minecraft minecraft, CallbackInfo ci) {
// Render map at the bottom so the rest goes on top, this goes after vanilla so we render on top of e.g. chat
noxesium$addRenderLayer(ElementManager.getInstance(MapUiWrapper.class)::render, () -> NoxesiumMod.getInstance().getConfig().shouldRenderMapsInUi());
noxesium$addRenderLayer(ElementManager.getInstance(TextHudOverlayWrapper.class)::render, () -> NoxesiumMod.getInstance().getConfig().showFpsOverlay ||
NoxesiumMod.getInstance().getConfig().showGameTimeOverlay ||
NoxesiumMod.getInstance().getConfig().enableQibSystemDebugging
noxesium$addRenderLayer(ElementManager.getInstance(MapUiWrapper.class)::render, false, () -> NoxesiumMod.getInstance().getConfig().shouldRenderMapsInUi());
noxesium$addRenderLayer(ElementManager.getInstance(TextHudOverlayWrapper.class)::render, true, () -> NoxesiumMod.getInstance().getConfig().showFpsOverlay ||
NoxesiumMod.getInstance().getConfig().showGameTimeOverlay ||
NoxesiumMod.getInstance().getConfig().enableQibSystemDebugging
);
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fabric_version=0.106.1+1.21.2
mod_version=2.4.1

# Mod dependencies
sodium = 0.6.0-beta.3+mc1.21.2
sodium = mc1.21.2-0.6.0-beta.3-fabric
iris = 1.8.0-beta.1+1.21-fabric
modmenu = 12.0.0-beta.1

Expand Down

0 comments on commit 5a456e0

Please sign in to comment.