From e8af6ea1225d3b91a506519b22cb97fb314a910c Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Fri, 20 Dec 2013 02:26:25 -0500 Subject: [PATCH] Commit this shit... gonna fix it tomorrow. --- defaultXonotic.cfg | 2 +- effects-high.cfg | 2 +- effects-low.cfg | 2 +- effects-med.cfg | 2 +- effects-normal.cfg | 2 +- qcsrc/menu/classes.c | 3 +- qcsrc/menu/xonotic/demolist.c | 1 + .../xonotic/dialog_multiplayer_media_demo.c | 37 +++++++++++------- ...ialog_multiplayer_media_demo_democonfirm.c | 39 ------------------- qcsrc/menu/xonotic/dialog_settings_effects.c | 8 +++- qcsrc/menu/xonotic/mainwindow.c | 13 +++++-- 11 files changed, 46 insertions(+), 65 deletions(-) delete mode 100644 qcsrc/menu/xonotic/dialog_multiplayer_media_demo_democonfirm.c diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index e0b7b4662..009cff570 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1269,7 +1269,7 @@ set bot_sound_monopoly 0 "when enabled, only bots can make any noise" set cl_loddistance1 1024 set cl_loddistance2 3072 -seta cl_playerdetailreduction 1 "the higher, the less detailed player models are displayed (LOD)" +seta cl_playerdetailreduction 2 "the higher, the less detailed player models are displayed (LOD)" seta cl_modeldetailreduction 1 "the higher, the less detailed certain map models are displayed (LOD)" set g_mapinfo_settemp_acl "+*" "ACL for mapinfo setting cvars" diff --git a/effects-high.cfg b/effects-high.cfg index b0178fa8f..d28b69b43 100644 --- a/effects-high.cfg +++ b/effects-high.cfg @@ -5,7 +5,7 @@ cl_particles 1 cl_particles_quality 1.0 cl_damageeffect 1 cl_spawn_point_particles 1 -cl_playerdetailreduction 0.5 +cl_playerdetailreduction 1 gl_flashblend 0 gl_picmip -1 mod_q3bsp_nolightmaps 0 diff --git a/effects-low.cfg b/effects-low.cfg index dd0b60709..3af46190f 100644 --- a/effects-low.cfg +++ b/effects-low.cfg @@ -5,7 +5,7 @@ cl_particles 1 cl_particles_quality 0.4 cl_damageeffect 0 cl_spawn_point_particles 0 -cl_playerdetailreduction 2 +cl_playerdetailreduction 4 gl_flashblend 1 gl_picmip 1 mod_q3bsp_nolightmaps 1 diff --git a/effects-med.cfg b/effects-med.cfg index bc08dadc1..53034c19b 100644 --- a/effects-med.cfg +++ b/effects-med.cfg @@ -5,7 +5,7 @@ cl_particles 1 cl_particles_quality 0.8 cl_damageeffect 0 cl_spawn_point_particles 0 -cl_playerdetailreduction 1 +cl_playerdetailreduction 3 gl_flashblend 0 gl_picmip 0 mod_q3bsp_nolightmaps 0 diff --git a/effects-normal.cfg b/effects-normal.cfg index 06b62edf2..d7af2166c 100644 --- a/effects-normal.cfg +++ b/effects-normal.cfg @@ -5,7 +5,7 @@ cl_particles 1 cl_particles_quality 1.0 cl_damageeffect 1 cl_spawn_point_particles 1 -cl_playerdetailreduction 1 +cl_playerdetailreduction 2 gl_flashblend 0 gl_picmip 0 mod_q3bsp_nolightmaps 0 diff --git a/qcsrc/menu/classes.c b/qcsrc/menu/classes.c index 4658d08bc..5a9e516c8 100644 --- a/qcsrc/menu/classes.c +++ b/qcsrc/menu/classes.c @@ -87,6 +87,8 @@ #include "xonotic/weaponslist.c" #include "xonotic/dialog_multiplayer_media.c" #include "xonotic/dialog_multiplayer_media_demo.c" +#include "xonotic/dialog_multiplayer_media_demo_startconfirm.c" +#include "xonotic/dialog_multiplayer_media_demo_timeconfirm.c" #include "xonotic/demolist.c" #include "xonotic/screenshotimage.c" #include "xonotic/dialog_multiplayer_media_screenshot.c" @@ -116,5 +118,4 @@ #include "xonotic/dialog_hudpanel_centerprint.c" #include "xonotic/slider_picmip.c" #include "xonotic/dialog_settings_game_notification.c" -#include "xonotic/dialog_multiplayer_media_demo_democonfirm.c" #include "xonotic/slider_particles.c" diff --git a/qcsrc/menu/xonotic/demolist.c b/qcsrc/menu/xonotic/demolist.c index 23d21b18a..7ce54d32c 100644 --- a/qcsrc/menu/xonotic/demolist.c +++ b/qcsrc/menu/xonotic/demolist.c @@ -25,6 +25,7 @@ CLASS(XonoticDemoList) EXTENDS(XonoticListBox) ATTRIB(XonoticDemoList, filterString, string, string_null) ENDCLASS(XonoticDemoList) +entity demolist; // for reference elsewhere entity makeXonoticDemoList(); void StartDemo_Click(entity btn, entity me); void TimeDemo_Click(entity btn, entity me); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_media_demo.c b/qcsrc/menu/xonotic/dialog_multiplayer_media_demo.c index b1256b2ab..47a988278 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_media_demo.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_media_demo.c @@ -6,23 +6,29 @@ CLASS(XonoticDemoBrowserTab) EXTENDS(XonoticTab) ATTRIB(XonoticDemoBrowserTab, rows, float, 21) ATTRIB(XonoticDemoBrowserTab, columns, float, 6.5) ATTRIB(XonoticDemoBrowserTab, name, string, "DemoBrowser") + ATTRIB(XonoticDemoBrowserTab, democlicktype, float, 0) ENDCLASS(XonoticDemoBrowserTab) entity makeXonoticDemoBrowserTab(); -void Demo_Confirm(entity me, entity btn); +const float DMO_PLAY = 1; +const float DMO_TIME = 2; #endif #ifdef IMPLEMENTATION -void DemoConfirm_Check_Gamestatus(entity me, entity btn) +void DemoConfirm_Check_Gamestatus(entity btn, entity me) { if not(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)) // we're not in a match, lets watch the demo { - //TimeDemo_Click; - //StartDemo_Click; - return; + if(btn.democlicktype == DMO_PLAY) + { StartDemo_Click(btn, demolist); } + else if(btn.democlicktype == DMO_TIME) + { TimeDemo_Click(btn, demolist); } } else // already in a match, player has to confirm { - Demo_Confirm(me, btn); + if(btn.democlicktype == DMO_PLAY) + { DialogOpenButton_Click(btn, main.demostartconfirmDialog); } + else if(btn.democlicktype == DMO_TIME) + { DialogOpenButton_Click(btn, main.demotimeconfirmDialog); } } } @@ -36,31 +42,32 @@ entity makeXonoticDemoBrowserTab() void XonoticDemoBrowserTab_fill(entity me) { entity e; - entity dlist = makeXonoticDemoList(); - + demolist = makeXonoticDemoList(); + me.TR(me); me.TD(me, 1, 0.6, e = makeXonoticTextLabel(1, _("Filter:"))); me.TD(me, 1, 2.9, e = makeXonoticInputBox(0, string_null)); e.onChange = DemoList_Filter_Change; - e.onChangeEntity = dlist; - dlist.controlledTextbox = e; + e.onChangeEntity = demolist; + demolist.controlledTextbox = e; me.gotoRC(me, 0, 3.7); me.TD(me, 1, 1.5, e = makeXonoticCheckBox(0, "cl_autodemo", _("Auto record demos"))); me.TD(me, 1, 1, e = makeXonoticButton(_("Refresh"), '0 0 0')); //e.onClick = DemoList_Filter_Change; - //e.onClickEntity = dlist; - + //e.onClickEntity = demolist; me.gotoRC(me, 1.5, 0); - me.TD(me, me.rows - 2.5, me.columns, dlist); + me.TD(me, me.rows - 2.5, me.columns, demolist); me.gotoRC(me, me.rows - 1, 0); me.TD(me, 1, me.columns / 2, e = makeXonoticButton(_("Timedemo"), '0 0 0')); + e.democlicktype = DMO_TIME; e.onClick = DemoConfirm_Check_Gamestatus; - e.onClickEntity = dlist; + e.onClickEntity = me; // demolist is global anyway me.TD(me, 1, me.columns / 2, e = makeXonoticButton(ZCTX(_("DEMO^Play")), '0 0 0')); + e.democlicktype = DMO_PLAY; e.onClick = DemoConfirm_Check_Gamestatus; - e.onClickEntity = dlist; + e.onClickEntity = me; // demolist is global anyway } #endif diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_media_demo_democonfirm.c b/qcsrc/menu/xonotic/dialog_multiplayer_media_demo_democonfirm.c deleted file mode 100644 index c51e065bb..000000000 --- a/qcsrc/menu/xonotic/dialog_multiplayer_media_demo_democonfirm.c +++ /dev/null @@ -1,39 +0,0 @@ -#ifdef INTERFACE -CLASS(XonoticDemoConfirmDialog) EXTENDS(XonoticDialog) - METHOD(XonoticDemoConfirmDialog, fill, void(entity)) - ATTRIB(XonoticDemoConfirmDialog, title, string, _("Disconnect")) - ATTRIB(XonoticDemoConfirmDialog, color, vector, SKINCOLOR_DIALOG_HUDCONFIRM) - ATTRIB(XonoticDemoConfirmDialog, intendedWidth, float, 0.5) - ATTRIB(XonoticDemoConfirmDialog, rows, float, 4) - ATTRIB(XonoticDemoConfirmDialog, columns, float, 2) -ENDCLASS(XonoticDemoConfirmDialog) -#endif - -#ifdef IMPLEMENTATION -void Demo_Confirm(entity me, entity btn) -{ - if not(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)) - //me.onClick = TimeDemo_Click; - me.onClick = StartDemo_Click; - else - localcmd("togglemenu 0\n"); -} - -void XonoticDemoConfirmDialog_fill(entity me) -{ - entity e; - - me.TR(me); - me.TD(me, 1, 2, e = makeXonoticTextLabel(0.5, _("Playing a demo will disconnect you from the current match."))); - me.TR(me); - me.TD(me, 1, 2, e = makeXonoticTextLabel(0.5, _("Do you really wish to disconnect now?"))); - me.TR(me); - me.TR(me); - me.TD(me, 1, 1, e = makeXonoticButton(ZCTX(_("DMCNFRM^Yes")), '1 0 0')); - e.onClick = Demo_Confirm; - e.onClickEntity = me; - me.TD(me, 1, 1, e = makeXonoticButton(ZCTX(_("DMCNFRM^No")), '0 1 0')); - e.onClick = Dialog_Close; - e.onClickEntity = me; -} -#endif diff --git a/qcsrc/menu/xonotic/dialog_settings_effects.c b/qcsrc/menu/xonotic/dialog_settings_effects.c index c6c2ffcea..44e769f9f 100644 --- a/qcsrc/menu/xonotic/dialog_settings_effects.c +++ b/qcsrc/menu/xonotic/dialog_settings_effects.c @@ -59,7 +59,13 @@ void XonoticEffectsSettingsTab_fill(entity me) e.configureXonoticTextSliderValues(e); me.TR(me); me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Player detail:"))); - me.TD(me, 1, 2, e = makeXonoticSlider(4, 0, -0.1, "cl_playerdetailreduction")); + me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_playerdetailreduction")); + e.addValue(e, ZCTX(_("PDET^Low")), "4"); + e.addValue(e, ZCTX(_("PDET^Medium")), "3"); + e.addValue(e, ZCTX(_("PDET^Normal")), "2"); + e.addValue(e, ZCTX(_("PDET^Good")), "1"); + e.addValue(e, ZCTX(_("PDET^Best")), "0"); + e.configureXonoticTextSliderValues(e); me.TR(me); me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Texture resolution:"))); setDependent(e, "r_showsurfaces", 0, 0); diff --git a/qcsrc/menu/xonotic/mainwindow.c b/qcsrc/menu/xonotic/mainwindow.c index 213dabf02..92aa2b0c6 100644 --- a/qcsrc/menu/xonotic/mainwindow.c +++ b/qcsrc/menu/xonotic/mainwindow.c @@ -18,7 +18,8 @@ CLASS(MainWindow) EXTENDS(ModalController) ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND) ATTRIB(MainWindow, dialogToShow, entity, NULL) ATTRIB(MainWindow, notificationDialog, entity, NULL) - ATTRIB(MainWindow, democonfirmDialog, entity, NULL) + ATTRIB(MainWindow, demostartconfirmDialog, entity, NULL) + ATTRIB(MainWindow, demotimeconfirmDialog, entity, NULL) ENDCLASS(MainWindow) #endif @@ -151,11 +152,15 @@ void MainWindow_configureMainWindow(entity me) i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - me.democonfirmDialog = i = spawnXonoticDemoConfirmDialog(); + me.demostartconfirmDialog = i = spawnXonoticDemoStartConfirmDialog(); i.configureDialog(i); me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); - - + + me.demotimeconfirmDialog = i = spawnXonoticDemoTimeConfirmDialog(); + i.configureDialog(i); + me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z); + + // dialogs used by multiplayer/create me.mapInfoDialog = i = spawnXonoticMapInfoDialog(); i.configureDialog(i); -- 2.39.2