Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Voting system #21

Merged
merged 4 commits into from
Mar 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ rlbot==1.*
pip

gevent
eel
eel==0.9.*
PyQt5
20 changes: 3 additions & 17 deletions rlbot_gui/gui.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import os
import time
from datetime import datetime

import eel
from PyQt5.QtCore import QSettings
Expand Down Expand Up @@ -38,21 +36,9 @@ def __init__(self):
self.game_interface.load_interface()
self.game_tick_packet = game_data_struct.GameTickPacket()


# self.rate_limit = rate_limiter.RateLimiter(GAME_TICK_PACKET_REFRESHES_PER_SECOND)
self.last_call_real_time = datetime.now() # When we last called the Agent

def get_packet(self):

now = datetime.now()
# self.rate_limit.acquire(now - self.last_call_real_time)
self.last_call_real_time = now

self.pull_data_from_game()
return self.game_tick_packet

def pull_data_from_game(self):
self.game_interface.update_live_data_packet(self.game_tick_packet)
return self.game_tick_packet


@eel.expose
Expand Down Expand Up @@ -247,7 +233,7 @@ def on_websocket_close(page, sockets):


def is_chrome_installed():
return eel.browsers.chm.get_instance_path() is not None
return getattr(eel.browsers, "chm", getattr(eel.browsers, "chr", None)).get_instance_path() is not None


def start():
Expand All @@ -256,7 +242,7 @@ def start():

packet_reader = GameTickReader()

options = {}
options = {"chromeFlags": ["--autoplay-policy=no-user-gesture-required"]}
if not is_chrome_installed():
options = {'mode': 'system-default'} # Use the system default browser if the user doesn't have chrome.

Expand Down
Binary file modified rlbot_gui/gui/imgs/frame.webm
Binary file not shown.
Binary file added rlbot_gui/gui/imgs/socials.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rlbot_gui/gui/imgs/votes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading