mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
- fixed ui scaling issues - now uses callables for thread comunication instead of enums (removed comms.py altogether) - added options to run using test server
34 lines
966 B
Python
34 lines
966 B
Python
import logging
|
|
from threading import Thread
|
|
|
|
|
|
# noinspection PyProtectedMember
|
|
class EngineFuncs:
|
|
def __init__(self, engine):
|
|
self.engine = engine
|
|
|
|
def start_button_pressed(self, *params):
|
|
def func():
|
|
self.engine.start = not self.engine.start
|
|
if self.engine.start:
|
|
self.engine.fishy_thread = Thread(target=self.engine.start_fishing, args=(*params,))
|
|
self.engine.fishy_thread.start()
|
|
|
|
self.engine.gui_events.append(func)
|
|
|
|
def check_pixel_val(self):
|
|
def func():
|
|
if self.engine.start:
|
|
self.engine._show_pixel_vals()
|
|
else:
|
|
logging.debug("Start the engine first before running this command")
|
|
|
|
self.engine.gui_events.append(func)
|
|
|
|
def quit(self):
|
|
def func():
|
|
self.engine.start = False
|
|
self.engine.event_handler_running = False
|
|
|
|
self.engine.gui_events.append(func)
|