Re: ZScript: Status Bar Questions

Sat Apr 01, 2017 10:49 am

In what way is it broken?

Re: ZScript: Status Bar Questions

Sat Apr 01, 2017 11:24 am

D4D's credit counter for example, which uses ACS's HUDMessage. That thing is tiny now...

Re: ZScript: Status Bar Questions

Sat Apr 01, 2017 11:27 am

I'm on the phone right now, but you might remember how statusbar gets squished with nonstandard video modes, I've made a bug about it earlier. Thanks to this fine example of weird aspect heuristics I'd want to use manual scaling and positioning whenever possible now, but first I need to know what needs to be done before handmade library can compete with builtin statusbar code (provided all the statusbar info is available).
Also, apparently it's not possible to create a non-fullscreen non-4:3 statusbar.

And either way I'd like to know some of the magic that I don't do, but BaseStatusBar does.

Re: ZScript: Status Bar Questions

Sat Apr 01, 2017 12:44 pm

ZZYZX wrote:Thanks to this fine example of weird aspect heuristics I'd want to use manual scaling and positioning whenever possible now



It does work for all screen sizes without a forced aspect ratio. I already fixed a huge part of the problems in the scaling logic and most importantly consolidated most of it into a single function. To say that this was a gigantic mess would be a huge understatement.

The ones with a forced aspect ratio that cause a non-1:1 pixel ratio are a different story, but it's still better to work towards a generic solution than trying to cook up some workaround that is bound to bite you in the ass later like a hungry piranha.

Re: ZScript: Status Bar Questions

Sat Apr 01, 2017 11:36 pm

...yet still no answer about what exactly does statusbar do that I can't.
You've been talking about it 3 months ago, you're talking about it now, but you don't specify what exactly is this advanced processing that people don't do in RenderOverlay that's done in statusbar.

Re: ZScript: Status Bar Questions

Sat Apr 01, 2017 11:48 pm

I would like to know as well.

Re: ZScript: Status Bar Questions

Sun Apr 02, 2017 1:21 am

ZZYZX wrote:...yet still no answer about what exactly does statusbar do that I can't.
You've been talking about it 3 months ago, you're talking about it now, but you don't specify what exactly is this advanced processing that people don't do in RenderOverlay that's done in statusbar.



There is no advanced processing. The problem with your render overlay was that it did not properly integrate with the rest of the HUD drawing and that it had no access to the current HUD state. It wasn't so much about what it cannot do but what it could not check. Having a HUD that doesn't obey user settings is bound to annoy those users.
The key part of the status bar code is that its draw functions automatically adjust to the user settings for UI scale and that the standard use cases allow calling them with far less parameters than the low level draw functions. Remember, this is supposed to replace SBARINFO, and that'd make explicitly specifying the scale size for each element exceedingly clumsy.

Re: ZScript: Status Bar Questions

Sun Apr 02, 2017 2:01 am

Ok, thanks.

But anyway, I already have my own library to manage scaling automatically for all current Screen static methods, and I'll only need to make it support uiscale.
My main problem was that you told me at least twice that this way is wrong (in this thread) and I was like o_O why.

Although I personally don't like obeying uiscale much because uiscale can't even be fractional according to what I've seen — int only. As well as other explicit scale variables...
From my experience, for example, with 1280x1024 con_scale 2 looks too large while con_scale 1 too small.

Previous virtualwidth/virtualheight approach (custom scaling under messages options menu that was in GZDoom ~1.8 or so) would produce way better results even though it'd mean uneven scaling of rows/columns.

btw: how do I adjust the size of the regular (non-fullscreen) doom statusbar? Currently it's 1:1 and centered, which means it's really small.
hud_scale only works with fullscreen.

Re: ZScript: Status Bar Questions

Sun Apr 02, 2017 2:39 am

ZZYZX wrote:Although I personally don't like obeying uiscale much because uiscale can't even be fractional according to what I've seen — int only. As well as other explicit scale variables...
From my experience, for example, with 1280x1024 con_scale 2 looks too large while con_scale 1 too small.


The point here is not precision but that this is a user setting. The reason for non-integer scales is that without texture filtering it tends to look quite bad at low scaling factors. Proper UI stretching to the 1.2 pixel ratio of 320x200 only looks acceptable, for example, if the actual screen is at least 4-5x as large as 320x200, that's why the existing code couldn't even deal with that.

In order to allow proper adherence to user settings I'll have to export the GetUIScale function to ZScript first, that's what all internal code is using now, with the proper override CVAR being specified - for HUDs that'd either be hud_scale or st_scale, depending on context.

Re: ZScript: Status Bar Questions

Sun Apr 02, 2017 4:23 am

Is it possible to retrieve only the (clean)scaled coordinates of a given set of numbers? There's something I'd like to draw but the built-in BaseStatusBar methods don't support it (DTA_Overlay) so it looks like I'm going to have to draw it manually...

I basically want to draw something with the benefits of the status bar methods, but not actually use the drawing portion of them, if that makes sense. o_O

Re: ZScript: Status Bar Questions

Sun Apr 02, 2017 4:31 am

Not at the moment but what can be added is a function that receives a rectangle in virtual status bar coordinates and then returns a rectangle in screen coordinates so that you can draw it with DTA_DestWidth and DTA_DestHeight.

Re: ZScript: Status Bar Questions

Sun Apr 09, 2017 12:53 pm

That would actually be appreciated because right now, I'm still trying to figure out just how I should be handling the scaling and detection of resolutions.

Re: ZScript: Status Bar Questions

Sun Apr 09, 2017 1:12 pm

You shouldn't do that at all. You should set a default resolution and align everything to that, leaving the rest to the engine. I tried to mimic SBARINFO's approach here as good as was possible.
The more you fudge around the more likely there's problems if users start altering the scaling.

Re: ZScript: Status Bar Questions

Sun Apr 09, 2017 1:22 pm

Good to know. I'll keep that in mind.

One other question, if they aren't already, can the x and y coordinates be made to support floats much like you did the menus?

Re: ZScript: Status Bar Questions

Sun Apr 09, 2017 2:16 pm

They are all Vector2's which are floats. For something that can get scaled by a factor of 6 and more this is a necessity.