]> icculus.org git repositories - divverent/nexuiz.git/blob - data/scmenu/source/control/window/window.qc
restructure
[divverent/nexuiz.git] / data / scmenu / source / control / window / window.qc
1 // DP/Nex Menu
2 // control/window/normal.qc
3
4 ////////////////
5 // Item_Window
6 ///
7
8 /*
9 ===================
10 Item_Window_Key
11 ===================
12 */
13 bool( float pKey, float pAscii ) Item_Window_Key =
14 {
15         if( CtCall_Key( pKey, pAscii ) )
16                 return true;
17
18         return false;
19 };
20
21 void() Item_Window_Draw =
22 {
23         if( !sys_debug)
24                 return;
25         if( Menu_HasRunFlag( self, RUNFLAG_MOUSEINAREA ) ) {
26                 if( sys_debug_area ) {
27                         local entity lChild;
28                         Menu_Fill( self.pos, self.size, '0.2 0 0', 0.2, DRAWFLAG_NORMAL );
29
30                         for( lChild = self._child ; lChild ; lChild = lChild._next ) {
31                                 local vector lColor;
32
33                                 if( !Menu_IsVisible( lChild ) )
34                                         continue;
35
36                                 lColor_x =  mod( fabs( lChild.orderPos ) + 5, 9 ) / 8;
37                                 lColor_y = mod( fabs( lChild.orderPos * 8 ), 9 ) / 8;
38                                 lColor_z = mod( fabs( lChild.orderPos * 7 ), 9 ) / 8;
39                                 Menu_Fill( self.pos + self.origin + lChild.pos, lChild.size, lColor, 0.2, DRAWFLAG_NORMAL );
40                         }
41                 }
42                 if( sys_debug_mouse )
43                         sys_debug_cursor_localpos = Menu_Cursor_Position - self.origin - self.pos;
44         }
45 };
46
47 /*
48 ===================
49 Item_Window_Spawn
50 ===================
51 */
52 void() Item_Window_Spawn =
53 {
54         self.flag = self.flag | FLAG_NOSELECT;
55
56         self._key = Item_Window_Key;
57         self._draw = Item_Window_Draw;
58 };