summaryrefslogtreecommitdiff
path: root/gui.py
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-08-24 18:06:30 +0200
committerFlorian Jung <flo@windfisch.org>2015-08-24 18:06:30 +0200
commit58b0b9da0241ff8623581b2cb837eaf34b8f165d (patch)
tree84be13623a791cf142bcfa15207baa077d4c5c44 /gui.py
parentec5409a1f1467895af7ebed239bcabb7f3dd2a0c (diff)
UI: change behaviour of S key, allow split+W always
Diffstat (limited to 'gui.py')
-rw-r--r--gui.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/gui.py b/gui.py
index 68aa48e..19fffbb 100644
--- a/gui.py
+++ b/gui.py
@@ -273,10 +273,10 @@ def draw_frame():
pygame.display.quit()
if event.type == KEYDOWN:
if event.key == K_s:
- if not input and bot_input:
+ if event.mod & KMOD_SHIFT and (input or bot_input):
input = False
bot_input = False
- elif not input and not bot_input:
+ elif not input and bot_input:
input = True
bot_input = False
else:
@@ -291,11 +291,11 @@ def draw_frame():
marker[event.button-1] = win_to_world_pt(event.pos, c.player.center)
marker_updated[event.button-1] = True
print("set marker "+str(event.button-1)+" to "+str(event.pos))
+ if event.type == KEYDOWN:
+ if event.key == K_w:
+ c.send_shoot()
+ if event.key == K_SPACE:
+ c.send_split()
if input:
- if event.type == KEYDOWN:
- if event.key == K_w:
- c.send_shoot()
- if event.key == K_SPACE:
- c.send_split()
if event.type == MOUSEMOTION:
c.send_target(*win_to_world_pt(event.pos, c.player.center))