[fix] some vconfig not applied -> stable release
This commit is contained in:
@@ -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 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: ®ex::Captures| {
|
let updated_content = re.replace_all(&file_content, |caps: ®ex::Captures| {
|
||||||
|
|||||||
@@ -91,10 +91,10 @@ const VideoSetting = () => {
|
|||||||
mapping: (value: string) => {
|
mapping: (value: string) => {
|
||||||
return (
|
return (
|
||||||
{
|
{
|
||||||
无: 0,
|
无: "0",
|
||||||
"2X MSAA": 2,
|
"2X MSAA": "2",
|
||||||
"4X MSAA": 4,
|
"4X MSAA": "4",
|
||||||
"8X MSAA": 8,
|
"8X MSAA": "8",
|
||||||
}[value] || "0"
|
}[value] || "0"
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
@@ -168,11 +168,7 @@ const VideoSetting = () => {
|
|||||||
{
|
{
|
||||||
type: "videocfg_hdr_detail",
|
type: "videocfg_hdr_detail",
|
||||||
title: "光影细节",
|
title: "光影细节",
|
||||||
value:
|
value: video.videocfg_hdr_detail === "-1" ? "高" : "低",
|
||||||
{
|
|
||||||
"3": "低",
|
|
||||||
"-1": "高",
|
|
||||||
}[parseInt(video.videocfg_hdr_detail, 10)] || "低",
|
|
||||||
options: ["低", "高"],
|
options: ["低", "高"],
|
||||||
mapping: (value: string) => {
|
mapping: (value: string) => {
|
||||||
return (
|
return (
|
||||||
@@ -386,9 +382,14 @@ const VideoSetting = () => {
|
|||||||
/>
|
/>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
aria-label="height"
|
aria-label="height"
|
||||||
value={parseInt(tool.state.videoSetting.defaultresheight, 10)}
|
value={parseInt(edit ? vconfig.defaultresheight : tool.state.videoSetting.defaultresheight, 10)}
|
||||||
onValueChange={(value) => {
|
onValueChange={(value) => {
|
||||||
tool.setVideoSetting({
|
const _ = edit
|
||||||
|
? setVconfig({
|
||||||
|
...vconfig,
|
||||||
|
defaultresheight: value.toString(),
|
||||||
|
})
|
||||||
|
: tool.setVideoSetting({
|
||||||
...tool.state.videoSetting,
|
...tool.state.videoSetting,
|
||||||
defaultresheight: value.toString(),
|
defaultresheight: value.toString(),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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) => {
|
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 })
|
await invoke("set_cs2_video_config", { steamDir: steam_dir, steamId32: steam_id32, videoConfig: video_config })
|
||||||
// console.log(video)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const addLaunchOption = (option: LaunchOption) => {
|
const addLaunchOption = (option: LaunchOption) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user