pick up in adjacent tiles, fix bulk check
This commit is contained in:
@ -58,6 +58,7 @@ func (ts *GameScreen) Exit() {
|
||||
//remove what we dont need
|
||||
}
|
||||
|
||||
//fixme kry names to action constants!
|
||||
func (ts *GameScreen) HandleInput(input string) {
|
||||
//ts.state.Do(func(){
|
||||
switch input {
|
||||
@ -104,9 +105,18 @@ func (ts *GameScreen) HandleInput(input string) {
|
||||
} else {
|
||||
//call pickup in selected
|
||||
cc := items.Controller.GetComponent(carrieds[0], ecs.CarriedComponent).(items.Carried)
|
||||
items.Carried.Pickup(cc, ts.state.Player, carrieds[0])
|
||||
}
|
||||
err := items.Carried.Pickup(cc, ts.state.Player, carrieds[0])
|
||||
if err != nil {
|
||||
// Message with error
|
||||
//gameLog.Log.Error(err)
|
||||
//@fixme!
|
||||
appctx.Logger(ts.ctx).Warn().Err(err)
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
//log picked up
|
||||
//gameLog.Log.Message(err)
|
||||
break;
|
||||
|
||||
case "i":
|
||||
|
@ -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
|
||||
|
@ -19,6 +19,8 @@ func (ts *TitleScreen) UseEcs() bool { return false }
|
||||
func (ts *TitleScreen) Enter() {
|
||||
blt.Clear()
|
||||
}
|
||||
|
||||
//fixme key names to action constants!
|
||||
func (ts *TitleScreen) HandleInput(input string) {
|
||||
switch input {
|
||||
case "n":
|
||||
|
Reference in New Issue
Block a user