pick up in adjacent tiles, fix bulk check

This commit is contained in:
2020-09-24 23:47:36 +03:00
parent bf13c9c7a2
commit d2b22f4760
10 changed files with 53 additions and 31 deletions

View File

@ -63,6 +63,8 @@ func (is *InventoryScreen) Enter() {
is.prepared.Prepare(is)
}
//fixme key names to action constants!
//fixme unify scrolling controls!
func (is *InventoryScreen) HandleInput(input string) {
if strings.Contains(string(runeIndex), strings.Replace(input, "Shift+", "", -1)) {
if strings.Contains("Shift+", input) {
@ -76,7 +78,7 @@ func (is *InventoryScreen) HandleInput(input string) {
return
}
switch input {
case "Up":
case "Up", "k":
is.cursor = is.cursor - 1
if is.cursor < 0 {
is.cursor = 0
@ -88,7 +90,7 @@ func (is *InventoryScreen) HandleInput(input string) {
}
}
break
case "Down":
case "Down", "j":
is.cursor = is.cursor + 1
if is.cursor >= len(is.prepared) {
is.cursor = len(is.prepared) - 1