Ignore normal input besides scrolling when ChunkMap is displayed
This commit is contained in:
parent
68c50f894b
commit
37b5ba162c
1 changed files with 14 additions and 10 deletions
24
client.py
24
client.py
|
|
@ -61,21 +61,25 @@ class Client():
|
||||||
self.chunkmap_active = not self.chunkmap_active
|
self.chunkmap_active = not self.chunkmap_active
|
||||||
self.drawevent.set()
|
self.drawevent.set()
|
||||||
elif i == "KEY_F(5)": self.map_.redraw()
|
elif i == "KEY_F(5)": self.map_.redraw()
|
||||||
# normal cursor movement
|
|
||||||
elif i == "KEY_UP": self.map_.move_cursor(0, -1)
|
|
||||||
elif i == "KEY_DOWN": self.map_.move_cursor(0, 1)
|
|
||||||
elif i == "KEY_LEFT": self.map_.move_cursor(-1, 0)
|
|
||||||
elif i == "KEY_RIGHT": self.map_.move_cursor(1, 0)
|
|
||||||
# quick cursor movement (5 vertical, 10 horizontal)
|
|
||||||
elif i == "KEY_SR": self.map_.move_cursor(0, -5)
|
|
||||||
elif i == "KEY_SF": self.map_.move_cursor(0, 5)
|
|
||||||
elif i == "KEY_SLEFT": self.map_.move_cursor(-10, 0)
|
|
||||||
elif i == "KEY_SRIGHT": self.map_.move_cursor(10, 0)
|
|
||||||
# scrolling the map (10 vertical, 20 horizontal)
|
# scrolling the map (10 vertical, 20 horizontal)
|
||||||
elif i == "kUP5": self.map_.scroll(0, -10)
|
elif i == "kUP5": self.map_.scroll(0, -10)
|
||||||
elif i == "kDN5": self.map_.scroll(0, 10)
|
elif i == "kDN5": self.map_.scroll(0, 10)
|
||||||
elif i == "kLFT5": self.map_.scroll(-20, 0)
|
elif i == "kLFT5": self.map_.scroll(-20, 0)
|
||||||
elif i == "kRIT5": self.map_.scroll(20, 0)
|
elif i == "kRIT5": self.map_.scroll(20, 0)
|
||||||
|
|
||||||
|
# break here if chunkmap is shown: Don't allow for cursor movement or input
|
||||||
|
elif self.chunkmap_active: pass
|
||||||
|
|
||||||
|
# quick cursor movement (5 vertical, 10 horizontal)
|
||||||
|
elif i == "KEY_SR": self.map_.move_cursor(0, -5)
|
||||||
|
elif i == "KEY_SF": self.map_.move_cursor(0, 5)
|
||||||
|
elif i == "KEY_SLEFT": self.map_.move_cursor(-10, 0)
|
||||||
|
elif i == "KEY_SRIGHT": self.map_.move_cursor(10, 0)
|
||||||
|
# normal cursor movement
|
||||||
|
elif i == "KEY_UP": self.map_.move_cursor(0, -1)
|
||||||
|
elif i == "KEY_DOWN": self.map_.move_cursor(0, 1)
|
||||||
|
elif i == "KEY_LEFT": self.map_.move_cursor(-1, 0)
|
||||||
|
elif i == "KEY_RIGHT": self.map_.move_cursor(1, 0)
|
||||||
# edit world
|
# edit world
|
||||||
elif i in string.digits + string.ascii_letters + string.punctuation + " ":
|
elif i in string.digits + string.ascii_letters + string.punctuation + " ":
|
||||||
self.map_.write(i)
|
self.map_.write(i)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue