fishyboteso/fishy/tech/funcs.py
DESKTOP-JVKHS7I\Adam 3e96fbed2c 0.3.3 reworked notifications again (now uses discord chat)
- fixed ui scaling issues
- now uses callables for thread comunication instead of enums (removed comms.py altogether)
- added options to run using test server
2020-05-19 10:56:50 +05:30

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)