@@ -26,6 +26,8 @@ INGAME MENU
2626#define ID_QUIT 17
2727#define ID_RESUME 18
2828#define ID_TEAMORDERS 19
29+ // https://github.com/clover-moe/mint-arena/pull/7
30+ #define ID_CREATE 20
2931
3032
3133typedef struct {
@@ -37,6 +39,7 @@ typedef struct {
3739 menutext_s server ;
3840 menutext_s leave ;
3941 menutext_s restart ;
42+ menutext_s startnew ;
4043 menutext_s addbots ;
4144 menutext_s removebots ;
4245 menutext_s teamorders ;
@@ -103,6 +106,10 @@ void InGame_Event( void *ptr, int notification ) {
103106 UI_ConfirmMenu ( "RESTART ARENA?" , (voidfunc_f )0 , InGame_RestartAction );
104107 break ;
105108
109+ case ID_CREATE :
110+ UI_StartServerMenu ( qtrue );
111+ break ;
112+
106113 case ID_QUIT :
107114 UI_ConfirmMenu ( "EXIT GAME?" , (voidfunc_f )0 , InGame_QuitAction );
108115 break ;
@@ -154,7 +161,7 @@ void InGame_MenuInit( void ) {
154161 s_ingame .frame .generic .x = 320 - 233 ;//142;
155162 s_ingame .frame .generic .y = 240 - 166 ;//118;
156163 s_ingame .frame .width = 466 ;//359;
157- s_ingame .frame .height = 332 ;//256;
164+ s_ingame .frame .height = 356 ;//256;
158165
159166 //y = 96;
160167 y = 88 ;
@@ -248,6 +255,22 @@ void InGame_MenuInit( void ) {
248255 s_ingame .server .color = color_red ;
249256 s_ingame .server .style = UI_CENTER |UI_SMALLFONT ;
250257
258+
259+ y += INGAME_MENU_VERTICAL_SPACING ;
260+ s_ingame .startnew .generic .type = MTYPE_PTEXT ;
261+ s_ingame .startnew .generic .flags = QMF_CENTER_JUSTIFY |QMF_PULSEIFFOCUS ;
262+ s_ingame .startnew .generic .x = 320 ;
263+ s_ingame .startnew .generic .y = y ;
264+ s_ingame .startnew .generic .id = ID_CREATE ;
265+ s_ingame .startnew .generic .callback = InGame_Event ;
266+ s_ingame .startnew .string = "CHANGE MAP" ;
267+ s_ingame .startnew .color = color_red ;
268+ s_ingame .startnew .style = UI_CENTER |UI_SMALLFONT ;
269+ if ( !trap_Cvar_VariableValue ( "sv_running" ) ) {
270+ s_ingame .startnew .generic .flags |= QMF_GRAYED ;
271+ }
272+
273+
251274 y += INGAME_MENU_VERTICAL_SPACING ;
252275 s_ingame .restart .generic .type = MTYPE_PTEXT ;
253276 s_ingame .restart .generic .flags = QMF_CENTER_JUSTIFY |QMF_PULSEIFFOCUS ;
@@ -303,6 +326,7 @@ void InGame_MenuInit( void ) {
303326 Menu_AddItem ( & s_ingame .menu , & s_ingame .setup );
304327 Menu_AddItem ( & s_ingame .menu , & s_ingame .server );
305328 Menu_AddItem ( & s_ingame .menu , & s_ingame .restart );
329+ Menu_AddItem ( & s_ingame .menu , & s_ingame .startnew );
306330 Menu_AddItem ( & s_ingame .menu , & s_ingame .resume );
307331 Menu_AddItem ( & s_ingame .menu , & s_ingame .leave );
308332 Menu_AddItem ( & s_ingame .menu , & s_ingame .quit );
0 commit comments