RATS icon indicating copy to clipboard operation
RATS copied to clipboard

Visual Mods not working when scaling is set above 100%

Open CuteWaterBeary opened this issue 2 years ago • 10 comments

Here's the same image as the readme has for comparison. Installed Harmony and RATS via VCC.

2023-04-16-00-45-12

CuteWaterBeary avatar Apr 16 '23 07:04 CuteWaterBeary

All settings are defaults. Closing and reopening editor did not fix it.

CuteWaterBeary avatar Apr 16 '23 07:04 CuteWaterBeary

Will need more information to tackle this, especially any errors occurring in the console. Assuming that you do have custom node styles enabled, try resetting your preferences (bottom right of RATS settings). Ideally, reset the console before doing this, and check for any errors upon reset/clicking into the window. Other features seem to be working, so it's odd that you don't have the node texture overrides as well.

rrazgriz avatar Apr 16 '23 20:04 rrazgriz

No errors in the console. Settings were reset and no changes.

CuteWaterBeary avatar Apr 18 '23 00:04 CuteWaterBeary

Alright. Next steps to identify the issue:

  • Ensure the image assets are present in the correct folder: image
  • Try removing RATS, relaunching the project, and re-adding after the project has launched.
  • Test in a fresh project, to identify if it's your installation or a condition in this project.

Curious what might cause this. If you're able to narrow it down to a condition that can be replicated, I can try to get it fixed. If there's no related debug messages, warnings, or errors, I'm not sure what the issue might be.

rrazgriz avatar Apr 18 '23 01:04 rrazgriz

I tried those steps before even posting the issue... The only thing I could find was that Unity 2019.4.31.f1 targets .NET framework 4.7.1 and 0Harmony is compiled targeting 4.7.2 but I'm not sure if this is an issue.

CuteWaterBeary avatar Apr 18 '23 01:04 CuteWaterBeary

Good that you ran through troubleshooting steps first. Other features are working fine, so Harmony seems to be in working order (the versioning isn't really a problem for this case).

If you haven't done so yet, I'd go to regedit, navigate to HKCU\Software\Unity Technologies\Unity Editor 5.x, and delete the key starting with RATS.PreferencesSerialized (it's where Unity stores EditorPrefs variables). That should hard clear any bad settings you might've picked up.

Otherwise, I'm not sure how to replicate this, as I don't know anyone else with the issue, other features still work, and it seems to be machine-wide for you. It'd seem to indicate a settings issue, so hopefully clearing the registry key works.

rrazgriz avatar Apr 18 '23 03:04 rrazgriz

Amazing! That fixed it. I would never have guessed. Thank you for making this plugin!

CuteWaterBeary avatar Apr 18 '23 04:04 CuteWaterBeary

Ok... so its happening again but I narrowed down the issue:

I don't think it had to do with the registry keys but rather with scaling as during the time I checked for it working I had made my screen resolution much lower and scaling was at 100%.

Works: 2023-04-17-22-28-31

Broke: 2023-04-17-22-30-26

Works with this setting no matter what the windows scaling is. 2023-04-17-22-31-38

All would be good, however, I keep the scaling at 150% for readability which ends up breaking it.

CuteWaterBeary avatar Apr 18 '23 05:04 CuteWaterBeary

A-ha, good catch! Unity often uses different assets at higher DPI scales, so this makes sense.

I'll see if it's possible to fix this elegantly. Thanks for being diligent in tracking it down.

rrazgriz avatar Apr 18 '23 18:04 rrazgriz

It looks like this occurs because of GUIStyleState.scaledBackgrounds. I'm going to be doing a bit of a refactor of the texture handling code, so I can add support for the 2x-scaled high-dpi background.

rrazgriz avatar Apr 18 '23 18:04 rrazgriz