[fix] some vconfig not applied -> stable release

This commit is contained in:
Purp1e
2025-03-27 18:02:51 +08:00
parent 7ec20984c4
commit faec03afb1
3 changed files with 17 additions and 16 deletions

View File

@@ -480,7 +480,7 @@ pub fn set_cs2_video(file_path: &str, data: VideoConfig) -> Result<()> {
let file_content = fs::read_to_string(file_path)?;
// 定义正则表达式匹配模式
let re = Regex::new(r#""(setting\.\w+)"\s+"\d+""#).unwrap();
let re = Regex::new(r#""(setting\.\w+)"\s+"-?\d+""#).unwrap();
// 替换字段值
let updated_content = re.replace_all(&file_content, |caps: &regex::Captures| {

View File

@@ -91,10 +91,10 @@ const VideoSetting = () => {
mapping: (value: string) => {
return (
{
: 0,
"2X MSAA": 2,
"4X MSAA": 4,
"8X MSAA": 8,
: "0",
"2X MSAA": "2",
"4X MSAA": "4",
"8X MSAA": "8",
}[value] || "0"
)
},
@@ -168,11 +168,7 @@ const VideoSetting = () => {
{
type: "videocfg_hdr_detail",
title: "光影细节",
value:
{
"3": "低",
"-1": "高",
}[parseInt(video.videocfg_hdr_detail, 10)] || "低",
value: video.videocfg_hdr_detail === "-1" ? "高" : "低",
options: ["低", "高"],
mapping: (value: string) => {
return (
@@ -386,12 +382,17 @@ const VideoSetting = () => {
/>
<NumberInput
aria-label="height"
value={parseInt(tool.state.videoSetting.defaultresheight, 10)}
value={parseInt(edit ? vconfig.defaultresheight : tool.state.videoSetting.defaultresheight, 10)}
onValueChange={(value) => {
tool.setVideoSetting({
...tool.state.videoSetting,
defaultresheight: value.toString(),
})
const _ = edit
? setVconfig({
...vconfig,
defaultresheight: value.toString(),
})
: tool.setVideoSetting({
...tool.state.videoSetting,
defaultresheight: value.toString(),
})
}}
radius="full"
step={10}

View File

@@ -229,8 +229,8 @@ const getVideoConfig = async (steam_dir: string, steam_id32: number) => {
}
const setVideoConfig = async (steam_dir: string, steam_id32: number, video_config: VideoSetting) => {
console.log(video_config.videocfg_hdr_detail)
await invoke("set_cs2_video_config", { steamDir: steam_dir, steamId32: steam_id32, videoConfig: video_config })
// console.log(video)
}
const addLaunchOption = (option: LaunchOption) => {