mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-22 17:12:25 -05:00
Simplify view distance cycling.
This commit is contained in:
parent
1b6b9133fe
commit
92b8266e29
1 changed files with 6 additions and 9 deletions
|
@ -102,17 +102,14 @@ namespace ClassicalSharp {
|
|||
} else if( key == Keys[KeyMapping.VSync] ) {
|
||||
VSync = VSync == VSyncMode.Off ? VSyncMode.On : VSyncMode.Off;
|
||||
} else if( key == Keys[KeyMapping.ViewDistance] ) {
|
||||
if( ViewDistance >= viewDistances[viewDistances.Length - 1] ) {
|
||||
SetViewDistance( viewDistances[0] );
|
||||
} else {
|
||||
for( int i = 0; i < viewDistances.Length; i++ ) {
|
||||
int newDistance = viewDistances[i];
|
||||
if( newDistance > ViewDistance ) {
|
||||
SetViewDistance( newDistance );
|
||||
break;
|
||||
}
|
||||
for( int i = 0; i < viewDistances.Length; i++ ) {
|
||||
int newDist = viewDistances[i];
|
||||
if( newDist > ViewDistance ) {
|
||||
SetViewDistance( newDist );
|
||||
return;
|
||||
}
|
||||
}
|
||||
SetViewDistance( viewDistances[0] );
|
||||
} else if( key == Keys[KeyMapping.PauseOrExit] && !Map.IsNotLoaded ) {
|
||||
if( !( activeScreen is PauseScreen ) ) {
|
||||
SetNewScreen( new PauseScreen( this ) );
|
||||
|
|
Loading…
Reference in a new issue