1 ///////////////////////////////////////////////
2 // Custom Menu Source File
3 ///////////////////////
4 // This file belongs to dpmod/darkplaces
5 // AK contains menu specific stuff that is made especially for dpmod
6 // AK this file is used e.g. for defining some special event functions
7 ////////////////////////////////////////////////
13 void() nex_setposition =
16 self.pos_y = (self.font_size_y + 5) * self.orderpos;
19 self.origin = self.pos;
22 void(entity item) nex_makeonlyvisible =
26 if( item.flag & FLAG_HIDDEN )
27 item.flag = item.flag - FLAG_HIDDEN;
28 for( node = item._next ; node ; node = node._next )
29 node.flag = item.flag | FLAG_HIDDEN;
30 for( node = item._prev ; node ; node = node._prev )
31 node.flag = item.flag | FLAG_HIDDEN;
34 void(void) nex_linkrelhack =
36 self._child._parent = self;
39 void(void) nex_maketextzone =
41 self.text = strzone(self.text);
44 void(void) nex_slidertext =
49 print("No link specified\n");
51 self.init = null_function;
55 ent = menu_getitem(self.link);
56 if(ent == null_entity)
58 objerror("No link found for ", self.link,"\n");
63 self.flag = self.flag | FLAG_DRAWREFRESHONLY;
65 self.refresh = _nex_slidertext_refresh;
68 void(void) _nex_slidertext_refresh =
70 self.text = ftos(self._link.value);
72 self.text = substring(self.text,0, self.maxlen);
73 // reset the size, so its set
77 float(float keynr, float ascii) nex_redirect_key =
79 if((ascii>=20 && ascii <= 126) || keynr == K_BACKSPACE || keynr == K_ENTER || keynr == K_LEFTARROW || keynr == K_RIGHTARROW || (keynr >= K_MOUSE1 && keynr <= K_MOUSE10))
81 raise_key(self._child, keynr, ascii);
87 void(void) nex_cvar_slider =
89 self.value = cvar(self.cvarname);
90 self.slidermove = self.switchchange = _nex_cvar_slider;
91 self.refresh = _nex_cvar_slider_refresh;
94 void(void) _nex_cvar_slider_refresh =
96 if(self.cvartype == CVAR_INT || self.cvartype == CVAR_FLOAT || self.cvartype == CVAR_STEP)
97 self.value = cvar(self.cvarname);
100 void(void) _nex_cvar_slider =
102 if(self.cvarname == "")
104 if(self.cvartype == CVAR_INT) // || self.cvartype == CVAR_STRING)
105 self.value = rint(self.value);
106 if(self.cvartype == CVAR_STEP)
107 self.value = rint(self.value / self.step) * self.step;
108 if(self.cvartype == CVAR_INT || self.cvartype == CVAR_FLOAT || self.cvartype == CVAR_STEP)
109 cvar_set(self.cvarname, ftos(self.value));
110 /*if(cvartype == CVAR_STRING)
113 s = getaltstring(self.value, self.cvarvalues);
114 cvar_set(self.cvarname, s);
123 void(void) nex_makeselfonlyvisible =
125 nex_makeonlyvisible( self );
130 void(void) nex_quit_choose =
133 // because of the missing support for real array, we have to do it the stupid way
134 // (we also have to use strzone for the text, cause it the temporary strings wont work
136 if(nex_quitrequest == 0)
138 e = menu_getitem("quit_msg_0");
139 e.text = getaltstring(0,nex_quitmsg_0);
141 if(nex_quitrequest == 1)
143 e = menu_getitem("quit_msg_0");
144 e.text = getaltstring(0,nex_quitmsg_1);
146 if(nex_quitrequest == 2)
148 e = menu_getitem("quit_msg_0");
149 e.text = getaltstring(0,nex_quitmsg_2);
151 if(nex_quitrequest == 3)
153 e = menu_getitem("quit_msg_0");
154 e.text = getaltstring(0,nex_quitmsg_3);
156 e.text = strzone(e.text);
158 if(nex_quitrequest == 0)
160 e = menu_getitem("quit_msg_1");
161 e.text = getaltstring(1,nex_quitmsg_0);
163 if(nex_quitrequest == 1)
165 e = menu_getitem("quit_msg_1");
166 e.text = getaltstring(1,nex_quitmsg_1);
168 if(nex_quitrequest == 2)
170 e = menu_getitem("quit_msg_1");
171 e.text = getaltstring(1,nex_quitmsg_2);
173 if(nex_quitrequest == 3)
175 e = menu_getitem("quit_msg_1");
176 e.text = getaltstring(1,nex_quitmsg_3);
178 e.text = strzone(e.text);
180 nex_quitrequest = nex_quitrequest + 1;
181 if(nex_quitrequest == DPMOD_QUIT_MSG_COUNT)
185 void(void) nex_quit =
188 // choose a quit message
192 ent = menu_getitem("main");
193 ent.flag = ent.flag | FLAG_CHILDDRAWONLY;
194 ent = menu_getitem("quit");
195 ent.flag = FLAG_NOSELECT;
196 menu_jumptowindow(ent, false);*/
200 ent = menu_getitem("quitbox_ref");
201 ent._child = menu_activewindow;
202 ent = menu_getitem("quitbox");
203 menu_jumptowindow(ent, true);
206 void(void) nex_quit_yes =
211 void(void) nex_quit_no =
215 ent = menu_getitem("quit_msg_0");
218 ent = menu_getitem("quit_msg_1");
221 ent = menu_getitem("quit");
222 ent.flag = FLAG_HIDDEN;
223 ent = menu_getitem("main");
224 ent.flag = ent.flag - FLAG_CHILDDRAWONLY;
229 float(float keynr, float ascii) nex_quit_key =
231 if(keynr == K_LEFTARROW)
233 if(keynr == K_RIGHTARROW)
237 if(keynr == K_MOUSE1)
239 if(ascii == 'Y' || ascii == 'y')
241 if(ascii == 'N' || ascii == 'n' || keynr == K_ESCAPE)
248 void(void) nex_display_options =
252 ent = menu_getitem( "options" );
254 nex_makeonlyvisible( ent );
255 menu_jumptowindow( ent, false );
261 void(void) nex_display_video =
263 nex_makeonlyvisible( menu_getitem( "video" ) );
264 menu_jumptowindow( menu_getitem( "video" ), false );
267 void(void) nex_video_bpp_reinit =
269 if(cvar("vid_bitsperpixel") == 32)
275 void(void) nex_video_fullscreen_reinit =
277 self.value = cvar("vid_fullscreen");
280 string nex_video_resolutions;
282 void(void) nex_video_resolution_switch_reinit =
287 c = getaltstringcount(nex_video_resolutions);
288 for(i = 0; i < c; i=i+1)
292 s = getaltstring(i,nex_video_resolutions);
293 s = strcat("'",s,"'");
295 if(t_x == cvar("vid_width") && t_y == cvar("vid_height"))
307 void(void) nex_video_resolution_switch =
310 var float counter = 0;
313 nex_video_resolutions = "";
317 while((t = getresolution(counter)) != '0 0 0')
321 if(t_x == cvar("vid_width") && t_y == cvar("vid_height"))
323 self.value = counter;
325 counter = counter + 1;
326 self.text = strcat(self.text,"'",ftos(t_x),"x");
327 self.text = strcat(self.text,ftos(t_y),"'");
328 nex_video_resolutions = strcat(nex_video_resolutions,vtos(t));
334 self.text = strzone(self.text);
335 nex_video_resolutions = strzone(nex_video_resolutions);
337 self.reinit = nex_video_resolution_switch;
340 void(void) nex_video_apply =
349 res_x = cvar("vid_width");
350 res_y = cvar("vid_height");
353 tmp = menu_getitem("video_resolution_switch");
354 set = stov(getaltstring(tmp.value, nex_video_resolutions));
357 cvar_set("vid_width",ftos(set_x));
358 cvar_set("vid_height",ftos(set_y));
362 tmp = menu_getitem("video_bpp_switch");
363 if((tmp.value+1)*16 != cvar("vid_bitsperpixel"))
365 cvar_set("vid_bitsperpixel",ftos((tmp.value+1)*16));
368 // fullscreen changed
369 tmp = menu_getitem("video_fullscreen_switch");
370 if(tmp.value != cvar("vid_fullscreen"))
372 cvar_set("vid_fullscreen",ftos(tmp.value));
378 cmd("vid_restart\n");
390 var float selectnum = 0;
399 // create the mapselection frame stuff
400 void(void) nex_xp_build_maplist =
404 entity template_text;
409 // search through maps for all bsps and add them to the list
410 // if a picture exists for them, add it to
411 searchhandle = search_begin("maps/*.bsp",true,true);
412 if(searchhandle == -1)
414 print("menu: No maps found...\n");
418 template_text = menu_getitem("mapselection_template_text");
419 template_pic = menu_getitem("mapselection_template_picture");
420 template_text.pos_y = (template_pic.size_y - template_text.font_size_y) / 2;
423 pic = menu_getitem("mapselection_frame");
424 FRAME_WIDTH = rint(pic.clip_size_x / template_pic.size_x);
427 PIC_WIDTH = template_pic.size_x;
429 // adjust the clip size of the frame
430 pic.clip_size_y = template_pic.size_y;
432 // adjust the selection square
433 pic = menu_getitem("mapselection_selsquare");
435 pic.size = template_pic.size;
437 mapnum = search_getsize(searchhandle);
439 for(counter = 0; counter < mapnum; counter = counter + 1)
445 extstripped = search_getfilename(searchhandle, counter);
446 extstripped = substring(extstripped, 0, strlen(extstripped) - 4); // .bsp off
447 extstripped = strzone(extstripped);
449 allstripped = substring(extstripped, 5, 400); // maps/ off
450 allstripped = strzone(allstripped);
453 copyentity(template_pic, pic);
455 pic.orderpos = counter + 1;
456 pic.pos_x = counter * template_pic.size_x;
457 pic.name = strzone(allstripped);
459 // TODO: add support for other formats, too
460 filehandle = search_begin(strcat(extstripped,".jpg"), true, true);
463 pic.picture = strcat(extstripped,".jpg");
464 pic.picture = strzone(pic.picture);
465 search_end(filehandle);
470 copyentity(template_text, mapname);
472 mapname.name = strzone(strcat(allstripped, "_text"));
473 mapname.text = strzone(allstripped);
475 mapname.orderpos = counter + mapnum + 1;
477 mapname.pos_x = counter * template_pic.size_x;
479 mapname.size_x = template_pic.size_x;
480 mapname.size_y = mapname.font_size_y;
481 mapname.font_size = '0 0 0';
495 strunzone(extstripped);
496 strunzone(allstripped);
499 search_end(searchhandle);
502 void(void) nex_xp_prev =
508 selectnum = selectnum - 1;
509 selectmap = selectmap._prev;
511 s = menu_getitem("mapselection_selsquare");
512 s.pos_x = selectnum * PIC_WIDTH;
515 if((mapnum - 1 - selectnum) > floor(FRAME_WIDTH / 2) && selectnum + 1 >= ceil(FRAME_WIDTH / 2)) // 2,3
517 s = menu_getitem("mapselection_frame");
518 s.origin_x = s.origin_x + PIC_WIDTH;
522 void(void) nex_xp_next =
525 if(selectnum >= mapnum - 1)
528 selectnum = selectnum + 1;
529 selectmap = selectmap._next;
531 s = menu_getitem("mapselection_selsquare");
532 s.pos_x = selectnum * PIC_WIDTH;
535 if((mapnum - 1 - selectnum) >= floor(FRAME_WIDTH / 2) && selectnum + 1 > ceil(FRAME_WIDTH / 2)) // 2,3
537 s = menu_getitem("mapselection_frame");
538 s.origin_x = s.origin_x - PIC_WIDTH;
542 void(void) nex_xp_click = // if one of the maplist entries get 'clicked' :-)
548 if(self.orderpos > mapnum)
550 deltapos = self.orderpos - mapnum - selectnum - 1;
553 deltapos = self.orderpos - selectnum - 1;
563 deltapos = deltapos - 1;
571 deltapos = deltapos + 1;
577 void(void) nex_display_singleplayer =
579 nex_makeonlyvisible( menu_getitem( "singleplayer" ) );
580 menu_jumptowindow( menu_getitem( "singleplayer"), false );
583 void(void) nex_display_multiplayer =
585 nex_makeonlyvisible( menu_getitem( "multiplayer" ) );
586 menu_jumptowindow( menu_getitem( "multiplayer" ), false );
589 void(void) nex_xp_maxfrags =
595 strunzone(self.text);
597 self.text = strzone(self.text);
600 void(void) nex_xp_maxbots =
606 strunzone(self.text);
608 self.text = strzone(self.text);
611 void(void) nex_xp_maxtime =
617 strunzone(self.text);
618 self.text = ftos(maxtime);
619 self.text = strzone(self.text);
622 void(void) nex_sp_start =
626 cvar_set("fraglimit", ftos(maxfrags));
627 cvar_set("timelimit", ftos(maxtime));
628 cvar_set("deathmatch", ftos(1));
629 cvar_set("maxplayers", ftos(maxbots + 1));
632 cmd(";wait;togglemenu;wait;");
634 // BLACK: TODO - change this somewhen into something cleaner - see bot/bot.qc
635 //if(maxbots && maxbots <= (99 - 40 + 1))
638 t = strcat("impulse ", ftos(40 + maxbots - 1));
646 void(void) nex_mp_hostname =
648 hostname = self.text;
651 void(void) nex_mp_maxclients =
655 maxclients = rint(i);
657 strunzone(self.text);
658 self.text = strzone(ftos(maxclients));
661 void(void) nex_mp_publicserv =
663 publicserver = self.value;
666 void(void) nex_mp_start =
668 cvar_set("fraglimit", ftos(maxfrags));
669 cvar_set("timelimit", ftos(maxtime));
670 cvar_set("deathmatch", ftos(1));
671 cvar_set("maxplayers", ftos(maxclients));
672 cvar_set("sv_public", ftos(publicserver));
673 cvar_set("hostname", hostname);
676 cmd(";wait;togglemenu\n");
679 void(void) nex_goto_createserver =
681 menu_jumptowindow( menu_getitem( "multiplayer_frame"), false );
685 var float slist_selected = 0;
686 var float slist_start = 0;
687 float slist_estimatedsize;
689 void(void) nex_display_serverlist =
691 if(menu_activewindow.name == "serverlist")
693 menu_jumptowindow(menu_getitem("serverlist"),true);
697 // use a ITEM_TEXT as base item for this
698 // we need another item to clip the slist
699 // (another reason for a new menu qc!)
700 void(void) slist_draw =
706 //print("slist drawing...", ftos(listsize), "\n");
708 pos = '0 0 0'; // the upper item sets the origin
709 listsize = gethostcachevalue(SLIST_HOSTCACHECOUNT);
712 menu_drawstring(pos, "No Servers", self.font_size, self.color, self.alpha, self.drawflag);
716 for(c = 0; c < slist_estimatedsize + 1; c = c + 1)
720 if(listsize <= slist_start + c)
723 //print("drawing ", ftos(c),"\n");
725 if(slist_selected - slist_start == c)
729 s_y = self.font_size_y * 2;
731 menu_fillarea(pos, s, self.color_selected, self.alpha_selected * (sin(time * 9) + 1) / 2, self.drawflag_selected);
734 line = gethostcachestring(SLIST_LINE1, slist_start + c);
736 menu_drawstring(pos, line, self.font_size, self.color, self.alpha, self.drawflag);
738 pos_y = pos_y + self.font_size_y;
740 line = gethostcachestring(SLIST_LINE2, slist_start + c);
742 menu_drawstring(pos, line, self.font_size, self.color, self.alpha, self.drawflag);
744 pos_y = pos_y + self.font_size_y;
748 void(void) slist_init =
750 self.size = self._parent.size;
751 slist_estimatedsize = self.size_y / self.font_size_y / 2;
754 void(void) slist_refresh =
758 hostcachesize = gethostcachevalue(SLIST_HOSTCACHECOUNT);
759 if(slist_start >= hostcachesize)
760 slist_start = ceil(hostcachesize - slist_estimatedsize);
763 if(slist_selected >= hostcachesize)
764 slist_selected = hostcachesize;
767 void(void) slist_join =
770 cname = gethostcachestring(SLIST_CNAME, slist_selected);
776 cmd(" ;togglemenu\n");
780 float(float keynr, float ascii ) slist_key =
784 if(keynr == K_UPARROW)
786 if(slist_selected > 0)
787 slist_selected = slist_selected - 1;
788 if(slist_start > slist_selected)
789 slist_start = slist_selected;
791 } else if(keynr == K_DOWNARROW)
793 listsize = gethostcachevalue(SLIST_HOSTCACHECOUNT);
794 if(slist_selected < listsize - 1)
795 slist_selected = slist_selected + 1;
796 if(slist_start + slist_estimatedsize - 0.5 < slist_selected)
797 slist_start = ceil(slist_selected - slist_estimatedsize + 0.5);
799 } else if(keynr == K_ENTER)
803 } else if(keynr == K_SPACE)
807 } else if(keynr == K_MOUSE1)
811 listsize = gethostcachevalue(SLIST_HOSTCACHECOUNT);
812 pos = floor(menu_cursor_y / self.font_size_y / 2);
814 if(pos + slist_start == slist_selected)
816 else if(pos + slist_start < listsize)
817 slist_selected = pos;
823 void(void) slist_info1 =
828 query = gethostcachevalue(SLIST_MASTERQUERYCOUNT);
829 reply = gethostcachevalue(SLIST_MASTERREPLYCOUNT);
831 strunzone(self.text);
833 temp = strcat(ftos(reply), "/");
834 temp = strcat(temp, ftos(query), " Master Servers");
836 self.text = strzone(temp);
839 void(void) slist_info2 =
844 query = gethostcachevalue(SLIST_SERVERQUERYCOUNT);
845 reply = gethostcachevalue(SLIST_SERVERREPLYCOUNT);
847 strunzone(self.text);
849 temp = strcat(ftos(reply), "/");
850 temp = strcat(temp, ftos(query), " Game Servers");
852 self.text = strzone(temp);
859 void(void) nex_options_alwaysrun_switchchange =
863 cvar_set("cl_forwardspeed","400");
864 cvar_set("cl_backspeed","400");
868 cvar_set("cl_forwardspeed","200");
869 cvar_set("cl_backspeed","200");
873 void(void) nex_options_alwaysrun_refresh =
875 if(cvar("cl_forwardspeed") > 200)
881 void(void) nex_options_invmouse_switchchange =
884 old = 0 - cvar("m_pitch");
885 cvar_set("m_pitch",ftos(old));
888 void(void) nex_options_invmouse_refresh =
890 if(cvar("m_pitch") > 0)
899 ent = menu_getitem("options_sound");
900 nex_makeonlyvisible( ent );
901 menu_jumptowindow(ent, false);
904 void(void) nex_snd_cd_init =
906 if(cvar("cdaudioinitialized"))
908 self.flag = FLAG_AUTOSETCLICK;
909 self.color = ITEM_TEXT_NORMAL_COLOR;
913 self.flag = FLAG_NOSELECT | FLAG_DRAWONLY | FLAG_CHILDDRAWONLY;
914 self.color = '0.5 0.5 0.5';
918 void(void) nex_snd_snd_init =
920 if(cvar("snd_initialized"))
922 self.flag = FLAG_AUTOSETCLICK;
923 self.color = ITEM_TEXT_NORMAL_COLOR;
927 self.flag = FLAG_NOSELECT | FLAG_DRAWONLY | FLAG_CHILDDRAWONLY;
928 self.color = '0.5 0.5 0.5';
935 ent = menu_getitem("options_cc");
936 nex_makeonlyvisible( ent );
937 menu_jumptowindow(ent, false);
940 void(void) nex_cc_reset =
960 void(void) nex_cc_check_hwgamma =
962 if(cvar("vid_hardwaregammasupported"))
964 self.flag = FLAG_AUTOSETCLICK;
965 self.color = ITEM_TEXT_NORMAL_COLOR;
969 self.flag = FLAG_NOSELECT;
970 self.color = '0.5 0.5 0.5';
974 void(void) nex_cc_check_gamma = // used in key -- BADBAD HACKHACK
976 if(cvar("v_hwgamma") && cvar("vid_hardwaregammasupported") && !cvar("v_color_enable"))
978 self.flag = FLAG_AUTOSETCLICK;
979 self.color = ITEM_TEXT_NORMAL_COLOR;
983 self.flag = FLAG_NOSELECT;
984 self.color = '0.5 0.5 0.5';
988 void(void) nex_cc_check_grey = // used in key -- BADBAD HACKHACK
990 if(cvar("v_hwgamma") && cvar("vid_hardwaregammasupported") && cvar("v_color_enable"))
992 self.flag = FLAG_AUTOSETCLICK;
993 self.color = ITEM_TEXT_NORMAL_COLOR;
997 self.flag = FLAG_NOSELECT;
998 self.color = '0.5 0.5 0.5';
1002 void(void) nex_cc_check_ncolor_enable =
1004 if(!cvar("v_color_enable"))
1006 self.flag = FLAG_AUTOSETCLICK;
1007 self.color = ITEM_TEXT_NORMAL_COLOR;
1011 self.flag = FLAG_NOSELECT;
1012 self.color = '0.5 0.5 0.5';
1016 void(void) nex_cc_check_color_enable =
1018 if(cvar("v_color_enable"))
1020 self.flag = FLAG_AUTOSETCLICK;
1021 self.color = ITEM_TEXT_NORMAL_COLOR;
1025 self.flag = FLAG_NOSELECT;
1026 self.color = '0.5 0.5 0.5';
1030 void(void) nex_cc_color_enable =
1032 cvar_set("v_color_enable","1");
1035 void(void) nex_cc_ncolor_enable =
1037 cvar_set("v_color_enable","0");
1040 void(void) nex_cc_grey_refresh =
1042 self.value = cvar(strcat(self.cvarname,"_r"));
1043 self.value = self.value + cvar(strcat(self.cvarname,"_g"));
1044 self.value = self.value + cvar(strcat(self.cvarname,"_b"));
1045 self.value = self.value / 3;
1049 void(void) nex_cc_grey_move =
1052 tmp = ftos(self.value);
1053 cvar_set(strcat(self.cvarname,"_r"), tmp);
1054 cvar_set(strcat(self.cvarname,"_g"), tmp);
1055 cvar_set(strcat(self.cvarname,"_b"), tmp);
1058 void(void) nex_cc_grey =
1060 self.refresh = nex_cc_grey_refresh;
1061 self.slidermove = nex_cc_grey_move;
1064 // key control stuff
1065 void(void) nex_cntrl =
1068 ent = menu_getitem("options_control");
1069 nex_makeonlyvisible( ent );
1070 menu_jumptowindow(ent, false);
1073 const float NUMKEYS = 2; // visible key count (first and secondary key)
1076 void(float keynr, float ascii) nex_con_keyhook =
1080 //dprint("nex_con_keyhook called !\n");
1082 if(keynr != K_ESCAPE)
1085 tmp = bind_getkeylist(bindcommand);
1086 // remove the binds if we need more space
1087 bind_limitbinds(NUMKEYS - 1, bindcommand);
1089 bind_bindkey(bind_getstringforkey(keynr), bindcommand);
1092 ent = menu_getitem("options_control_statemsg1");
1095 ent = menu_getitem("options_control_statemsg2");
1098 menu_keyhook = null_function;
1101 void(void) nex_con_action_key =
1105 bindcommand = self.link;
1107 //dprint("action called");
1109 menu_keyhook = nex_con_keyhook;
1111 ent = menu_getitem("options_control_statemsg1");
1114 ent = menu_getitem("options_control_statemsg2");
1118 float(float keynr, float ascii) nex_con_key =
1122 // the user wants to unbind this action
1123 //dprint("Removing binds for '", self.link,"'\n");
1124 bind_limitbinds(0, self.link);
1131 void(void) nex_con_update_keys =
1140 keystr = strzone(bind_getkeylist(self.link));
1144 for(ent = self._child; ent != null_entity; ent = ent._next)
1148 keynr = stof(getaltstring(num, keystr));
1150 strunzone(ent.text);
1153 ent.text = strzone("-");
1155 ent.text = strzone(bind_getstringforkey(keynr));
1163 var float numkey = 0;
1164 void(void) CONTROL_KEY =
1166 entity key1, key2, desc;
1167 entity temp_desc, temp_key;
1169 temp_desc = menu_getitem("control_desc_template");
1170 temp_key = menu_getitem("control_key_template");
1173 copyentity(temp_desc, desc);
1176 copyentity(temp_key, key1);
1179 copyentity(temp_key, key2);
1181 desc.name = self.text;
1182 key1.name = strzone(strcat(self.text, " key1"));
1183 key2.name = strzone(strcat(self.text, " key2"));
1185 desc.pos_y = key1.pos_y = key2.pos_y = temp_desc.pos_y * numkey;
1186 key2.pos_x = 2 * key2.pos_x;
1188 desc.text = self.text;
1189 desc.link = self.link;
1191 key1.text = strzone("-");
1192 key2.text = strzone("-");
1197 desc.parent = "options_control";
1198 desc._parent = menu_getitem("options_control");
1200 key1.parent = key2.parent = desc.name;
1201 key1._parent = key2._parent = desc;
1207 numkey = numkey + 1;
1210 ////////////////////////////////////////////////////
1213 void(void) initbrightness =
1215 self.value = cvar("scr_conbrightness");
1218 void(void) setbrightness =
1220 cvar_set("scr_conbrightness",ftos(self.value));
1223 void(void) nex_main_exit =
1226 e = menu_getitem("MAIN_MENU");
1227 e.flag = FLAG_NOSELECT + FLAG_CHILDDRAWONLY;
1228 e = menu_getitem("MAIN_EXIT_MENU");
1229 e.flag = FLAG_NOSELECT;
1230 menu_jumptowindow(e, false);
1233 void(void) nex_main_exit_no =
1236 e = menu_getitem("MAIN_EXIT_MENU");
1237 e.flag = FLAG_NOSELECT + FLAG_HIDDEN;
1238 e = menu_getitem("MAIN_MENU");
1239 e.flag = FLAG_NOSELECT;
1243 void(void) nex_main_exit_yes =
1248 float(float keynr, float ascii) nex_main_exit_key =
1250 if(keynr == K_ESCAPE)
1258 void(void) dorestart =
1260 cmd("menu_restart\n");
1263 void(void) nex_text_cur_x =
1265 self.text = ftos(rint(cursor_x));
1268 void(void) nex_text_cur_y =
1270 self.text = ftos(rint(cursor_y));