From 5f03edeb6c438f8e976f33df971d1c83abbd7930 Mon Sep 17 00:00:00 2001 From: ljqing Date: Wed, 18 Jan 2023 20:09:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=9E=8D=E5=90=88=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E5=8F=82=E6=95=B0=E6=94=B9=E4=B8=BA=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/ClientConnection.ts | 4 ++-- src/components/FusionSettingsDialog.vue | 30 ++++++++++++++----------- src/entities/WSProtocol.ts | 12 +++++----- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index 9ba1fc0..37f7795 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -1476,8 +1476,8 @@ export default class ClientConnection { } public async SetBlendingOption( - id: number, - value: number + id: string, + value: string ) { return await this.doRpc( new Protocol.SetBlendingOptionRequestEntity( diff --git a/src/components/FusionSettingsDialog.vue b/src/components/FusionSettingsDialog.vue index 5e881ea..3604d88 100644 --- a/src/components/FusionSettingsDialog.vue +++ b/src/components/FusionSettingsDialog.vue @@ -148,13 +148,13 @@ show_dialog.value = true; }; const send_hide_desktop = () => { - set?.SetBlendingOption(0, hide_desktop_value.value ? 1 : 0); + set?.SetBlendingOption(hide_desktop_value_id.value, hide_desktop_value.value ? "1" : "0"); }; const send_disable_blending_params = () => { - set?.SetBlendingOption(1, disable_blending_params.value ? 1 : 0); + set?.SetBlendingOption(disable_blending_params_id.value, disable_blending_params.value ? "1" : "0"); }; const send_show_blending_grids = () => { - set?.SetBlendingOption(1000, show_blending_grids.value ? 1 : 0); + set?.SetBlendingOption(show_blending_grids_id.value, show_blending_grids.value ? "1" : "0"); }; const resetall=()=>{ set?.ResetBlendingConfig() @@ -163,8 +163,11 @@ const EnableBlending = ref(false); let optionsstr = ref(); optionsstr.value = "FusionLocale"; - const hide_desktop_value = ref(true); + const hide_desktop_value_id = ref("0"); + const hide_desktop_value = ref(false); + const disable_blending_params_id = ref("1"); const disable_blending_params = ref(false); + const show_blending_grids_id = ref("show_blending_grids"); const show_blending_grids = ref(false); const options = computed({ get() { @@ -247,18 +250,19 @@ set?.GetBlendingConfig("").then((res) => { let tmp = JSON.parse(res ? res.config : ""); //console.log(tmp.options[0][1]) - let local_options = [ [ref(0), hide_desktop_value], [ref(1), disable_blending_params], [ref(1000), show_blending_grids] ]; + let local_options = [ + [hide_desktop_value_id, hide_desktop_value], + [disable_blending_params_id, disable_blending_params], + [show_blending_grids_id, show_blending_grids] + ]; let k:any; for(k in local_options) { let local_opt = local_options[k]; - let ii:any; - for(ii in tmp.options){ - let opt = tmp.options[ii]; - if (2 == opt.length && local_opt[0].value == opt[0]){ - local_opt[1].value = (opt[1] == 0 ? false : true); - break; - } - } + let opt = tmp.options[(local_opt[0].value)]; + if (opt) + { + local_opt[1].value = ("0" == opt || "false" == opt.toLowerCase() ? false : true); + } } }); }, 1000); diff --git a/src/entities/WSProtocol.ts b/src/entities/WSProtocol.ts index ec7d2f3..be1d1d2 100644 --- a/src/entities/WSProtocol.ts +++ b/src/entities/WSProtocol.ts @@ -3469,8 +3469,8 @@ export namespace Protocol { export class SetBlendingOptionRequestEntity extends PacketEntity { constructor( - id: number, - value: number, + id: string, + value: string, rpc_id = 0 ) { super(); @@ -3478,10 +3478,10 @@ export namespace Protocol { super.flag = PacketEntity.FLAG_REQUEST; super.rpc_id = rpc_id; - this.id = id ?? 0; - this.value = value ?? 0; + this.id = id ?? ""; + this.value = value ?? ""; } - id = 0; - value = 0; + id; + value; } }