From 58b0b9da0241ff8623581b2cb837eaf34b8f165d Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 24 Aug 2015 18:06:30 +0200 Subject: UI: change behaviour of S key, allow split+W always --- README | 2 +- gui.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README b/README index 57da257..d609439 100644 --- a/README +++ b/README @@ -7,5 +7,5 @@ move mouse = move left click, space = split right click, w = eject some mass r = respawn -s = lock input. cycles through: user lock -> user and bot lock -> bot lock -> no lock +s = lock input. toggle between "user controls" and "bot controls". hold shift for "nobody controls" esc = quit 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)) -- cgit v1.2.3