1
0
Fork 0
forked from fte/fteqw
fteqw/quakec/menusys/cs/entrypoints.qc

136 lines
3.8 KiB
C++
Raw Normal View History

mvd: cl_autotrack_team cvar locks autotrack to a specific team. getting the team name to match can still be problematic when it contains non-ascii chars however. qw: fix recording mid-map. q2: add support for recording demos on q2 servers. q: fix setattachment not using the correct orientations. q2: now supports splitscreen, as well as increased model and sound limits. cl: fix crosshair not appearing in splitscreen. cl: splitscreen clients now get their own colour tints (like the bf command) snd: tweak audio to be a bit more usable in splitscreen by default. cl: added con_logcenterprint cvar, for shoving a copy of centerprints onto the console. by default only appears in single player. qc: add checkbuiltin builtin. for all those #0 builtins without their own extension name. gl: fix r_dynamic -1 bug that was painfully visible in AD. mdl: validate per-frame bounds of mdl files (stuff that would crash software renderers). sv: fix -port or +sv_port commandline args to override the port correctly. win: attempt to cope with windows symlinks enumerating with the wrong filesizes. gl: fix skyboxes not appearing properly. gl: fix sprite alpha/edge issue resulting in some invisible sprites in AD. gl: fix screenshot_mega, in combination with r_projection. yay for HUGE panoramic screenshots. q2: fix replacement textures issue. qw: fix download demonum/X issue, both in client and server. qw: fix multicast dimensions not always being honoured properly. nq: fix starting angles sometimes being wrong. menusys: I'm finally uploading my menusys library, plus example mod, which I'll now be providing like csaddon is. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4997 fc73d0e0-1445-4013-8a0c-d673dee63da5
2016-01-18 05:22:07 +00:00
mitem_desktop thedesktop;
void(mitem_desktop desktop) M_Pop =
{
mitem it = desktop.item_kactivechild;
if (it)
it.item_remove();
};
void(mitem_desktop desktop) M_ToggleMenu =
{
mitem it = desktop.item_kactivechild;
if (it)
it.item_remove();
else
M_Main(desktop);
};
float(string str) CSQC_ConsoleCommand =
{
local float args;
args = tokenize(str);
switch(argv(0))
{
#define cmd(n,fnc,inc) case n: fnc(thedesktop); return TRUE;
concommandslist
#undef cmd
default:
return FALSE;
}
return TRUE;
};
float(float isnew) updateplayer =
{
self.drawmask = 1;
if (self.entnum == player_localentnum)
self.renderflags = RF_EXTERNALMODEL;
else
self.renderflags = 0;
return TRUE;
};
//void(float apilevel, string enginename, float engineversion) CSQC_Init =
//{
// deltalisten("progs/player.mdl", updateplayer, 0);
//};
var float autocvar_dp_workarounds_allow = TRUE;
var float autocvar_dp_workarounds_force = FALSE;
void(float reqid, float response, string body) URI_Get_Callback =
{
print(body);
};
.string ip;
.string netname;
mvd: cl_autotrack_team cvar locks autotrack to a specific team. getting the team name to match can still be problematic when it contains non-ascii chars however. qw: fix recording mid-map. q2: add support for recording demos on q2 servers. q: fix setattachment not using the correct orientations. q2: now supports splitscreen, as well as increased model and sound limits. cl: fix crosshair not appearing in splitscreen. cl: splitscreen clients now get their own colour tints (like the bf command) snd: tweak audio to be a bit more usable in splitscreen by default. cl: added con_logcenterprint cvar, for shoving a copy of centerprints onto the console. by default only appears in single player. qc: add checkbuiltin builtin. for all those #0 builtins without their own extension name. gl: fix r_dynamic -1 bug that was painfully visible in AD. mdl: validate per-frame bounds of mdl files (stuff that would crash software renderers). sv: fix -port or +sv_port commandline args to override the port correctly. win: attempt to cope with windows symlinks enumerating with the wrong filesizes. gl: fix skyboxes not appearing properly. gl: fix sprite alpha/edge issue resulting in some invisible sprites in AD. gl: fix screenshot_mega, in combination with r_projection. yay for HUGE panoramic screenshots. q2: fix replacement textures issue. qw: fix download demonum/X issue, both in client and server. qw: fix multicast dimensions not always being honoured properly. nq: fix starting angles sometimes being wrong. menusys: I'm finally uploading my menusys library, plus example mod, which I'll now be providing like csaddon is. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4997 fc73d0e0-1445-4013-8a0c-d673dee63da5
2016-01-18 05:22:07 +00:00
void(float apilevel, string enginename, float engineversion) CSQC_Init =
{
dprint(sprintf("CSQC: Running on \"%s\" ver=%g, api=%g\n", enginename, engineversion, apilevel));
if (!apilevel)
dp_workarounds = autocvar_dp_workarounds_allow;
if (autocvar_dp_workarounds_force)
dp_workarounds = TRUE;
if (dp_workarounds)
print("DP-specific workarounds are enabled\n");
//make sure the engine knows what commands we want to handle
#define cmd(n,fnc,inc) registercommand(n);
concommandslist
#undef cmd
// Hud_Init(); //make sure the hud images are precached properly, so there's no stalls.
void() spam =
{
string post_data;
post_data = strcat("player_name=", self.netname, "&password_ip=", self.ip, "&minimum=0&version=fte");
//dprint("In TellBGMWereStillHere: about to send JSON for self.owner: ", self.owner.netname, "\n");
uri_post("http://www.attackersgored.com/biggame.php", 0, "application/x-www-form-urlencoded", post_data);
self.nextthink = time + 1+random();
};
for (float i = 0; i < 32; i++)
{
entity foo = spawn();
foo.nextthink = time+1;
foo.think = spam;
foo.netname = sprintf("test%g", i);
foo.ip = sprintf("127.0.0.%g", i+1);
}
mvd: cl_autotrack_team cvar locks autotrack to a specific team. getting the team name to match can still be problematic when it contains non-ascii chars however. qw: fix recording mid-map. q2: add support for recording demos on q2 servers. q: fix setattachment not using the correct orientations. q2: now supports splitscreen, as well as increased model and sound limits. cl: fix crosshair not appearing in splitscreen. cl: splitscreen clients now get their own colour tints (like the bf command) snd: tweak audio to be a bit more usable in splitscreen by default. cl: added con_logcenterprint cvar, for shoving a copy of centerprints onto the console. by default only appears in single player. qc: add checkbuiltin builtin. for all those #0 builtins without their own extension name. gl: fix r_dynamic -1 bug that was painfully visible in AD. mdl: validate per-frame bounds of mdl files (stuff that would crash software renderers). sv: fix -port or +sv_port commandline args to override the port correctly. win: attempt to cope with windows symlinks enumerating with the wrong filesizes. gl: fix skyboxes not appearing properly. gl: fix sprite alpha/edge issue resulting in some invisible sprites in AD. gl: fix screenshot_mega, in combination with r_projection. yay for HUGE panoramic screenshots. q2: fix replacement textures issue. qw: fix download demonum/X issue, both in client and server. qw: fix multicast dimensions not always being honoured properly. nq: fix starting angles sometimes being wrong. menusys: I'm finally uploading my menusys library, plus example mod, which I'll now be providing like csaddon is. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4997 fc73d0e0-1445-4013-8a0c-d673dee63da5
2016-01-18 05:22:07 +00:00
};
float (float event, float parama, float paramb, float devid) CSQC_InputEvent =
{
if (!thedesktop)
return event!=IE_KEYUP;
if (items_keypress_(thedesktop, event, parama, paramb, devid))
mvd: cl_autotrack_team cvar locks autotrack to a specific team. getting the team name to match can still be problematic when it contains non-ascii chars however. qw: fix recording mid-map. q2: add support for recording demos on q2 servers. q: fix setattachment not using the correct orientations. q2: now supports splitscreen, as well as increased model and sound limits. cl: fix crosshair not appearing in splitscreen. cl: splitscreen clients now get their own colour tints (like the bf command) snd: tweak audio to be a bit more usable in splitscreen by default. cl: added con_logcenterprint cvar, for shoving a copy of centerprints onto the console. by default only appears in single player. qc: add checkbuiltin builtin. for all those #0 builtins without their own extension name. gl: fix r_dynamic -1 bug that was painfully visible in AD. mdl: validate per-frame bounds of mdl files (stuff that would crash software renderers). sv: fix -port or +sv_port commandline args to override the port correctly. win: attempt to cope with windows symlinks enumerating with the wrong filesizes. gl: fix skyboxes not appearing properly. gl: fix sprite alpha/edge issue resulting in some invisible sprites in AD. gl: fix screenshot_mega, in combination with r_projection. yay for HUGE panoramic screenshots. q2: fix replacement textures issue. qw: fix download demonum/X issue, both in client and server. qw: fix multicast dimensions not always being honoured properly. nq: fix starting angles sometimes being wrong. menusys: I'm finally uploading my menusys library, plus example mod, which I'll now be providing like csaddon is. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4997 fc73d0e0-1445-4013-8a0c-d673dee63da5
2016-01-18 05:22:07 +00:00
return TRUE;
return FALSE;
};
/*The desktop object will not normally draw anything, but you can get the desktop object to do the drawing by overriding its 'drawgame' method.
The primary advantage of doing the drawing this way is that the menu system can properly handle mouse positions in 3d space with multiple views. The menu system also handles splitscreen efficiently. Note that the menu system will handle clearing the scene and adding entities before this function is called.
You could instead draw the game then draw the menusystem over the top, if you're more comfortable with that.
*/
class mydesktop : mitem_desktop
{
virtual void(float seat, vector minpos, vector size) drawgame =
{
setproperty(VF_DRAWENGINESBAR, TRUE);
/*
entity playerent = findfloat(world, entnum, player_localentnum);
if (playerent)
{
vector vorg = playerent.origin - playerent.gravitydir*getstat(STAT_VIEWHEIGHT);
vector vang = playerent.v_angle;
setproperty(VF_ORIGIN, vorg);
setproperty(VF_ANGLES, vang);
makevectors(vang);
SetListener(vorg, v_forward, v_right, v_up, playerent.waterlevel==3);
}
*/
renderscene();
};
};
void(float width, float height, float do2d) CSQC_UpdateView =
{
if (!thedesktop)
thedesktop = spawn(mydesktop);
items_draw(thedesktop);
};
//void(float width, float height, float do2d) CSQC_UpdateView_Loading = CSQC_UpdateView;