Fixed issues with encodings and wine / proton compatibilities.
This commit is contained in:
@@ -33,7 +33,7 @@ from .news import (
|
||||
)
|
||||
from .overlay import RuntimeCompatibility, inspect_runtime_compatibility
|
||||
from .paths import AppPaths
|
||||
from .settings import Settings, ensure_settings, save_settings
|
||||
from .settings import ensure_settings, update_settings
|
||||
from .self_update import (
|
||||
LauncherUpdateCheck,
|
||||
cache_launcher_update_check,
|
||||
@@ -163,12 +163,21 @@ def run_dashboard(paths: AppPaths) -> None:
|
||||
) from exc
|
||||
|
||||
paths.create_base_directories()
|
||||
ensure_settings(paths)
|
||||
root = tk.Tk()
|
||||
root.title("PristonTale EU — Linux Launcher")
|
||||
root.geometry(WINDOW_SIZE)
|
||||
root.resizable(False, False)
|
||||
root.configure(background="#0c0908")
|
||||
try:
|
||||
ensure_settings(paths)
|
||||
except (OSError, ValueError) as error:
|
||||
messagebox.showerror(
|
||||
"Launcher settings",
|
||||
f"The launcher could not load its settings:\n\n{error}",
|
||||
parent=root,
|
||||
)
|
||||
root.destroy()
|
||||
return
|
||||
|
||||
style = ttk.Style(root)
|
||||
style.theme_use("clam")
|
||||
@@ -814,6 +823,8 @@ def run_dashboard(paths: AppPaths) -> None:
|
||||
process = subprocess.Popen(
|
||||
command,
|
||||
text=True,
|
||||
encoding="utf-8",
|
||||
errors="replace",
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
bufsize=1,
|
||||
@@ -1467,7 +1478,15 @@ def run_dashboard(paths: AppPaths) -> None:
|
||||
settings_window.focus_set()
|
||||
return
|
||||
|
||||
current_settings = ensure_settings(paths)
|
||||
try:
|
||||
current_settings = ensure_settings(paths)
|
||||
except (OSError, ValueError) as error:
|
||||
messagebox.showerror(
|
||||
"Settings",
|
||||
f"The launcher could not load its settings:\n\n{error}",
|
||||
parent=root,
|
||||
)
|
||||
return
|
||||
dialog = tk.Toplevel(root)
|
||||
settings_window = dialog
|
||||
dialog.title("PristonTale EU — Settings")
|
||||
@@ -1602,27 +1621,23 @@ def run_dashboard(paths: AppPaths) -> None:
|
||||
|
||||
def save_current_settings() -> None:
|
||||
try:
|
||||
updated_settings = Settings(
|
||||
width=current_settings.width,
|
||||
height=current_settings.height,
|
||||
output_width=current_settings.output_width,
|
||||
output_height=current_settings.output_height,
|
||||
refresh_rate=current_settings.refresh_rate,
|
||||
fullscreen=current_settings.fullscreen,
|
||||
updated_settings = update_settings(
|
||||
paths,
|
||||
borderless=borderless_value.get(),
|
||||
suppress_unresponsive_warnings=suppress_unresponsive_value.get(),
|
||||
scaler=current_settings.scaler,
|
||||
filter=current_settings.filter,
|
||||
runtime=runtime_value.get(),
|
||||
proton_sync=proton_sync_value.get(),
|
||||
proton_path=proton_path_value.get().strip() or None,
|
||||
game_source=game_source_value.get().strip() or None,
|
||||
)
|
||||
save_settings(paths, updated_settings)
|
||||
except (OSError, ValueError) as error:
|
||||
messagebox.showerror("Settings", str(error), parent=dialog)
|
||||
return
|
||||
append_log(f"Saved launcher settings to {paths.settings_file}")
|
||||
append_log(
|
||||
f"Saved launcher settings to {paths.settings_file}: "
|
||||
f"runtime={updated_settings.runtime}, "
|
||||
f"proton_sync={updated_settings.proton_sync}"
|
||||
)
|
||||
status.set("Settings saved. They will be used on the next game launch.")
|
||||
progress_text.set("Open Settings again at any time to adjust the launcher.")
|
||||
close_settings()
|
||||
|
||||
Reference in New Issue
Block a user