@@ -388,114 +388,32 @@ public void MenuSelect(CCSPlayerController player, CommandInfo info)
388388 menuState . HandleInput ( key , info . CallingContext == CommandCallingContext . Console ) ;
389389 }
390390
391- [ ConsoleCommand ( "css_1" ) ]
392- public void Css1 ( CCSPlayerController player , CommandInfo info )
391+ [ ConsoleCommand ( "css_1" ) , ConsoleCommand ( "css_2" ) , ConsoleCommand ( "css_3" ) , ConsoleCommand ( "css_4" ) , ConsoleCommand ( "css_5" ) ]
392+ [ ConsoleCommand ( "css_6" ) , ConsoleCommand ( "css_7" ) , ConsoleCommand ( "css_8" ) , ConsoleCommand ( "css_9" ) , ConsoleCommand ( "css_0" ) ]
393+ public void CssIndex ( CCSPlayerController ? player , CommandInfo info )
393394 {
394395 if ( player is null || ! player . IsValid )
395396 return ;
396397 var menuState = DriverInstance ? . GetMenuState ( player , create : true ) ;
397398 if ( menuState is null )
398399 return ;
399- menuState . HandleInput ( PlayerKey . SelectItem1 , info . CallingContext == CommandCallingContext . Console ) ;
400- }
401-
402- [ ConsoleCommand ( "css_2" ) ]
403- public void Css2 ( CCSPlayerController player , CommandInfo info )
404- {
405- if ( player is null || ! player . IsValid )
406- return ;
407- var menuState = DriverInstance ? . GetMenuState ( player , create : true ) ;
408- if ( menuState is null )
409- return ;
410- menuState . HandleInput ( PlayerKey . SelectItem2 , info . CallingContext == CommandCallingContext . Console ) ;
411- }
412-
413- [ ConsoleCommand ( "css_3" ) ]
414- public void Css3 ( CCSPlayerController player , CommandInfo info )
415- {
416- if ( player is null || ! player . IsValid )
417- return ;
418- var menuState = DriverInstance ? . GetMenuState ( player , create : true ) ;
419- if ( menuState is null )
420- return ;
421- menuState . HandleInput ( PlayerKey . SelectItem3 , info . CallingContext == CommandCallingContext . Console ) ;
422- }
423-
424- [ ConsoleCommand ( "css_4" ) ]
425- public void Css4 ( CCSPlayerController player , CommandInfo info )
426- {
427- if ( player is null || ! player . IsValid )
428- return ;
429- var menuState = DriverInstance ? . GetMenuState ( player , create : true ) ;
430- if ( menuState is null )
431- return ;
432- menuState . HandleInput ( PlayerKey . SelectItem4 , info . CallingContext == CommandCallingContext . Console ) ;
433- }
434-
435- [ ConsoleCommand ( "css_5" ) ]
436- public void Css5 ( CCSPlayerController player , CommandInfo info )
437- {
438- if ( player is null || ! player . IsValid )
439- return ;
440- var menuState = DriverInstance ? . GetMenuState ( player , create : true ) ;
441- if ( menuState is null )
442- return ;
443- menuState . HandleInput ( PlayerKey . SelectItem5 , info . CallingContext == CommandCallingContext . Console ) ;
444- }
445-
446- [ ConsoleCommand ( "css_6" ) ]
447- public void Css6 ( CCSPlayerController player , CommandInfo info )
448- {
449- if ( player is null || ! player . IsValid )
450- return ;
451- var menuState = DriverInstance ? . GetMenuState ( player , create : true ) ;
452- if ( menuState is null )
453- return ;
454- menuState . HandleInput ( PlayerKey . SelectItem6 , info . CallingContext == CommandCallingContext . Console ) ;
455- }
456-
457- [ ConsoleCommand ( "css_7" ) ]
458- public void Css7 ( CCSPlayerController player , CommandInfo info )
459- {
460- if ( player is null || ! player . IsValid )
461- return ;
462- var menuState = DriverInstance ? . GetMenuState ( player , create : true ) ;
463- if ( menuState is null )
464- return ;
465- menuState . HandleInput ( PlayerKey . SelectItem7 , info . CallingContext == CommandCallingContext . Console ) ;
466- }
467-
468- [ ConsoleCommand ( "css_8" ) ]
469- public void Css8 ( CCSPlayerController player , CommandInfo info )
470- {
471- if ( player is null || ! player . IsValid )
472- return ;
473- var menuState = DriverInstance ? . GetMenuState ( player , create : true ) ;
474- if ( menuState is null )
475- return ;
476- menuState . HandleInput ( PlayerKey . SelectItem8 , info . CallingContext == CommandCallingContext . Console ) ;
477- }
478400
479- [ ConsoleCommand ( "css_9" ) ]
480- public void Css9 ( CCSPlayerController player , CommandInfo info )
481- {
482- if ( player is null || ! player . IsValid )
483- return ;
484- var menuState = DriverInstance ? . GetMenuState ( player , create : true ) ;
485- if ( menuState is null )
486- return ;
487- menuState . HandleInput ( PlayerKey . SelectItem9 , info . CallingContext == CommandCallingContext . Console ) ;
488- }
401+ var key = info . GetArg ( 0 ) switch
402+ {
403+ "css_1" => PlayerKey . SelectItem1 ,
404+ "css_2" => PlayerKey . SelectItem2 ,
405+ "css_3" => PlayerKey . SelectItem3 ,
406+ "css_4" => PlayerKey . SelectItem4 ,
407+ "css_5" => PlayerKey . SelectItem5 ,
408+ "css_6" => PlayerKey . SelectItem6 ,
409+ "css_7" => PlayerKey . SelectItem7 ,
410+ "css_8" => PlayerKey . SelectItem8 ,
411+ "css_9" => PlayerKey . SelectItem9 ,
412+ "css_0" => PlayerKey . SelectItem0 ,
413+ _ => PlayerKey . Unknown ,
414+ } ;
489415
490- [ ConsoleCommand ( "css_0" ) ]
491- public void Css0 ( CCSPlayerController player , CommandInfo info )
492- {
493- if ( player is null || ! player . IsValid )
494- return ;
495- var menuState = DriverInstance ? . GetMenuState ( player , create : true ) ;
496- if ( menuState is null )
497- return ;
498- menuState . HandleInput ( PlayerKey . SelectItem0 , info . CallingContext == CommandCallingContext . Console ) ;
416+ menuState . HandleInput ( key , info . CallingContext == CommandCallingContext . Console ) ;
499417 }
500418
501419 [ ConsoleCommand ( "css_sharpmodmenu_pos_x" ) ]
0 commit comments