diff --git a/steam_auto_cracker_gui.py b/steam_auto_cracker_gui.py index 0664aa3..dfe4621 100644 --- a/steam_auto_cracker_gui.py +++ b/steam_auto_cracker_gui.py @@ -12,6 +12,7 @@ import json import os import subprocess + import re from sac_lib.get_file_version import GetFileVersion import shutil from time import sleep @@ -71,6 +72,7 @@ def DoRequest(self): def select_folder(): global folder_path folder_path = filedialog.askdirectory() + folder_name = re.sub(r".*(\\|/)?([^\\]+)(\\|/)", "", folder_path) if not os.path.isdir(folder_path): update_logs("\nNo folder has been selected") selectedFolderLabel.config(text="") @@ -84,8 +86,12 @@ def select_folder(): selectedFolderLabel.config(text=f"Selected folder:\n{folder_path}") selectedFolderLabel.pack() frameGame2.pack() + gameNameEntry.delete(0, last=len(gameNameEntry.get())) + gameNameEntry.insert(0, folder_name) if gameSearchDone: frameCrack2.pack() + gameNameEntry.delete(0, last=len(gameNameEntry.get())) + gameNameEntry.insert(0, folder_name) def update_logs(log_message): # Get current content @@ -936,4 +942,4 @@ def ReloadConfig(): errorFile.write(f"SteamAutoCracker GUI v{VERSION}\n---\nA Python error occurred!\nPlease report it on GitHub or cs.rin.ru\nMake sure to blank any personal detail.\n---\n\n") traceback.print_exc(file=errorFile) traceback.print_exc() - print("---\nError written to error.log, please report it on GitHub or cs.rin.ru\nMake sure to blank any personal detail.") \ No newline at end of file + print("---\nError written to error.log, please report it on GitHub or cs.rin.ru\nMake sure to blank any personal detail.")