1
0
Fork 0
forked from fte/fteqw
fteqw/quakec/menusys/menu.src
Spoike 9360a016c2 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

133 lines
3.9 KiB
Text

#pragma progs_dat "../menu.dat"
//#pragma target fte
#define MENU //select the module
#includelist
fteextensions.qc //also sets up system defs
menusys/mitems.qc //root item type
menusys/mitems_common.qc //basic types
menusys/mitem_desktop.qc //other sort of root item
menusys/mitem_exmenu.qc //fullscreen/exclusive menus
menusys/mitem_edittext.qc //simple text editor
menusys/mitem_tabs.qc //tabs
menusys/mitem_colours.qc //colour picker
menusys/mitem_checkbox.qc //checkbox (boolean thingies)
menusys/mitem_slider.qc //scrollbars
menusys/mitem_combo.qc //multiple-choice thingies
menusys/mitem_bind.qc //key binding thingie
menusys/mitem_spinnymodel.qc //menu art
#endlist
//might as well put this here.
void(mitem_desktop desktop) M_Pop =
{
mitem it = desktop.item_kactivechild;
if (it)
it.item_remove();
};
//define the commands.
//cmd argments are: Name, Function, Sourcefile(may be empty)
#define concommandslist \
cmd("m_main", M_Main, menu/main.qc) \
cmd("m_pop", M_Pop, ) \
cmd("m_options", M_Options, menu/options.qc) \
cmd("m_keys", M_Options_Keys, menu/options_keys.qc) \
cmd("m_basicopts", M_Options_Basic, menu/options_basic.qc) \
cmd("m_video", M_Options_Video, menu/options_video.qc) \
cmd("m_effects", M_Options_Effects, menu/options_effects.qc) \
cmd("m_audio", M_Options_Audio, menu/options_audio.qc) \
cmd("m_particles", M_Options_Particles, menu/options_particles.qc) \
cmd("m_hud", M_Options_Hud, menu/options_hud.qc) \
cmd("m_load", M_Load, menu/loadsave.qc) \
cmd("m_save", M_Save, ) \
cmd("m_quit", M_Quit, menu/quit.qc) \
cmd("m_newgame", M_NewGame, menu/newgame.qc) \
cmd("m_servers", M_Servers, menu/servers.qc) \
cmd("m_configs", M_Configs, menu/options_configs.qc) \
cmd("m_reset", M_Reset, ) \
cmd("m_preset", M_Preset, menu/presets.qc)
#if 0
#append concommandslist cmd("m_servers", M_Servers, menu/servers.qc)
#define serverbrowser "m_servers"
#else
#define serverbrowser "menu_servers"
#endif
//make sure all the right files are included
#define cmd(n,fnc,inc) inc
#includelist
concommandslist
#endlist
#undef cmd
mitem_desktop desktop;
void() m_shutdown = {};
void() m_draw = {items_draw(desktop);};
void(float scan, float chr) m_keydown = {items_keypress(desktop, scan, chr, TRUE);};
void(float scan, float chr) m_keyup = {items_keypress(desktop, scan, chr, FALSE);};
void(float mode) m_toggle =
{
if (mode)
M_Main(desktop);
items_updategrabs();
};
var float autocvar_dp_workarounds_allow = TRUE;
var float autocvar_dp_workarounds_force = FALSE;
void() m_init =
{
desktop = spawn(mitem_desktop);
//register the console commands via the alias command.
#define cmd(n,f) localcmd("alias " n " \"menu_cmd " n " $*\"\n");
concommandslist
#undef cmd
//work around some dp differences/bugs.
//this check identifies one significant bug in DP.
//if anyone actually cares to fix DP, then there is no reason they cannot do so by just removing DP_QC_RENDERSCENE and then fixing anything else that arises.
if (checkextension("DP_QC_RENDER_SCENE") && !checkextension("DP_CON_SET"))
dp_workarounds = autocvar(dp_workarounds_allow, TRUE);
if (autocvar(dp_workarounds_force, FALSE))
dp_workarounds = TRUE;
if (dp_workarounds)
print("^1WORKING AROUND DP BUGS\n");
//for compat with DP, 'none' is the default cursor in menuqc.
//naturally this is not ideal.
if (checkextension("FTE_QC_HARDWARECURSORS"))
setcursormode(TRUE, "");
else
print("No hardware cursors\n");
if (clientstate() == 1) //disconnected==1, supposedly
m_toggle(1);
};
void(string cstr) GameCommand =
{
tokenize(cstr);
string cmd = argv(0);
switch(cmd)
{
//switch on the known commands.
#define cmd(n,f) case n: f(desktop); break;
concommandslist
#undef cmd
default:
print("unknown command ", cmd, "\n");
break;
}
items_updategrabs();
};