Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proof of concept: VGUI2 support #269

Open
FreeSlave opened this issue Jul 9, 2022 · 6 comments
Open

Proof of concept: VGUI2 support #269

FreeSlave opened this issue Jul 9, 2022 · 6 comments

Comments

@FreeSlave
Copy link
Member

FreeSlave commented Jul 9, 2022

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.

@a1batross
Copy link
Member

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?

@FreeSlave
Copy link
Member Author

FreeSlave commented Jul 10, 2022

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.

@a1batross
Copy link
Member

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.

@FreeSlave
Copy link
Member Author

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.

@a1batross
Copy link
Member

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.

@FreeSlave
Copy link
Member Author

Partial work has been done in #447

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants