Drop confusing behaviour of arrow keys in BlockSelectScreen, drop unused string indexer in KeyMap class.

This commit is contained in:
UnknownShadow200 2015-01-02 17:12:53 +11:00
parent c8c156791a
commit 908c3c4ade
2 changed files with 0 additions and 57 deletions

View file

@ -171,42 +171,6 @@ namespace ClassicalSharp {
}
}
void MovePointerUp() {
if( selectedIndex == -1 ) return;
int colIndex = selectedIndex / blocksPerRow;
if( colIndex == 0 ) return;
selectedIndex -= blocksPerRow;
RecreateBlockInfoTexture();
}
void MovePointerDown() {
if( selectedIndex == -1 ) return;
selectedIndex += blocksPerRow;
if( selectedIndex >= blocksTable.Length ) {
selectedIndex -= blocksPerRow;
}
RecreateBlockInfoTexture();
}
void MovePointerLeft() {
if( selectedIndex == -1 ) return;
int rowIndex = selectedIndex % blocksPerRow;
if( rowIndex == 0 ) return;
selectedIndex--;
RecreateBlockInfoTexture();
}
void MovePointerRight() {
if( selectedIndex == -1 ) return;
int rowIndex = selectedIndex % blocksPerRow;
if( rowIndex == blocksPerRow - 1 ) return;
selectedIndex++;
if( selectedIndex >= blocksTable.Length ) {
selectedIndex = blocksTable.Length - 1;
}
RecreateBlockInfoTexture();
}
public override bool HandlesAllInput {
get { return true; }
}
@ -249,14 +213,6 @@ namespace ClassicalSharp {
public override bool HandlesKeyDown( Key key ) {
if( key == Window.Keys[KeyMapping.PauseOrExit] ) {
Window.SetNewScreen( new NormalScreen( Window ) );
} else if( key == Key.Left ) {
MovePointerLeft();
} else if( key == Key.Right ) {
MovePointerRight();
} else if( key == Key.Up ) {
MovePointerUp();
} else if( key == Key.Down ) {
MovePointerDown();
}
return true;
}

View file

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using ClassicalSharp.Particles;
using OpenTK;
using OpenTK.Input;
@ -158,18 +157,6 @@ namespace ClassicalSharp {
set { Keys[(int)key] = value; }
}
[Obsolete( "It's better to use the KeyMapping indexer")]
public Key this[string key] {
get {
KeyMapping mapping = (KeyMapping)KeyMapping.Parse( typeof( KeyMapping ), key, true );
return Keys[(int)mapping];
}
set {
KeyMapping mapping = (KeyMapping)KeyMapping.Parse( typeof( KeyMapping ), key, true );
Keys[(int)mapping] = value;
}
}
Key[] Keys = new Key[] {
Key.W, Key.S, Key.A, Key.D, Key.Space, Key.R, Key.Y, Key.T,
Key.Enter, Key.Escape, Key.B, Key.F12, Key.F11, Key.F7,