Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
//? if >= 1.21.11
import org.polyfrost.compose.minecraft.render.blaze.BlazeHud;
import org.polyfrost.compose.minecraft.render.gl.GlHost;
import org.polyfrost.compose.minecraft.mc.McItemIcons;
import org.polyfrost.oneconfig.internal.ui.compose.impls.HudEditorUIScreen;
import org.polyfrost.oneconfig.internal.ui.compose.impls.OneConfigUIScreen;
import org.polyfrost.oneconfig.internal.ui.hud.BuiltinHudRegistrar;
Expand Down Expand Up @@ -249,13 +250,14 @@ public static void prepareHud() {

if (HudManager.isConfigUiOpen) {
HudManager.INSTANCE.prepare(sw, sh);
McItemIcons.renderPending();
HudManager.invalidate();
return;
}
//? if >= 1.21.11 {
if (HudManager.INSTANCE.beginFrame(sw, sh, null, true, true)) BlazeHud.markDirty();
if (HudManager.INSTANCE.beginFrame(sw, sh, McItemIcons::renderPending, true, true)) BlazeHud.markDirty();
//?} else {
/*if (HudManager.INSTANCE.beginFrame(sw, sh, null, false)) {
/*if (HudManager.INSTANCE.beginFrame(sw, sh, McItemIcons::renderPending, false)) {
GlHost.INSTANCE.drawHudGl((ctx, volatileCtx) -> {
HudManager.INSTANCE.render(ctx, sw, sh, volatileCtx);
return Unit.INSTANCE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import org.polyfrost.oneconfig.internal.OneConfigConfig
import org.polyfrost.oneconfig.internal.ThemeConfig
import org.polyfrost.oneconfig.internal.ui.components.BackdropUsers
import org.polyfrost.oneconfig.internal.ui.components.RetainedVisibility
import org.polyfrost.compose.minecraft.mc.McItemIcons
import org.polyfrost.compose.minecraft.screen.ComposeScreen
import org.polyfrost.oneconfig.internal.ui.compose.OneConfigComposeHooks
//? if >= 1.21.11
Expand Down Expand Up @@ -73,7 +74,7 @@ class HudEditorUIScreen private constructor() : ComposeScreen(options = OneConfi
HudManager.inWorld = false
HudManager.guiScreenWidth = sw
HudManager.guiScreenHeight = sh
return HudManager.beginFrame(sw, sh, null, true, true)
return HudManager.beginFrame(sw, sh, McItemIcons::renderPending, true, true)
}

// in a world the game's HUD pass draws the HUDs before the blur, so off it they're drawn the same way here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import org.apache.logging.log4j.LogManager
import org.polyfrost.compose.backend.PolyCanvas
import org.polyfrost.compose.backend.PolyCompose
import org.polyfrost.compose.host.LocalComposeOptions
import org.polyfrost.compose.minecraft.mc.McItemIcons
import org.polyfrost.compose.render.PolyBitmap
import org.polyfrost.compose.render.PolyGlyphPage
import org.polyfrost.compose.render.PolyRenderer
Expand Down Expand Up @@ -476,6 +477,7 @@ class OneConfigUIScreen @JvmOverloads constructor(
HudManager.guiScreenWidth = sw
HudManager.guiScreenHeight = sh
HudManager.prepare(sw, sh)
McItemIcons.renderPending()
}
HudEditorViewport.update(Platform.screen().windowWidth(), Platform.screen().windowHeight())
//? if > 1.8.9 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import org.jetbrains.annotations.MustBeInvokedByOverriders
import org.polyfrost.compose.composables.PolyModifier
import org.polyfrost.compose.composables.background
import org.polyfrost.compose.composables.border
import org.polyfrost.compose.host.LocalContentScale
import org.polyfrost.compose.layout.PolyAlign
import org.polyfrost.compose.render.PolyColor
import org.polyfrost.compose.runtime.PolyComposeRuntime
Expand Down Expand Up @@ -1695,7 +1696,7 @@ public abstract class Hud(
get() = _runtime ?: PolyComposeRuntime().also {
_runtime = it
it.setContent {
CompositionLocalProvider(LocalHud provides this) {
CompositionLocalProvider(LocalHud provides this, LocalContentScale provides effectiveScale) {
Content()
}
}
Expand Down
Loading