mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-02-17 01:11:18 +00:00
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
58 lines
No EOL
2.2 KiB
C++
58 lines
No EOL
2.2 KiB
C++
/***************************************************************************
|
|
fullscreen exclusive menu
|
|
you should only have ONE of these visible at once.
|
|
interactable - basically just a container for the items in the menu, but also handles killing them+itself when the user presses escape.
|
|
will keep stealing focus from the desktop, so you won't be able to play while one of these is active.
|
|
will not steal focus from siblings. this means console slideouts or whatever are still usable.
|
|
|
|
these items will automatically be added to the desktop/workspace thing
|
|
Call it.item_remove() to pop the menu.
|
|
Regular items can be added to the menu by first spawning them, then calling menu_additem to actually add it to the desired menu in the right place.
|
|
*/
|
|
|
|
class mitem_exmenu : mitem_frame
|
|
{
|
|
virtual float(vector pos, float scan, float char, float down) item_keypress =
|
|
{
|
|
local float ret = super::item_keypress(pos, scan, char, down);
|
|
if (!ret && down)
|
|
{
|
|
ret = TRUE;
|
|
if (scan == K_MOUSE2 || scan == K_ESCAPE)
|
|
{
|
|
localcmd(strcat(item_command, "\n")); //console command to exec if someone clicks the close button.
|
|
item_remove();
|
|
}
|
|
else if (scan == K_UPARROW && down)
|
|
this.item_focuschange(menu_nextitem(this, item_kactivechild?item_kactivechild:item_mactivechild), IF_KFOCUSED);
|
|
else if (scan == K_DOWNARROW && down)
|
|
this.item_focuschange(menu_previousitem(this, item_kactivechild?item_kactivechild:item_mactivechild), IF_KFOCUSED);
|
|
else if (scan >= K_F1 && scan <= K_F12) //allow f1-f12 to work, but every other button event gets canceled.
|
|
ret = FALSE;
|
|
}
|
|
return ret;
|
|
};
|
|
virtual void(vector pos) item_draw =
|
|
{
|
|
if (ui.mgrabs == item_parent || ui.kgrabs == item_parent) //if our parent has grabs, steal it instead, this means you can select the console, but the game never gets focus
|
|
{
|
|
if (item_flags & IF_SELECTABLE)
|
|
{
|
|
ui.mgrabs = __NULL__;
|
|
ui.kgrabs = __NULL__;
|
|
item_parent.item_focuschange(this, IF_KFOCUSED);
|
|
}
|
|
}
|
|
super::item_draw(pos);
|
|
};
|
|
|
|
//same as mitem, but does not propogate to parent.
|
|
virtual string(string key) get =
|
|
{
|
|
return cvar_string(key);
|
|
};
|
|
virtual void(string key, string newval) set =
|
|
{
|
|
cvar_set(key, newval);
|
|
};
|
|
}; |