]> icculus.org git repositories - divverent/nexuiz.git/blob - menuqc/custom/demos.qm
accidently commited parts of the new demos menu with the last commit, here is the...
[divverent/nexuiz.git] / menuqc / custom / demos.qm
1 // Property of Alientrap
2 // custom/demos.qm
3
4 void() Nex_Demos_CopyToFilename =
5 {
6         local entity lItem;
7
8         if( !self._target ) {
9                 return;
10         }
11
12         Raise_DataEvent( self._target, ITEM_DATALINK_GET );
13
14         lItem = Menu_GetItem( "::Data::Demos::Filename::Text" );
15         String_EntitySet( lItem, value, self._target.value );
16         Raise_DataEvent( lItem, ITEM_DATALINK_SET );
17 };
18
19 void() Nex_Demos_Start =
20 {
21         local entity lFileList;
22         local entity lFilenameData;
23
24         lFileList = Menu_GetItem( "::Data::Demos::FileList::Demos" );
25         lFilenameData = Menu_GetItem( "::Data::Demos::Filename" );
26
27         cmd( strcat( "playdemo \"", lFileList.selected, lFilenameData.value, ".", lFileList.normal, "\"\n" ) );
28
29         // force the menu to hide
30         m_hide();
31 };
32
33 void() Nex_Demos_Refresh =
34 {
35         local entity lItem;
36
37         lItem = Menu_GetItem( "::Data::Demos::FileList" );
38         Raise_DataEvent( lItem, ITEM_DATA_SYNC );
39 };
40
41 void() Nex_Demos_SyncData =
42 {
43         if( self._realValue < Timer_Time && self._realValue > 0.0 ) {
44                 Raise_DataEvent( Menu_GetItem( "::Data::Demos" ), ITEM_DATA_SYNC );
45                 self._realValue = 0.0;
46         }
47 };