From edd5a9787206060b14cb273b705b4beaeb570b12 Mon Sep 17 00:00:00 2001 From: fan Date: Wed, 18 Oct 2023 14:42:00 +0800 Subject: [PATCH] =?UTF-8?q?pslButton=E6=8C=89=E9=92=AE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bj-rtss-message | 2 +- .../draw-app/properties/PslButtonProperty.vue | 6 +++++ src/drawApp/graphics/PslButtonInteraction.ts | 6 +++++ src/graphics/pslButton/pslButton.ts | 2 ++ src/layouts/PslDrawLayout.vue | 2 +- src/protos/pslGraphics.ts | 23 +++++++++++++++++++ 6 files changed, 39 insertions(+), 2 deletions(-) diff --git a/bj-rtss-message b/bj-rtss-message index 6ca28f5..df8a26f 160000 --- a/bj-rtss-message +++ b/bj-rtss-message @@ -1 +1 @@ -Subproject commit 6ca28f502f039fbb5d8b76d9ec42ff96ba7cb2be +Subproject commit df8a26fc7f63149b402a16f7c12a7331f7ad6152 diff --git a/src/components/draw-app/properties/PslButtonProperty.vue b/src/components/draw-app/properties/PslButtonProperty.vue index 2fcb03b..ca3046b 100644 --- a/src/components/draw-app/properties/PslButtonProperty.vue +++ b/src/components/draw-app/properties/PslButtonProperty.vue @@ -18,6 +18,12 @@ @update:model-value="onUpdate" label="按钮颜色" /> + diff --git a/src/drawApp/graphics/PslButtonInteraction.ts b/src/drawApp/graphics/PslButtonInteraction.ts index 1851264..f81d262 100644 --- a/src/drawApp/graphics/PslButtonInteraction.ts +++ b/src/drawApp/graphics/PslButtonInteraction.ts @@ -37,6 +37,12 @@ export class PslButtonData extends GraphicDataBase implements IPslButtonData { set buttonColor(v: pslGraphicData.PslElementColor) { this.data.buttonColor = v; } + get isSelfReset(): boolean { + return this.data.isSelfReset; + } + set isSelfReset(v: boolean) { + this.data.isSelfReset = v; + } clone(): PslButtonData { return new PslButtonData(this.data.cloneMessage()); } diff --git a/src/graphics/pslButton/pslButton.ts b/src/graphics/pslButton/pslButton.ts index b56031e..8684211 100644 --- a/src/graphics/pslButton/pslButton.ts +++ b/src/graphics/pslButton/pslButton.ts @@ -22,6 +22,8 @@ export interface IPslButtonData extends GraphicData { set code(v: string); get buttonColor(): pslGraphicData.PslElementColor; set buttonColor(v: pslGraphicData.PslElementColor); + get isSelfReset(): boolean; + set isSelfReset(v: boolean); } export interface IPslButtonState extends GraphicState { diff --git a/src/layouts/PslDrawLayout.vue b/src/layouts/PslDrawLayout.vue index 69fdc88..455d6c6 100644 --- a/src/layouts/PslDrawLayout.vue +++ b/src/layouts/PslDrawLayout.vue @@ -91,7 +91,7 @@ > - +
diff --git a/src/protos/pslGraphics.ts b/src/protos/pslGraphics.ts index 26ea3c7..ab43352 100644 --- a/src/protos/pslGraphics.ts +++ b/src/protos/pslGraphics.ts @@ -318,6 +318,7 @@ export namespace pslGraphicData { common?: dependency_1.graphicData.CommonInfo; code?: string; buttonColor?: PslElementColor; + isSelfReset?: boolean; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -331,6 +332,9 @@ export namespace pslGraphicData { if ("buttonColor" in data && data.buttonColor != undefined) { this.buttonColor = data.buttonColor; } + if ("isSelfReset" in data && data.isSelfReset != undefined) { + this.isSelfReset = data.isSelfReset; + } } } get common() { @@ -354,10 +358,17 @@ export namespace pslGraphicData { set buttonColor(value: PslElementColor) { pb_1.Message.setField(this, 4, value); } + get isSelfReset() { + return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean; + } + set isSelfReset(value: boolean) { + pb_1.Message.setField(this, 5, value); + } static fromObject(data: { common?: ReturnType; code?: string; buttonColor?: PslElementColor; + isSelfReset?: boolean; }): PslButton { const message = new PslButton({}); if (data.common != null) { @@ -369,6 +380,9 @@ export namespace pslGraphicData { if (data.buttonColor != null) { message.buttonColor = data.buttonColor; } + if (data.isSelfReset != null) { + message.isSelfReset = data.isSelfReset; + } return message; } toObject() { @@ -376,6 +390,7 @@ export namespace pslGraphicData { common?: ReturnType; code?: string; buttonColor?: PslElementColor; + isSelfReset?: boolean; } = {}; if (this.common != null) { data.common = this.common.toObject(); @@ -386,6 +401,9 @@ export namespace pslGraphicData { if (this.buttonColor != null) { data.buttonColor = this.buttonColor; } + if (this.isSelfReset != null) { + data.isSelfReset = this.isSelfReset; + } return data; } serialize(): Uint8Array; @@ -398,6 +416,8 @@ export namespace pslGraphicData { writer.writeString(2, this.code); if (this.buttonColor != PslElementColor.red) writer.writeEnum(4, this.buttonColor); + if (this.isSelfReset != false) + writer.writeBool(5, this.isSelfReset); if (!w) return writer.getResultBuffer(); } @@ -416,6 +436,9 @@ export namespace pslGraphicData { case 4: message.buttonColor = reader.readEnum(); break; + case 5: + message.isSelfReset = reader.readBool(); + break; default: reader.skipField(); } }