1
0
Fork 0
forked from fte/fteqw
fteqw/quakec/menusys/menu/options_configs.qc
Spoike 9e8bb446f4 implemented pm_stepdown.
attempt to implement 'simple csqc' api.
handle qw+nq gunshot+blood+lightning differently - they do actually have different particle spawn patterns (qw is a single point, so spreads wider).
fix q3ui logo mesh thing. work around q3ui player meshes on d3d.
split video and renderer latching, so vid_reload delatches more stuff.
fix autosprite+autosprite2 in 6 different renderers...
added fog volumes to d3d9 renderer.
using matrix hacks instead of glDepthRange, this should give more consistent behaviour, especially now that we have r_viewmodel_fov.
small cleanup for gl shadowmaps to make the interface more consistent with other renderers.
added patchDef2 parsing to fte's .map loader, doesn't actually use it though.
some fixes for q3's shaders, including to try to get overbright working better.
updated customskin api to give more control.
first attempt at a packager system for fteqccgui. probably useless, but whatever.
menusys changes to try to support QSS's csqc.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5200 fc73d0e0-1445-4013-8a0c-d673dee63da5
2018-01-22 19:18:04 +00:00

57 lines
2.6 KiB
C++

/***************************************************************************
Uses the engine command to apply the preset, and tries an exec instead if a config file exists.
Doesn't track the current one or anything.
Really simple and stupid menu.
no background tint, so the game is still visible so you can preview it.
*/
nonstatic void(mitem_desktop desktop) M_Configs =
{
local float i;
mitem_exmenu m;
m = spawn(mitem_exmenu, item_text:_("Game Presets / Configs"), item_flags:IF_SELECTABLE, item_command:"m_options");
desktop.add(m, RS_X_MIN_PARENT_MIN|RS_Y_MIN_PARENT_MIN | RS_X_MAX_PARENT_MAX|RS_Y_MAX_PARENT_MAX, '0 0', '0 0');
desktop.item_focuschange(m, IF_KFOCUSED);
m.totop();
float h = 200*0.5;
//draw title art above the options
mitem_pic banner = spawn(mitem_pic, item_text:"gfx/p_option.lmp", item_size_y:24, item_flags:IF_CENTERALIGN);
m.add(banner, RS_X_MIN_PARENT_MID|RS_Y_MIN_PARENT_MID | RS_X_MAX_OWN_MIN|RS_Y_MAX_PARENT_MID, [(160-60-banner.item_size_x)*0.5, -h-32], [banner.item_size_x, -h-8]);
//spawn a container frame for the actual options. this provides a scrollbar if we have too many items.
mitem_frame fr = spawn(mitem_frame, item_flags: IF_SELECTABLE, frame_hasscroll:TRUE);
m.add(fr, RS_X_MIN_PARENT_MIN|RS_Y_MIN_PARENT_MID | RS_X_MAX_PARENT_MAX|RS_Y_MAX_OWN_MIN, [0, -h], [0, h*2]);
float fs, y=0;
fs = search_begin("configs/game_*.cfg", TRUE, TRUE);
float c = search_getsize(fs);
for (i = 0; i < c; i++)
{
string fname = search_getfilename(fs, i);
string iname = strzone(substring(fname, 13, -5));
string dname = GetFirstLineComment(fname, iname);
iname = sprintf("exec \"%s\"", fname);
if (dname && !fr.findchildcmd(iname))
fr.add(spawn(mitem_text, item_text:dname, item_command:iname, item_scale:16, item_flags:IF_CENTERALIGN), RS_X_MIN_PARENT_MIN|RS_Y_MIN_PARENT_MIN | RS_X_MAX_PARENT_MAX|RS_Y_MAX_OWN_MIN, [0, y+=16], '100 16');
}
search_end(fs);
if (c <= 0)
fr.add(spawn(mitem_text, item_text:"No configs found", item_scale:16, item_flags:IF_CENTERALIGN), RS_X_MIN_PARENT_MIN|RS_Y_MIN_PARENT_MIN | RS_X_MAX_PARENT_MAX|RS_Y_MAX_OWN_MIN, [0, y], '100 16');
//random art for style
#if 1//def CSQC
m.addm(spawn (mitem_spinnymodel, item_text: "progs/g_rock2.mdl", zbias:-16), [-160-60, 12*-16/2], [-60, 12*16/2]);
#else
//menuqc doesn't support entities. shove some random crappy static image there instead.
local mitem_pic plaque = spawn (mitem_pic, item_text:"gfx/qplaque.lmp", item_alpha:1);
m.addm(plaque, [(-160-plaque.item_size_x)*0.5, 12*-16/2], [(-160+plaque.item_size_x)*0.5, 12*16/2]);
#endif
addmenuback(m);
};