Client: Add a check if the client is being ran in a web browser.

Will allow for certain features to be hidden/displayed specified to
the web client.
This commit is contained in:
Ian 2022-11-23 09:27:48 -05:00
parent 836b7c47d7
commit 753fc61a53
2 changed files with 8 additions and 0 deletions

View file

@ -196,6 +196,8 @@ float screen_height_169[MAX_169];
float screen_width_219[MAX_219]; float screen_width_219[MAX_219];
float screen_height_219[MAX_219]; float screen_height_219[MAX_219];
int platform_is_web;
//controller buttons //controller buttons
/* /*

View file

@ -71,6 +71,12 @@ noref void(float apiver, string enginename, float enginever) CSQC_Init =
cvar_set("sv_cheats", ftos(1)); cvar_set("sv_cheats", ftos(1));
// Runtime check if we're running this in WebASM/WebGL.
if (cvar_string("sys_platform") == "Web")
platform_is_web = true;
else
platform_is_web = false;
//print("CSQC Started\n"); //print("CSQC Started\n");
dummy = spawn(); dummy = spawn();
if(serverkey("constate") == "disconnected") if(serverkey("constate") == "disconnected")