Need a way for Fabric mods to be able to cancel AppleSkin HUD rendering
CammiePone opened this issue ยท 11 comments
Ok, I think this has been (finally) fully figured out. Instructions here:
https://github.com/squeek502/AppleSkin/tree/1.16-fabric#for-mod-developers
It does the same thing with Haema - it'd be useful to have an API that exposed ShowSaturationOverlay
/ShowExhaustionOverlay
/etc. events, that mods can use to cancel overlays.
For Forge, if mods cancel RenderGameOverlayEvent.Pre
/RenderGameOverlayEvent.Post
when event.getType() == RenderGameOverlayEvent.ElementType.FOOD
then AppleSkin won't render its HUD.
AppleSkin/java/squeek/appleskin/client/HUDOverlayHandler.java
Lines 39 to 48 in e32016d
AppleSkin/java/squeek/appleskin/client/HUDOverlayHandler.java
Lines 62 to 69 in e32016d
@williambl @MoriyaShiine I'm open to any PRs that would add a way to address this for Fabric. I basically am just doing maintenance-only stuff for my mods now, so it's not likely that I'll get around to this sort of thing myself.
@williambl @MoriyaShiine I'm open to any PRs that would add a way to address this for Fabric. I basically am just doing maintenance-only stuff for my mods now, so it's not likely that I'll get around to this sort of thing myself.
i am very happy to help, just add config?
Not a config. Other mods need to be able to control when AppleSkin's HUD rendering happens, like in #94 (comment) but for Fabric. Not sure how Fabric mods typically handle cross-mod interactions like that, though.
Not a config. Other mods need to be able to control when AppleSkin's HUD rendering happens, like in #94 (comment) but for Fabric. Not sure how Fabric mods typically handle cross-mod interactions like that, though.
Maybe we could a event bus like forge, other mods could cancel event or change something.
A common way for mods to do it in fabric is to create an event, like so:
https://github.com/williambl/haema/blob/bewitchment/src/main/kotlin/com/williambl/haema/api/BloodDrinkingEvents.kt
Thanks for the info! Some more info here: https://fabricmc.net/wiki/tutorial:events