Scenario viewpoint, Z index management, and arrow controls

This commit is contained in:
2020-04-20 00:16:21 +01:00
parent 1f4bfc771c
commit 9d0750d134
10 changed files with 194 additions and 63 deletions

View File

@@ -13,3 +13,16 @@ func (s *Scenario) CellAtCursor() (maps.Cell, CellPoint) {
cell := s.area.Cell(int(s.selectedCell.X), int(s.selectedCell.Y), 0)
return cell, CellPoint{IsoPt: s.selectedCell, Z: 0}
}
func (s *Scenario) ChangeZIdx(by int) {
newZ := s.ZIdx + by
if newZ < 0 {
newZ = 0
}
if newZ > 6 {
newZ = 6
}
s.ZIdx = newZ
}