Now game dir is the correct path.
Add experimental manage profile page.
This commit is contained in:
+2
-2
@@ -667,13 +667,13 @@ class ProfileManager(QObject):
|
||||
if not isinstance(request.icon, str):
|
||||
errors["icon"] = "Icon must be a string."
|
||||
|
||||
if request.game_dir is not _UNSET:
|
||||
if request.game_dir is not _UNSET and request.game_dir is not None:
|
||||
try:
|
||||
Path(request.game_dir)
|
||||
except (TypeError, ValueError):
|
||||
errors["game_dir"] = "Game directory is invalid."
|
||||
|
||||
if request.game_dir is not _UNSET:
|
||||
if request.resolution is not _UNSET and request.resolution is not None:
|
||||
if not isinstance(request.resolution, tuple) or len(request.resolution) != 2:
|
||||
errors["resolution"] = (
|
||||
"Resolution must contain width and height."
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
"""Launcher settings schemas persisted by SettingsManager."""
|
||||
|
||||
from typing import Literal
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from constant import CLIENT_ID
|
||||
|
||||
|
||||
class GeneralSettings(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
language: Literal["en", "zh-TW"] = "zh-TW"
|
||||
|
||||
|
||||
class AppearanceSettings(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
theme: Literal["system", "light", "dark"] = "system"
|
||||
|
||||
|
||||
class AccountSettings(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
client_id: UUID = UUID(CLIENT_ID)
|
||||
Reference in New Issue
Block a user