@@ -29,7 +29,7 @@ public static unsafe void Postfix(CreateOptionsPicker __instance)
2929
3030 var playerButtons = __instance. MaxPlayerButtons . ToArray ( ) . ToList ( ) ; // cringe but works
3131
32- SpriteRenderer plusButton = Object . Instantiate ( playerButtons . Last ( ) , playerButtons . Last ( ) . transform . parent ) ;
32+ var plusButton = Object . Instantiate ( playerButtons . Last ( ) , playerButtons . Last ( ) . transform . parent ) ;
3333 plusButton . GetComponentInChildren < TextMeshPro > ( ) . text = "+" ;
3434 plusButton . name = "255" ;
3535 plusButton . transform . position = playerButtons . Last ( ) . transform . position + new Vector3 ( offset * 2 , 0 , 0 ) ;
@@ -39,20 +39,20 @@ public static unsafe void Postfix(CreateOptionsPicker __instance)
3939
4040 void plusListener ( )
4141 {
42- byte curHighest = byte . Parse ( playerButtons [ __instance . MaxPlayerButtons . Count - 2 ] . name ) ;
43- int delta = Mathf . Clamp ( curHighest + 12 , curHighest , maxPlayers ) - curHighest ;
42+ var curHighest = byte . Parse ( playerButtons [ __instance . MaxPlayerButtons . Count - 2 ] . name ) ;
43+ var delta = Mathf . Clamp ( curHighest + 12 , curHighest , maxPlayers ) - curHighest ;
4444 if ( delta == 0 ) return ; // fast skip
4545 for ( byte i = 1 ; i < 13 ; i ++ )
4646 {
47- SpriteRenderer button = theHackyHackButtons [ i ] ;
47+ var button = theHackyHackButtons [ i ] ;
4848 button . name =
4949 button . GetComponentInChildren < TextMeshPro > ( ) . text =
5050 ( byte . Parse ( button . name ) + delta ) . ToString ( ) ;
5151 }
5252 __instance . SetMaxPlayersButtons ( __instance . GetTargetOptions ( ) . MaxPlayers ) ;
5353 }
5454
55- SpriteRenderer minusButton = Object . Instantiate ( playerButtons . Last ( ) , playerButtons . Last ( ) . transform . parent ) ;
55+ var minusButton = Object . Instantiate ( playerButtons . Last ( ) , playerButtons . Last ( ) . transform . parent ) ;
5656 minusButton . GetComponentInChildren < TextMeshPro > ( ) . text = "-" ;
5757 minusButton . name = "255" ;
5858 minusButton . transform . position = playerButtons . First ( ) . transform . position ;
@@ -62,12 +62,12 @@ void plusListener()
6262
6363 void minusListener ( )
6464 {
65- byte curLowest = byte . Parse ( playerButtons [ 1 ] . name ) ;
66- int delta = curLowest - Mathf . Clamp ( curLowest - 12 , 4 , curLowest ) ;
65+ var curLowest = byte . Parse ( playerButtons [ 1 ] . name ) ;
66+ var delta = curLowest - Mathf . Clamp ( curLowest - 12 , 4 , curLowest ) ;
6767 if ( delta == 0 ) return ; // fast skip
6868 for ( byte i = 1 ; i < 13 ; i ++ )
6969 {
70- SpriteRenderer button = theHackyHackButtons [ i ] ;
70+ var button = theHackyHackButtons [ i ] ;
7171 button . name =
7272 button . GetComponentInChildren < TextMeshPro > ( ) . text =
7373 ( byte . Parse ( button . name ) - delta ) . ToString ( ) ;
@@ -81,7 +81,7 @@ void minusListener()
8181 button . OnClick . RemoveAllListeners ( ) ;
8282 void defaultListener ( )
8383 {
84- byte value = byte . Parse ( button . name ) ;
84+ var value = byte . Parse ( button . name ) ;
8585 var targetOptions = __instance . GetTargetOptions ( ) ;
8686 if ( value <= targetOptions . NumImpostors )
8787 {
@@ -107,7 +107,7 @@ void defaultListener()
107107
108108 for ( byte i = 4 ; i < 11 ; i ++ )
109109 {
110- SpriteRenderer button = Object . Instantiate ( impostorButtons . Last ( ) , impostorButtons . Last ( ) . transform . parent ) ;
110+ var button = Object . Instantiate ( impostorButtons . Last ( ) , impostorButtons . Last ( ) . transform . parent ) ;
111111 button . GetComponent < PassiveButton > ( ) . name = button . GetComponentInChildren < TextMeshPro > ( ) . text = i . ToString ( ) ;
112112 button . transform . position += new Vector3 ( offset , 0 , 0 ) ;
113113 impostorButtons . Add ( button ) ;
@@ -119,7 +119,7 @@ void defaultListener()
119119 button . OnClick . RemoveAllListeners ( ) ;
120120 void defaultListener ( )
121121 {
122- byte value = byte . Parse ( button . name ) ;
122+ var value = byte . Parse ( button . name ) ;
123123 if ( value >= __instance . GetTargetOptions ( ) . MaxPlayers )
124124 {
125125 return ;
0 commit comments