From c02343e68874efd57c2e312cb6b7e4f02222e43a Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Tue, 22 Jul 2025 11:11:44 -0400 Subject: add workaround env vars, rm old tests --- py_modules/lsfg_vk/plugin.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'py_modules/lsfg_vk/plugin.py') diff --git a/py_modules/lsfg_vk/plugin.py b/py_modules/lsfg_vk/plugin.py index 425d7e7..7deed71 100644 --- a/py_modules/lsfg_vk/plugin.py +++ b/py_modules/lsfg_vk/plugin.py @@ -189,7 +189,9 @@ class Plugin: experimental_present_mode: str = "fifo", dxvk_frame_rate: int = 0, enable_wow64: bool = False, - disable_steamdeck_mode: bool = False) -> Dict[str, Any]: + disable_steamdeck_mode: bool = False, + mangohud_workaround: bool = False, + disable_vkbasalt: bool = False) -> Dict[str, Any]: """Update lsfg TOML configuration Args: @@ -202,13 +204,16 @@ class Plugin: dxvk_frame_rate: Frame rate cap for DirectX games, before frame multiplier (0 = disabled) enable_wow64: Whether to enable PROTON_USE_WOW64=1 for 32-bit games disable_steamdeck_mode: Whether to disable Steam Deck mode + mangohud_workaround: Whether to enable MangoHud workaround with transparent overlay + disable_vkbasalt: Whether to disable vkBasalt layer Returns: ConfigurationResponse dict with success status """ return self.configuration_service.update_config( dll, multiplier, flow_scale, performance_mode, hdr_mode, - experimental_present_mode, dxvk_frame_rate, enable_wow64, disable_steamdeck_mode + experimental_present_mode, dxvk_frame_rate, enable_wow64, disable_steamdeck_mode, + mangohud_workaround, disable_vkbasalt ) async def update_dll_path(self, dll_path: str) -> Dict[str, Any]: -- cgit v1.2.3 From dfe4c033dd1922a63c8393ab467e9aa58fa757e4 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Tue, 22 Jul 2025 11:41:49 -0400 Subject: refactor: update configuration handling to use object-based API --- py_modules/lsfg_vk/plugin.py | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) (limited to 'py_modules/lsfg_vk/plugin.py') diff --git a/py_modules/lsfg_vk/plugin.py b/py_modules/lsfg_vk/plugin.py index 7deed71..d126d84 100644 --- a/py_modules/lsfg_vk/plugin.py +++ b/py_modules/lsfg_vk/plugin.py @@ -184,36 +184,30 @@ class Plugin: "defaults": ConfigurationManager.get_defaults() } - async def update_lsfg_config(self, dll: str, multiplier: int, flow_scale: float, - performance_mode: bool, hdr_mode: bool, - experimental_present_mode: str = "fifo", - dxvk_frame_rate: int = 0, - enable_wow64: bool = False, - disable_steamdeck_mode: bool = False, - mangohud_workaround: bool = False, - disable_vkbasalt: bool = False) -> Dict[str, Any]: - """Update lsfg TOML configuration + async def update_lsfg_config(self, config: Dict[str, Any]) -> Dict[str, Any]: + """Update lsfg TOML configuration using object-based API Args: - dll: Path to Lossless.dll - multiplier: LSFG multiplier value - flow_scale: LSFG flow scale value - performance_mode: Whether to enable performance mode - hdr_mode: Whether to enable HDR mode - experimental_present_mode: Experimental Vulkan present mode override - dxvk_frame_rate: Frame rate cap for DirectX games, before frame multiplier (0 = disabled) - enable_wow64: Whether to enable PROTON_USE_WOW64=1 for 32-bit games - disable_steamdeck_mode: Whether to disable Steam Deck mode - mangohud_workaround: Whether to enable MangoHud workaround with transparent overlay - disable_vkbasalt: Whether to disable vkBasalt layer + config: Configuration data dictionary containing all settings Returns: ConfigurationResponse dict with success status """ + # Validate and extract configuration from the config dict + validated_config = ConfigurationManager.validate_config(config) + return self.configuration_service.update_config( - dll, multiplier, flow_scale, performance_mode, hdr_mode, - experimental_present_mode, dxvk_frame_rate, enable_wow64, disable_steamdeck_mode, - mangohud_workaround, disable_vkbasalt + dll=validated_config["dll"], + multiplier=validated_config["multiplier"], + flow_scale=validated_config["flow_scale"], + performance_mode=validated_config["performance_mode"], + hdr_mode=validated_config["hdr_mode"], + experimental_present_mode=validated_config["experimental_present_mode"], + dxvk_frame_rate=validated_config["dxvk_frame_rate"], + enable_wow64=validated_config["enable_wow64"], + disable_steamdeck_mode=validated_config["disable_steamdeck_mode"], + mangohud_workaround=validated_config["mangohud_workaround"], + disable_vkbasalt=validated_config["disable_vkbasalt"] ) async def update_dll_path(self, dll_path: str) -> Dict[str, Any]: -- cgit v1.2.3 From f8139896f2077a95a78a54c818637f78dd102de8 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Tue, 22 Jul 2025 12:11:53 -0400 Subject: consolidate toml and script values --- py_modules/lsfg_vk/plugin.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'py_modules/lsfg_vk/plugin.py') diff --git a/py_modules/lsfg_vk/plugin.py b/py_modules/lsfg_vk/plugin.py index d126d84..8fa2435 100644 --- a/py_modules/lsfg_vk/plugin.py +++ b/py_modules/lsfg_vk/plugin.py @@ -185,7 +185,7 @@ class Plugin: } async def update_lsfg_config(self, config: Dict[str, Any]) -> Dict[str, Any]: - """Update lsfg TOML configuration using object-based API + """Update lsfg TOML configuration using object-based API (single source of truth) Args: config: Configuration data dictionary containing all settings @@ -196,19 +196,8 @@ class Plugin: # Validate and extract configuration from the config dict validated_config = ConfigurationManager.validate_config(config) - return self.configuration_service.update_config( - dll=validated_config["dll"], - multiplier=validated_config["multiplier"], - flow_scale=validated_config["flow_scale"], - performance_mode=validated_config["performance_mode"], - hdr_mode=validated_config["hdr_mode"], - experimental_present_mode=validated_config["experimental_present_mode"], - dxvk_frame_rate=validated_config["dxvk_frame_rate"], - enable_wow64=validated_config["enable_wow64"], - disable_steamdeck_mode=validated_config["disable_steamdeck_mode"], - mangohud_workaround=validated_config["mangohud_workaround"], - disable_vkbasalt=validated_config["disable_vkbasalt"] - ) + # Use dynamic parameter passing based on schema + return self.configuration_service.update_config_from_dict(validated_config) async def update_dll_path(self, dll_path: str) -> Dict[str, Any]: """Update the DLL path in the configuration when detected -- cgit v1.2.3