BepInEx.ConfigurationManager icon indicating copy to clipboard operation
BepInEx.ConfigurationManager copied to clipboard

Custom GUI Style / GUI scaling

Open 4Magma opened this issue 3 years ago • 16 comments

How can i change font size, color and background color? BCM appears in white on grey in small font size.

4Magma avatar Mar 24 '21 10:03 4Magma

You have to compile your own build with a custom gui skin, or make a plugin that hooks config manager and change the gui skin from there. Something like this https://github.com/ManlyMarco/RuntimeUnityEditor/blob/master/RuntimeUnityEditor/UI/InterfaceMaker.cs#L43

ManlyMarco avatar Mar 24 '21 20:03 ManlyMarco

Isn't there a easier way? I use BCM with Valheim, but the small white text on gray is bad to read. The Pic on the intro page shows BCM in white on black.

4Magma avatar Mar 24 '21 22:03 4Magma

At the moment the game's own skin is used, there's no built in way to change this. The only way would be to change the code to use a custom skin like in runtime editor.

ManlyMarco avatar Mar 26 '21 13:03 ManlyMarco

I'm interested in this too, every UI is very small on my QHD panel. I got the source code, now I'm just wondering how I should override the GUISkin.

Baccanno avatar Apr 15 '21 21:04 Baccanno

You would have to recalculate sizes of at least fonts for all the different gui styles based on resolution. Create a copy of GUI.skin, make your changes, and then set your copy as the skin to use on every ongui call.

ManlyMarco avatar Apr 16 '21 17:04 ManlyMarco

I would also have to do it for all plugins additional UI calls? It does not seem manageable. Maybe going with dnSpy and changing some values ? Also, any idea of the base police size on Unity ?

Baccanno avatar Apr 16 '21 17:04 Baccanno

Yes, this would have to be done in every plugin separately. Some plugins would work fine with just a copy of the code, but others would require major rewrites if they use GUI instead of GUILayout and autoscaling windows. A custom skin like this could be exposed from some API library to make it easier to add it to plugins, like what RuntimeUnityEditor does with its own custom skin.

ManlyMarco avatar Apr 16 '21 18:04 ManlyMarco

Yes please?

Faithfinder avatar Oct 30 '21 01:10 Faithfinder

You have to compile your own build with a custom gui skin, or make a plugin that hooks config manager and change the gui skin from there. Something like this https://github.com/ManlyMarco/RuntimeUnityEditor/blob/master/RuntimeUnityEditor/UI/InterfaceMaker.cs#L43

The link is 404 now :(

shaojiaxu avatar Mar 24 '23 08:03 shaojiaxu

@shaojiaxu https://github.com/ManlyMarco/RuntimeUnityEditor/blob/093c859332fc02dbab87428090b522b0e5ca515b/RuntimeUnityEditor/UI/InterfaceMaker.cs

ManlyMarco avatar Mar 26 '23 18:03 ManlyMarco

I found a good solution for this problem:

1- Find the exe file of your game, and RMB click it. 2- Click at > Properties 3- Click at Compatibility tab. 4- Click the button: Change high DPI settings 5- Check (enable) the first option below Program DPI 6- Check (enable) the last option below High DPI scaling override 7- At this drop-down list, select > System

Screen Shot

JoewAlabel avatar May 13 '23 13:05 JoewAlabel

I can add, that if i run Valheim with Vulkan from Steam - i get whitewashed GUI from Config Menu. If i run it from exe or without Vulkan - GUI looks normal colored.

Stroichik avatar Nov 07 '23 08:11 Stroichik

@JoewAlabel @Stroichik Can you check if the latest version of RuntimeUnityEditor also has this GUI issue?

ManlyMarco avatar Nov 08 '23 19:11 ManlyMarco

@ManlyMarco If i run with Vulkan - it looks same whitewashed image

And this is how it both looks without Vulkan

image

Its not something very critical, but a fix would be appreciated

Stroichik avatar Nov 09 '23 08:11 Stroichik

The second screenshot is how it should always look like, I have no idea how Vulkan can affect this outside of it being an Unity bug. I guess it could be partially resolved by having a darker version of the skin but there's no way to fix it automatically.

ManlyMarco avatar Nov 09 '23 09:11 ManlyMarco

Well, as i said, its not really that critical.

Stroichik avatar Nov 09 '23 14:11 Stroichik