ScriptHawk icon indicating copy to clipboard operation
ScriptHawk copied to clipboard

ScriptHawk Options window scale is wrong and has cutoff

Open retrobenny opened this issue 3 years ago • 7 comments

I am on 4K screen resolution,setting the DPI options in properties for BizHawk doesn't help it likely due to being a seperate entity after opening the script. I can't read most of the settings properly due to it being crunched in too small,how would one fix this issue? If I could resize the window,that would at least help for accessing the buttons and other parts,but you can't change the window size from what I can tell.

Testing this on BizHawk 2.5.2 with Banjo-Tooie and the script itself appears to be running correctly,just not the UI window scale.

Bugged ScriptHawk Options Window Size

retrobenny avatar Feb 01 '21 00:02 retrobenny

In BizHawk's Lua API, form control size is based on raw pixel values, with no way to get the DPI of the current screen into Lua and no way to set the font size used in the component (that I am aware of anyway), not to mention the problem of dragging the window across screens with different DPI. You can try playing around with adjusting ScriptHawk.UI.button_height (around line 51 in ScriptHawk.lua), but the results are less than ideal. See https://twitter.com/Isotarge/status/963992829746855937 It might be better to solve for the general case, and get BizHawk itself to automatically scale anything passed to their Lua forms API (since C# would have access to DPI) and make it completely transparent for scripts. Otherwise if I were to handle it downstream it would litter the main directory with separate scripts for each DPI like "ScriptHawk 96DPI (TAS Safe).lua" and I don't really wanna go down that route honestly. Edit: I suppose we could put adjusting button_height into the modifyOSD() window to retain only two scripts for launching ScriptHawk, but it's still a band aid solution rather than a proper fix.

Isotarge avatar Feb 01 '21 02:02 Isotarge

Thanks,please let me know when the changes are made in relation to the other issue post,then I can confirm if it fixes things on my end.

Sorry for the delay,I first saw your post when too tired to respond coherently and then didn't know what to say afterward. Should I chime in on that mention-linked issue post as well?

Edit: Didn't check the other issue until already posting,I should test those changes on my 4K screen to see if it happens to make it look right. I feel like I remember Windows 10 desktop scaling options being buggy in some cases but don't remember.

Yes,I remember that Win10 desktop scaling meddles with UI sizes and spacing. For the record I am on 100% size,not using a scaling value since I can sit directly in front of my monitor to look closer at it to easily be able to read things.

retrobenny avatar Feb 02 '21 19:02 retrobenny

You're getting the squished window at 100% scaling size? If you're wanting to use ScriptHawk with Windows' scaling setting over 100%, one workaround would be to set the scaling to 100%, open BizHawk + ScriptHawk, and then turn the scaling up to the desired value. With that workaround I get a window that looks like this: 100percent to 200percent It's not ideal I know, but it might work until the BizHawk people figure something out, the initial lead about the AutoScaleMode Enum didn't work for me.

Isotarge avatar Feb 03 '21 02:02 Isotarge

Turns out I was on 150% scale on Windows Settings,but turning that to 100% still has the cutoff... ☹️ And I can't just change resolution because that would break my G-Sync and not allow me to keep a higher refresh rate either due to dumb limitations beyond my control.

retrobenny avatar Feb 06 '21 00:02 retrobenny

Just to be clear, turning it down to 100% before launching BizHawk + ScriptHawk still has the cutoff?

Isotarge avatar Feb 06 '21 04:02 Isotarge

I turned down to 100%,did a shutdown then booted back up,then opened the stuff and it still has cutoff. I wonder if adding the ability to resize the window could help at all,if you can even add that to it.

Another idea may be to overcompensate sizes to make it work on 4K but it would look odd on other resolutions while still working otherwise fine there.

retrobenny avatar Feb 06 '21 07:02 retrobenny

Alrighty, I'm not sure what else I can do from here sadly. I think I'll leave it with the BizHawk people for now.

Isotarge avatar Feb 06 '21 07:02 Isotarge