Status Effect Timer

Status Effect Timer

275k Downloads

Moving status icon with HUDTweaks does not move timer overlay

Phoenix-Starlight opened this issue ยท 6 comments

commented

The text is not attached at all, causing issues with HUDTweaks when you adjust its position. What it should be doing is being the child of it and therefore following where ever it goes.

commented

I'm assuming HUDTweaks "moves" the status icon. It most probably cancels the vanilla icon drawing code, substituting its own. If that is the case, there is nothing I can do to handle this case. But if the source of HUDTweaks is available, I might be able to look at it and see if there is anything I can do to compensate.

commented

https://github.com/burgerguy/HUDTweaks
Here is the source for it.

commented

The issue arises here:
https://github.com/burgerguy/HUDTweaks/blob/ee5d9dad70bd32aca52f9623acd1d2f2892713a9/src/main/java/com/github/burgerguy/hudtweaks/mixin/InGameHudMixin.java#L163

HUDTweaks has this code:

	@Inject(method = "renderStatusEffectOverlay", at = @At(value = "RETURN"))
	private void renderStatusEffectOverlayReturn(MatrixStack matrices, CallbackInfo callbackInfo) {
		RenderStateUtil.finishRender(DefaultStatusEffectsElement.IDENTIFIER, matrices);
	}

which apparently happens before StatusEffectTimers's @Inject(method = "renderStatusEffectOverlay", at = @At("TAIL")), so the popped matrices are used to draw the SET overlay.

I'm guessing it might be able to tell Fabric to order these mixins differently, but I don't know how. Perhaps changing SET's Inject to RETURN instead of TAIL, and setting a suitable priority.

I can't say when I will have time to be able to drill down in Fabric APIs. to figure that out, though. :(

commented

I don't mind waiting awhile for you to figure out how to fix it.

commented

Note to self: @Mixin has a priority field. Default value is 1000; lower value gets applied first. Presumably, this applies to the entire mixin class, so no change wrt TAIL/RETURN is needed.

commented

The Mixin priority did the trick.

This is fixed in 9b1ed16.

I will release a new bugfix version 1.1.1 across all supported Minecraft versions with this fix.