Browse Source

Merge branch 'master' of blinkenbunt:gitrepos/blup3

feature/balanceutils
Fr3deric 8 years ago committed by Frederic
parent
commit
f69b38c402
  1. 9
      gamemenu.py
  2. 4
      wii-pair/daemon.py

9
gamemenu.py

@ -204,7 +204,7 @@ class TestInput(AbstractInput): @@ -204,7 +204,7 @@ class TestInput(AbstractInput):
pygame = self.__pygame
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if self.control.get(event.key, None) == InputEvent.STEP_ON:
if self.controls.get(event.key, None) == InputEvent.STEP_ON:
self.player_present = True
return self.controls.get(event.key, None)
return None
@ -342,12 +342,17 @@ if __name__ == '__main__': @@ -342,12 +342,17 @@ if __name__ == '__main__':
games = Game.__subclasses__()
game_idx = 0
old_idx = -1
lastrefresh = 0
while True:
if old_idx != game_idx:
gamecls = games[game_idx]
game = gamecls()
out.sendFrame(create_menu_frame(dim, game))
old_idx = game_idx
lastrefresh = 0
if time.time() >= lastrefresh+1:
out.sendFrame(create_menu_frame(dim, game))
lastrefresh = time.time()
evt = inp1.get_event()
if evt == InputEvent.LEFT:

4
wii-pair/daemon.py

@ -200,13 +200,13 @@ try: @@ -200,13 +200,13 @@ try:
v = 0
if w.weight is not None:
v = round(w.weight)
r += struct.pack('b', v)
r += struct.pack('B', v)
elif m[0] == ord('b'):
# Return battery
v = 0
if w.board.battery is not None:
v = round(w.board.battery*100)
r += struct.pack('b', v)
r += struct.pack('B', v)
else:
# Return balance
if w.pos_x is None:

Loading…
Cancel
Save