X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fdialog_multiplayer_media_demo.qc;h=6ba33e2a710128ce86bb03c1369ea84883901771;hb=e2897355e6cd1ca18e9ab1547e188eab316ce79d;hp=ab2886a28542f66987de95c3ba02ea108ee38cb1;hpb=4dd3c23aa51dd6fe855d8c5d97126a12a372eb3b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_media_demo.qc b/qcsrc/menu/xonotic/dialog_multiplayer_media_demo.qc index ab2886a28..6ba33e2a7 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_media_demo.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_media_demo.qc @@ -1,22 +1,13 @@ -#ifdef INTERFACE -CLASS(XonoticDemoBrowserTab) EXTENDS(XonoticTab) - METHOD(XonoticDemoBrowserTab, fill, void(entity)) - ATTRIB(XonoticDemoBrowserTab, title, string, _("Demo")) - ATTRIB(XonoticDemoBrowserTab, intendedWidth, float, 0.9) - 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(); -#ifdef IMPLEMENTATION -// private: +#include "dialog_multiplayer_media_demo.qh" + +#include "demolist.qh" +#include "textlabel.qh" +#include "inputbox.qh" +#include "checkbox.qh" +#include "button.qh" + const float DMO_PLAY = 1; const float DMO_TIME = 2; -#endif -#endif - -#ifdef IMPLEMENTATION void DemoConfirm_Check_Gamestatus(entity btn, entity me) { if(!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))) // we're not in a match, lets watch the demo @@ -38,7 +29,7 @@ void DemoConfirm_Check_Gamestatus(entity btn, entity me) entity makeXonoticDemoBrowserTab() { entity me; - me = spawnXonoticDemoBrowserTab(); + me = NEW(XonoticDemoBrowserTab); me.configureDialog(me); return me; } @@ -52,7 +43,6 @@ void XonoticDemoBrowserTab_fill(entity me) me.TD(me, 1, 2.9, e = makeXonoticInputBox(0, string_null)); e.onChange = DemoList_Filter_Change; 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"))); @@ -64,7 +54,8 @@ void XonoticDemoBrowserTab_fill(entity me) 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')); + me.TD(me, 1, me.columns / 2, e = makeXonoticButton_T(_("Timedemo"), '0 0 0', + _("Benchmark how fast your computer can run the highlighted demo"))); e.democlicktype = DMO_TIME; e.onClick = DemoConfirm_Check_Gamestatus; e.onClickEntity = me; // demolist is global anyway @@ -73,4 +64,3 @@ void XonoticDemoBrowserTab_fill(entity me) e.onClick = DemoConfirm_Check_Gamestatus; e.onClickEntity = me; // demolist is global anyway } -#endif