mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
removed drm from full auto
This commit is contained in:
parent
25bec628fd
commit
df2ab36021
@ -50,5 +50,5 @@ class GUIFuncs:
|
|||||||
def start_engine(self):
|
def start_engine(self):
|
||||||
def start_engine():
|
def start_engine():
|
||||||
config.set("last_started", self.gui._engine_var.get())
|
config.set("last_started", self.gui._engine_var.get())
|
||||||
self.gui.engines[self.gui._engine_var.get()][1]()
|
self.gui.engines[self.gui._engine_var.get()].start()
|
||||||
self.gui.call_in_thread(start_engine)
|
self.gui.call_in_thread(start_engine)
|
||||||
|
@ -4,6 +4,7 @@ import threading
|
|||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
import uuid
|
import uuid
|
||||||
from typing import Any, Callable, Dict, Optional
|
from typing import Any, Callable, Dict, Optional
|
||||||
|
from dataclasses import dataclass
|
||||||
|
|
||||||
from ttkthemes import ThemedTk
|
from ttkthemes import ThemedTk
|
||||||
|
|
||||||
@ -18,6 +19,12 @@ from . import main_gui
|
|||||||
from .log_config import GUIStreamHandler
|
from .log_config import GUIStreamHandler
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class EngineRunner:
|
||||||
|
config: Callable
|
||||||
|
start: Callable
|
||||||
|
|
||||||
|
|
||||||
class GUI:
|
class GUI:
|
||||||
def __init__(self, get_engine: Callable[[], IEngineHandler]):
|
def __init__(self, get_engine: Callable[[], IEngineHandler]):
|
||||||
self.funcs = GUIFuncs(self)
|
self.funcs = GUIFuncs(self)
|
||||||
@ -58,13 +65,13 @@ class GUI:
|
|||||||
@property
|
@property
|
||||||
def engines(self):
|
def engines(self):
|
||||||
engines = {
|
engines = {
|
||||||
"Semi Fisher": [lambda: config_top.start_semifisher_config(self), # start config function
|
"Semi Fisher": EngineRunner(lambda: config_top.start_semifisher_config(self),
|
||||||
self.engine.toggle_semifisher], # start engine function
|
self.engine.toggle_semifisher),
|
||||||
|
|
||||||
|
"Full-Auto Fisher": EngineRunner(lambda: config_top.start_fullfisher_config(self),
|
||||||
|
self.engine.toggle_fullfisher)
|
||||||
}
|
}
|
||||||
|
|
||||||
if web.has_beta():
|
|
||||||
engines["Full-Auto Fisher"] = [lambda: config_top.start_fullfisher_config(self),
|
|
||||||
self.engine.toggle_fullfisher]
|
|
||||||
return engines
|
return engines
|
||||||
|
|
||||||
def create(self):
|
def create(self):
|
||||||
|
@ -110,7 +110,8 @@ def _create(gui: 'GUI'):
|
|||||||
gui._engine_select = ttk.OptionMenu(start_frame, gui._engine_var, last_started, *labels)
|
gui._engine_select = ttk.OptionMenu(start_frame, gui._engine_var, last_started, *labels)
|
||||||
gui._engine_select.pack(side=tk.LEFT)
|
gui._engine_select.pack(side=tk.LEFT)
|
||||||
|
|
||||||
gui._config_button = ttk.Button(start_frame, text="⚙", width=0, command=lambda: engines[gui._engine_var.get()][0]())
|
gui._config_button = ttk.Button(start_frame, text="⚙", width=0,
|
||||||
|
command=lambda: engines[gui._engine_var.get()].config())
|
||||||
gui._config_button.pack(side=tk.RIGHT)
|
gui._config_button.pack(side=tk.RIGHT)
|
||||||
|
|
||||||
gui._start_button = ttk.Button(start_frame, text=gui._get_start_stop_text(), width=25,
|
gui._start_button = ttk.Button(start_frame, text=gui._get_start_stop_text(), width=25,
|
||||||
|
Loading…
Reference in New Issue
Block a user