Shoulder Surfing Reloaded

Shoulder Surfing Reloaded

20M Downloads

[BUG] [1.19] HUD elements get offset weirdly when the crosshair is disabled by other mods

TsukiTheDwagon opened this issue ยท 3 comments

commented

Describe the bug
This bug seems likely related to issue #78 but I think I may have found the root cause of the issue.

From what it looks like, when the third person crosshair is in dynamic mode and another mod disables the crosshair on the HUD, shoulder surfing ends up offsetting the entire HUD as it's unable to find the crosshair (as it was disabled).

To Reproduce
Steps to reproduce the behavior:

  1. Install the fabric mod Dynamic Crosshair. It's not the only mod that might cause this issue, but I've found it gives a reliable way to test and reproduce this behavior.
  2. Hold a snowball to allow the crosshair in the third person view to shift to the side.
  3. Open your inventory. The default behavior of the Dynamic Crosshair mod is to hide the crosshair from the HUD when a GUI is opened and this should cause the GUI background to be offset.

Here's a second set of steps I've also found to reproduce the behavior:

  1. The Dynamic Crosshair mod should be installed.
  2. Go into the Shoulder Surfing config file and force the crosshair mode to dynamic.
  3. Look off into the distance in a way that you're not looking at a block as to not enable the crosshair, but also cause Shoulder Surfing to shift the crosshair anyways.
  4. Notice how the HUD shifts to the side when you do this.

Expected behavior
The HUD should not shift when the crosshair is hidden from the screen by another mod.

Screenshots
Screenshot of issue
Notice how the crosshair is hidden from the screen and how the health, hunger, and xp bars along the bottom are offset, alongside the rest of the UI.

Logs
This issue doesn't generate any logs, but I'll attach an F3+C crash log anyways to show my install's configuration.
F3+C crash log on mclo.gs

Other mods
Better HUD (I don't use it, but see issue #78)

Additional information
This bug might be fixable by checking to see if the crosshair is hidden from the screen while the crosshair mode is dynamic, and temporarily disabling the code responsible for shifting the crosshair to the side while keeping the behavior of the player targeting wherever they would be looking in first person.

commented

The problem is that Dynamic Crosshair overrides the hook to reset the crosshair position. I will see what i can do.

commented

When you uploaded the new fabric version to CurseForge it seems you labeled it as forge even though the filename has fabric in it.

Might want to fix that.

commented

Thanks