mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 18:45:23 -04:00
When opening block select screen, selected block should be at bottom of visible portion of table not top (thanks imjonnyboy). Noclip should not have drag applied when no movement keys are behind held down.
This commit is contained in:
parent
56c146306a
commit
851f430a40
@ -35,8 +35,7 @@ namespace ClassicalSharp {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
int scrollY;
|
||||
|
||||
int scrollY;
|
||||
|
||||
void UpdateScrollY() {
|
||||
scrollY = selIndex / blocksPerRow;
|
||||
|
@ -93,7 +93,8 @@ namespace ClassicalSharp {
|
||||
RecreateBlockTable();
|
||||
Block held = game.Inventory.HeldBlock;
|
||||
selIndex = Array.IndexOf<Block>( blocksTable, held );
|
||||
UpdateScrollY();
|
||||
scrollY = (selIndex / blocksPerRow) - (maxRows - 1);
|
||||
ClampScrollY();
|
||||
|
||||
MoveCursorToSelected();
|
||||
game.Keyboard.KeyRepeat = true;
|
||||
|
@ -10,7 +10,10 @@ namespace ClassicalSharp {
|
||||
|
||||
bool useLiquidGravity = false; // used by BlockDefinitions.
|
||||
bool canLiquidJump = true;
|
||||
void UpdateVelocityYState() {
|
||||
void UpdateVelocityState( float xMoving, float zMoving ) {
|
||||
if( noClip && xMoving == 0 && zMoving == 0 )
|
||||
Velocity = Vector3.Zero;
|
||||
|
||||
if( flying || noClip ) {
|
||||
Velocity.Y = 0; // eliminate the effect of gravity
|
||||
if( flyingUp || jumping ) {
|
||||
|
@ -100,7 +100,7 @@ namespace ClassicalSharp {
|
||||
lastPitch = nextPitch;
|
||||
|
||||
HandleInput( ref xMoving, ref zMoving );
|
||||
UpdateVelocityYState();
|
||||
UpdateVelocityState( xMoving, zMoving );
|
||||
PhysicsTick( xMoving, zMoving );
|
||||
|
||||
nextPos = Position;
|
||||
|
Loading…
x
Reference in New Issue
Block a user