AppleSkin

AppleSkin

236M Downloads

Need a way for Fabric mods to be able to cancel AppleSkin HUD rendering

CammiePone opened this issue ยท 11 comments

commented

As a vampire, the saturation overlay provided by AppleSkin obscures the blood bar, making it difficult for vampires to know if they're full on blood.

image

commented

Ok, I think this has been (finally) fully figured out. Instructions here:

https://github.com/squeek502/AppleSkin/tree/1.16-fabric#for-mod-developers

commented

Thanks very much :)

commented

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.

commented

For Forge, if mods cancel RenderGameOverlayEvent.Pre/RenderGameOverlayEvent.Post when event.getType() == RenderGameOverlayEvent.ElementType.FOOD then AppleSkin won't render its HUD.

@SubscribeEvent(priority = EventPriority.LOW)
public void onPreRender(RenderGameOverlayEvent.Pre event)
{
if (event.getType() != RenderGameOverlayEvent.ElementType.FOOD)
return;
foodIconsOffset = ForgeIngameGui.right_height;
if (event.isCanceled())
return;

@SubscribeEvent(priority = EventPriority.LOW)
public void onRender(RenderGameOverlayEvent.Post event)
{
if (event.getType() != RenderGameOverlayEvent.ElementType.FOOD)
return;
if (event.isCanceled())
return;

commented

@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.

commented

@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?

commented

Both Haema and Bewitchment are fabric mods, we don't have that option.

commented

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.

commented

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.

commented
commented

Thanks for the info! Some more info here: https://fabricmc.net/wiki/tutorial:events