More fixes to support arch distros.
This commit is contained in:
164
ptlinux/ui.py
164
ptlinux/ui.py
@@ -1350,7 +1350,7 @@ def run_dashboard(paths: AppPaths) -> None:
|
||||
).pack(anchor="w", pady=(1, 0))
|
||||
tk.Label(
|
||||
header_copy,
|
||||
text="Tune your display, rendering, and compatibility preferences.",
|
||||
text="Tune the game window, runtime, and compatibility preferences.",
|
||||
background="#24170f",
|
||||
foreground="#c9baaa",
|
||||
font=("Sans", 9),
|
||||
@@ -1361,55 +1361,12 @@ def run_dashboard(paths: AppPaths) -> None:
|
||||
content.columnconfigure(0, weight=1, uniform="settings-card")
|
||||
content.columnconfigure(1, weight=1, uniform="settings-card")
|
||||
|
||||
width_value = tk.StringVar(value=str(current_settings.width))
|
||||
height_value = tk.StringVar(value=str(current_settings.height))
|
||||
output_width_value = tk.StringVar(value=str(current_settings.output_width))
|
||||
output_height_value = tk.StringVar(value=str(current_settings.output_height))
|
||||
refresh_rate_value = tk.StringVar(value=str(current_settings.refresh_rate))
|
||||
fullscreen_value = tk.BooleanVar(value=current_settings.fullscreen)
|
||||
borderless_value = tk.BooleanVar(value=current_settings.borderless)
|
||||
scaler_value = tk.StringVar(value=current_settings.scaler)
|
||||
filter_value = tk.StringVar(value=current_settings.filter)
|
||||
runtime_value = tk.StringVar(value=current_settings.runtime)
|
||||
proton_sync_value = tk.StringVar(value=current_settings.proton_sync)
|
||||
proton_path_value = tk.StringVar(value=current_settings.proton_path or "")
|
||||
game_source_value = tk.StringVar(value=current_settings.game_source or "")
|
||||
|
||||
def add_dimensions(
|
||||
parent: ttk.LabelFrame,
|
||||
row: int,
|
||||
label: str,
|
||||
description: str,
|
||||
width_variable: tk.StringVar,
|
||||
height_variable: tk.StringVar,
|
||||
) -> None:
|
||||
ttk.Label(parent, text=label, style="SettingsText.TLabel").grid(
|
||||
row=row,
|
||||
column=0,
|
||||
sticky="w",
|
||||
)
|
||||
ttk.Label(parent, text=description, style="SettingsHint.TLabel").grid(
|
||||
row=row,
|
||||
column=1,
|
||||
sticky="e",
|
||||
)
|
||||
fields = ttk.Frame(parent, style="SettingsCard.TFrame")
|
||||
fields.grid(row=row + 1, column=0, columnspan=2, sticky="ew", pady=(3, 9))
|
||||
ttk.Label(fields, text="Width", style="SettingsHint.TLabel").pack(side="left")
|
||||
ttk.Entry(
|
||||
fields,
|
||||
textvariable=width_variable,
|
||||
width=8,
|
||||
style="Settings.TEntry",
|
||||
).pack(side="left", padx=(5, 12))
|
||||
ttk.Label(fields, text="Height", style="SettingsHint.TLabel").pack(side="left")
|
||||
ttk.Entry(
|
||||
fields,
|
||||
textvariable=height_variable,
|
||||
width=8,
|
||||
style="Settings.TEntry",
|
||||
).pack(side="left", padx=(5, 0))
|
||||
|
||||
def add_choice(
|
||||
parent: ttk.LabelFrame,
|
||||
row: int,
|
||||
@@ -1492,25 +1449,18 @@ def run_dashboard(paths: AppPaths) -> None:
|
||||
settings_window.destroy()
|
||||
settings_window = None
|
||||
|
||||
def integer_value(variable: tk.StringVar, name: str) -> int:
|
||||
value = variable.get().strip()
|
||||
try:
|
||||
return int(value)
|
||||
except ValueError as error:
|
||||
raise ValueError(f"{name} must be a whole number") from error
|
||||
|
||||
def save_current_settings() -> None:
|
||||
try:
|
||||
updated_settings = Settings(
|
||||
width=integer_value(width_value, "Client width"),
|
||||
height=integer_value(height_value, "Client height"),
|
||||
output_width=integer_value(output_width_value, "Output width"),
|
||||
output_height=integer_value(output_height_value, "Output height"),
|
||||
refresh_rate=integer_value(refresh_rate_value, "Refresh rate"),
|
||||
fullscreen=fullscreen_value.get(),
|
||||
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,
|
||||
borderless=borderless_value.get(),
|
||||
scaler=scaler_value.get(),
|
||||
filter=filter_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,
|
||||
@@ -1527,7 +1477,7 @@ def run_dashboard(paths: AppPaths) -> None:
|
||||
|
||||
display_card = ttk.LabelFrame(
|
||||
content,
|
||||
text="DISPLAY",
|
||||
text="GAME WINDOW",
|
||||
style="SettingsCard.TLabelframe",
|
||||
padding=14,
|
||||
)
|
||||
@@ -1536,66 +1486,25 @@ def run_dashboard(paths: AppPaths) -> None:
|
||||
display_card.columnconfigure(1, weight=1)
|
||||
ttk.Label(
|
||||
display_card,
|
||||
text="Choose the game canvas and the Gamescope output it is presented on.",
|
||||
text=(
|
||||
"The launcher uses the proven client resolution and can remove the "
|
||||
"new game window's host decorations."
|
||||
),
|
||||
style="SettingsHint.TLabel",
|
||||
wraplength=360,
|
||||
).grid(row=0, column=0, columnspan=2, sticky="w", pady=(0, 11))
|
||||
add_dimensions(
|
||||
display_card,
|
||||
1,
|
||||
"Game resolution",
|
||||
"Internal client size",
|
||||
width_value,
|
||||
height_value,
|
||||
)
|
||||
add_dimensions(
|
||||
display_card,
|
||||
3,
|
||||
"Output resolution",
|
||||
"Gamescope desktop",
|
||||
output_width_value,
|
||||
output_height_value,
|
||||
)
|
||||
ttk.Label(display_card, text="Refresh rate", style="SettingsText.TLabel").grid(
|
||||
row=5,
|
||||
column=0,
|
||||
sticky="w",
|
||||
)
|
||||
ttk.Label(
|
||||
display_card,
|
||||
text="Output refresh",
|
||||
style="SettingsHint.TLabel",
|
||||
).grid(row=5, column=1, sticky="e")
|
||||
refresh_fields = ttk.Frame(display_card, style="SettingsCard.TFrame")
|
||||
refresh_fields.grid(row=6, column=0, columnspan=2, sticky="w", pady=(3, 8))
|
||||
ttk.Entry(
|
||||
refresh_fields,
|
||||
textvariable=refresh_rate_value,
|
||||
width=8,
|
||||
style="Settings.TEntry",
|
||||
).pack(side="left")
|
||||
ttk.Label(refresh_fields, text="Hz", style="SettingsHint.TLabel").pack(
|
||||
side="left",
|
||||
padx=(5, 0),
|
||||
)
|
||||
presentation = ttk.Frame(display_card, style="SettingsCard.TFrame")
|
||||
presentation.grid(row=7, column=0, columnspan=2, sticky="w")
|
||||
ttk.Checkbutton(
|
||||
presentation,
|
||||
text="Fullscreen",
|
||||
variable=fullscreen_value,
|
||||
style="Settings.TCheckbutton",
|
||||
).pack(side="left")
|
||||
presentation.grid(row=1, column=0, columnspan=2, sticky="w")
|
||||
ttk.Checkbutton(
|
||||
presentation,
|
||||
text="Borderless",
|
||||
variable=borderless_value,
|
||||
style="Settings.TCheckbutton",
|
||||
).pack(side="left", padx=(18, 0))
|
||||
).pack(side="left")
|
||||
|
||||
rendering_card = ttk.LabelFrame(
|
||||
content,
|
||||
text="RENDERING & RUNTIME",
|
||||
text="RUNTIME",
|
||||
style="SettingsCard.TLabelframe",
|
||||
padding=14,
|
||||
)
|
||||
@@ -1604,44 +1513,21 @@ def run_dashboard(paths: AppPaths) -> None:
|
||||
rendering_card.columnconfigure(1, weight=1)
|
||||
ttk.Label(
|
||||
rendering_card,
|
||||
text="Control how the client is scaled and which compatible runtime launches it.",
|
||||
text="Choose which compatibility runtime launches the proven game setup.",
|
||||
style="SettingsHint.TLabel",
|
||||
wraplength=360,
|
||||
).grid(row=0, column=0, columnspan=2, sticky="w", pady=(0, 11))
|
||||
add_choice(
|
||||
rendering_card,
|
||||
1,
|
||||
"Scaling mode",
|
||||
"Gamescope layout",
|
||||
scaler_value,
|
||||
("auto", "integer", "fit", "fill", "stretch"),
|
||||
"Runtime",
|
||||
"Compatibility layer",
|
||||
runtime_value,
|
||||
("auto", "proton7-container", "proton7", "umu"),
|
||||
)
|
||||
add_choice(
|
||||
rendering_card,
|
||||
3,
|
||||
"Image filter",
|
||||
"Upscaling filter",
|
||||
filter_value,
|
||||
("linear", "nearest", "fsr", "nis", "pixel"),
|
||||
)
|
||||
ttk.Separator(rendering_card).grid(
|
||||
row=5,
|
||||
column=0,
|
||||
columnspan=2,
|
||||
sticky="ew",
|
||||
pady=(2, 9),
|
||||
)
|
||||
add_choice(
|
||||
rendering_card,
|
||||
6,
|
||||
"Runtime",
|
||||
"Compatibility layer",
|
||||
runtime_value,
|
||||
("auto", "proton7", "umu"),
|
||||
)
|
||||
add_choice(
|
||||
rendering_card,
|
||||
8,
|
||||
"Proton synchronization",
|
||||
"Auto uses esync on CachyOS",
|
||||
proton_sync_value,
|
||||
@@ -1672,8 +1558,8 @@ def run_dashboard(paths: AppPaths) -> None:
|
||||
add_path(
|
||||
overrides_card,
|
||||
3,
|
||||
"Game source",
|
||||
"Import from this existing game folder",
|
||||
"Import source",
|
||||
"Seed a new managed installation only",
|
||||
game_source_value,
|
||||
choose_game_source,
|
||||
)
|
||||
@@ -1683,7 +1569,7 @@ def run_dashboard(paths: AppPaths) -> None:
|
||||
footer.columnconfigure(0, weight=1)
|
||||
ttk.Label(
|
||||
footer,
|
||||
text="Settings are stored locally and used the next time you press Play.",
|
||||
text="Only the settings shown here affect the next launcher operation.",
|
||||
style="SettingsFooter.TLabel",
|
||||
).grid(row=0, column=0, sticky="w")
|
||||
buttons_row = ttk.Frame(footer, style="SettingsFooter.TFrame")
|
||||
|
||||
Reference in New Issue
Block a user