rrazgriz / RATS

Harmony-based Unity Editor QOL
https://vpm.razgriz.one
MIT License
80 stars 7 forks source link

Visual Mods not working when scaling is set above 100% #9

Open CuteWaterBeary opened 1 year ago

CuteWaterBeary commented 1 year ago

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

2023-04-16-00-45-12

CuteWaterBeary commented 1 year ago

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

rrazgriz commented 1 year ago

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.

CuteWaterBeary commented 1 year ago

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

rrazgriz commented 1 year ago

Alright. Next steps to identify the issue:

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.

CuteWaterBeary commented 1 year ago

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.

rrazgriz commented 1 year ago

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.

CuteWaterBeary commented 1 year ago

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

CuteWaterBeary commented 1 year ago

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.

rrazgriz commented 1 year ago

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 commented 1 year ago

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.