hlsdk-portable icon indicating copy to clipboard operation
hlsdk-portable copied to clipboard

Proof of concept: VGUI2 support

Open FreeSlave opened this issue 3 years ago • 6 comments

Maybe we should add a branch with VGUI2 support. Ideally the same client binary should be usable in both GoldSource and Xash3D. Of course Xash3D can't benefit from VGUI2 in client library, but the presence of VGUI2 shouldn't break starting the game under Xash3D.

FreeSlave avatar Jul 09 '22 23:07 FreeSlave

the presence of VGUI2 shouldn't break starting the game under Xash3D.

Unfortunately, VGUI2 is designed that way that it will break if one of VGUI2, FileSystem, Tier0, VStdlib and other Source libraries are missing.

Sure, we may never call it, but then what's the point of having an alternative UI that never gets drawn under an engine that doesn't support it?

a1batross avatar Jul 10 '22 05:07 a1batross

Sure, we may never call it, but then what's the point of having an alternative UI that never gets drawn under an engine that doesn't support it?

Mod-makers could use IsXashFWGS checks to never call VGUI2 on Xash3D, but call it on GoldSource.

It's really just about about the ease distribution. If Xash3D allows the client library have some other name, then modders could just distribute client.dll and client-xash3d.dll (without any links to VGUI2) in the mod archive.

It's also nice to have VGUI2 (at least as a branch) for completeness.

In Field Intensity I didn't use VGUI2, but I had to use IsXashFWGS to avoid calling custom scaling code as scaling applies automatically on Xash3D (at least on FWGS, I've never tested how it works on original Xash3D). I also chose different text drawing methods depending on the endine.

FreeSlave avatar Jul 10 '22 08:07 FreeSlave

Mod probably will use VGUI2 to show something important on screen.

If Xash doesn't work with VGUI2, then there is no need for engine checks as mod just doesn't work as intended. And it's my bug, to be honest.

a1batross avatar Jul 11 '22 00:07 a1batross

Mod probably will use VGUI2 to show something important on screen.

A mod can use VGUI2 just to render scalable texts, like Counter Strike does.

FreeSlave avatar Jul 17 '22 10:07 FreeSlave

A mod can use VGUI2 just to render scalable texts, like Counter Strike does.

And that would not render on Xash or look ugly. In the meanwhile, we could do something about VGUI2 support, but mod already has a dumb check for the engine it's running on that we can't avoid.

Theoretically, such mods can go through VGUI2DrawCharacter(Additive) callbacks in engine interface, that has additional font argument to set up the scale and typeface. But font handle itself must be acquired through scheme interface of VGUI2 that's not exposed into client.

a1batross avatar Jul 18 '22 01:07 a1batross

Partial work has been done in https://github.com/FWGS/hlsdk-portable/pull/447

FreeSlave avatar Mar 15 '24 19:03 FreeSlave