diff --git a/fishy/gui/config_top.py b/fishy/gui/config_top.py index 817aaf1..52df1cb 100644 --- a/fishy/gui/config_top.py +++ b/fishy/gui/config_top.py @@ -69,6 +69,10 @@ def start_semifisher_config(gui: 'GUI'): gui.config.set("collect_allow_auto", collect_allow_auto.instate(['selected']), False) collect_key_entry['state'] = NORMAL if config.get("collect_allow_auto") else DISABLED + def del_entry_key(event): + event.widget.delete(0,"end") + event.widget.insert(0, str(event.char)) + top = PopUp(save, gui._root, background=gui._root["background"]) controls_frame = Frame(top) top.title("Config") @@ -88,30 +92,22 @@ def start_semifisher_config(gui: 'GUI'): borderless = Checkbutton(controls_frame, var=BooleanVar(value=config.get("borderless"))) borderless.grid(row=1, column=1) - def del_action_key(event): - action_key_entry.delete(0,"end") - action_key_entry.insert(0, str(event.char)) - Label(controls_frame, text="Action Key:").grid(row=2, column=0) action_key_entry = Entry(controls_frame, justify=CENTER) action_key_entry.grid(row=2, column=1) action_key_entry.insert(0, config.get("action_key", "e")) - action_key_entry.bind("", del_action_key) + action_key_entry.bind("", del_entry_key) Label(controls_frame, text="Auto-Looting: ").grid(row=3, column=0, pady=(15, 0)) collect_allow_auto = Checkbutton(controls_frame, command=toggle_collect, var=BooleanVar(value=config.get("collect_allow_auto"))) collect_allow_auto.grid(row=3, column=1, pady=(15, 0)) - def del_collect_key(event): - collect_key_entry.delete(0,"end") - collect_key_entry.insert(0, str(event.char)) - Label(controls_frame, text="Looting Key:").grid(row=4, column=0, pady=(0, 15)) collect_key_entry = Entry(controls_frame, justify=CENTER) collect_key_entry.grid(row=4, column=1, pady=(0, 15)) collect_key_entry.insert(0, config.get("collect_key", "r")) collect_key_entry['state'] = NORMAL if config.get("collect_allow_auto") else DISABLED - collect_key_entry.bind("", del_collect_key) + collect_key_entry.bind("", del_entry_key) Label(controls_frame, text="Sound Notification: ").grid(row=5, column=0, pady=(5, 5)) sound = Checkbutton(controls_frame, var=BooleanVar(value=config.get("sound_notification")))