mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-16 02:56:09 -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
@ -37,7 +37,6 @@ namespace ClassicalSharp {
|
|||||||
}
|
}
|
||||||
int scrollY;
|
int scrollY;
|
||||||
|
|
||||||
|
|
||||||
void UpdateScrollY() {
|
void UpdateScrollY() {
|
||||||
scrollY = selIndex / blocksPerRow;
|
scrollY = selIndex / blocksPerRow;
|
||||||
ClampScrollY();
|
ClampScrollY();
|
||||||
|
@ -93,7 +93,8 @@ namespace ClassicalSharp {
|
|||||||
RecreateBlockTable();
|
RecreateBlockTable();
|
||||||
Block held = game.Inventory.HeldBlock;
|
Block held = game.Inventory.HeldBlock;
|
||||||
selIndex = Array.IndexOf<Block>( blocksTable, held );
|
selIndex = Array.IndexOf<Block>( blocksTable, held );
|
||||||
UpdateScrollY();
|
scrollY = (selIndex / blocksPerRow) - (maxRows - 1);
|
||||||
|
ClampScrollY();
|
||||||
|
|
||||||
MoveCursorToSelected();
|
MoveCursorToSelected();
|
||||||
game.Keyboard.KeyRepeat = true;
|
game.Keyboard.KeyRepeat = true;
|
||||||
|
@ -10,7 +10,10 @@ namespace ClassicalSharp {
|
|||||||
|
|
||||||
bool useLiquidGravity = false; // used by BlockDefinitions.
|
bool useLiquidGravity = false; // used by BlockDefinitions.
|
||||||
bool canLiquidJump = true;
|
bool canLiquidJump = true;
|
||||||
void UpdateVelocityYState() {
|
void UpdateVelocityState( float xMoving, float zMoving ) {
|
||||||
|
if( noClip && xMoving == 0 && zMoving == 0 )
|
||||||
|
Velocity = Vector3.Zero;
|
||||||
|
|
||||||
if( flying || noClip ) {
|
if( flying || noClip ) {
|
||||||
Velocity.Y = 0; // eliminate the effect of gravity
|
Velocity.Y = 0; // eliminate the effect of gravity
|
||||||
if( flyingUp || jumping ) {
|
if( flyingUp || jumping ) {
|
||||||
|
@ -100,7 +100,7 @@ namespace ClassicalSharp {
|
|||||||
lastPitch = nextPitch;
|
lastPitch = nextPitch;
|
||||||
|
|
||||||
HandleInput( ref xMoving, ref zMoving );
|
HandleInput( ref xMoving, ref zMoving );
|
||||||
UpdateVelocityYState();
|
UpdateVelocityState( xMoving, zMoving );
|
||||||
PhysicsTick( xMoving, zMoving );
|
PhysicsTick( xMoving, zMoving );
|
||||||
|
|
||||||
nextPos = Position;
|
nextPos = Position;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user