]> icculus.org git repositories - divverent/nexuiz.git/blob - data/menuqc/custom/player/name.qc
give menu source its own directory
[divverent/nexuiz.git] / data / menuqc / custom / player / name.qc
1 // Property of Alientrap/AK
2 // custom/player/name.qc
3
4 /*
5 ===================
6 Item_Data_Nex_Name
7 ===================
8 */
9
10 void() _IDNN_Sync =
11 {
12         String_EntitySet( self, value, cvar_string( "_cl_name" ) );
13         String_EntitySet( self, _syncValue, self.value );
14 };
15 void() _IDNN_Send =
16 {
17         cmd( strcat( "name \"", self.value, "\"\n" ) );
18         String_EntitySet( self, _syncValue, self.value );
19 };
20
21 void() _IDNN_Test_Start =
22 {
23         cmd( strcat( "name \"", self.value, "\"\n" ) );
24 };
25
26 void() _IDNN_Test_End =
27 {
28         String_EntitySet( self, value, self._syncValue );
29         cmd( strcat( "name \"", self.value, "\"\n" ) );
30 };
31
32 void() _IDNN_Reset =
33 {
34         String_EntitySet( self, value, self.defValue );
35         _IDNN_Send();
36 };
37
38 void( float pEvent ) Item_Data_Nex_Name_DataEvent =
39 {
40         switch( pEvent ) {
41         case ITEM_DATA_SYNC:
42                 _IDNN_Sync();
43                 break;
44         case ITEM_DATA_SEND:
45                 _IDNN_Send();
46                 break;
47         case ITEM_DATA_RESET:
48                 _IDNN_Reset();
49                 break;
50         case ITEM_DATA_TEST_START:
51                 _IDNN_Test_Start();
52                 break;
53         case ITEM_DATA_TEST_END:
54                 _IDNN_Test_End();
55                 break;
56         }
57 };
58
59 void() Item_Data_Nex_Name_Spawn =
60 {
61         Item_Data_Init();
62
63         self._reinit = _IDNN_Sync;
64         self._dataEvent = Item_Data_Nex_Name_DataEvent;
65 };