diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index 0b3e598..f6d565f 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -554,7 +554,8 @@ export default class ClientConnection { x: number, y: number, width: number, - height: number + height: number, + limit: boolean = true ) { this.ws?.send( JSON.stringify( @@ -563,7 +564,8 @@ export default class ClientConnection { x, y, width, - height + height, + limit ) ) ); diff --git a/src/components/AboutDialog.vue b/src/components/AboutDialog.vue index 199c0f8..6ebf677 100644 --- a/src/components/AboutDialog.vue +++ b/src/components/AboutDialog.vue @@ -30,12 +30,12 @@ - + {{ $t("product name") }}: {{ $t("TV splicing box") }} - + {{ $t("copyright") }}: {{ $t("guangdong chuangxian jishu") }} LTD. diff --git a/src/entities/MultimediaWindowEntity.ts b/src/entities/MultimediaWindowEntity.ts index aadfa9d..0a7491b 100644 --- a/src/entities/MultimediaWindowEntity.ts +++ b/src/entities/MultimediaWindowEntity.ts @@ -3,6 +3,8 @@ import { SignalSourceEntity } from "./SignalSourceEntity"; import { StringKeyValueEntity } from "./StringKeyValueEntity"; import { Protocol } from "./WSProtocol"; +import window_color_list from "../store/window_color_list.js"; + export class MultimediaWindowEntity extends BaseEntity { x: number = 0; y: number = 0; @@ -45,5 +47,7 @@ export class WindowOpenNotifyEntity extends MultimediaWindowEntity { /** 轮询时的属性,不轮询时无效 */ polling_window_type: string = "EWindowType::Normal"; - client_color: string = ""; + client_color: string = window_color_list.length + ? window_color_list[Math.round(Math.random() * window_color_list.length)] + : "blue"; } diff --git a/src/entities/WSProtocol.ts b/src/entities/WSProtocol.ts index d62c497..daf7df9 100644 --- a/src/entities/WSProtocol.ts +++ b/src/entities/WSProtocol.ts @@ -628,12 +628,15 @@ export namespace Protocol { y: number = 0; width: number = 0; height: number = 0; + limit: boolean = true; + constructor( window_id: number, x: number, y: number, width: number, - height: number + height: number, + limit: boolean = true ) { super(); this.command = Commands.kSetWindowGeometry; @@ -642,6 +645,7 @@ export namespace Protocol { this.y = y ?? 0; this.width = width ?? 0; this.height = height ?? 0; + this.limit = limit ?? 0; } } diff --git a/src/store/index.ts b/src/store/index.ts index 009612a..36dcb6d 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -338,10 +338,12 @@ export default store(function (/* { ssrContext } */) { } for (const window of state.windows) { if (window) { - window.client_color = window_color_list.splice( - Math.round(Math.random() * window_color_list.length), - 1 - )[0]; + try { + window.client_color = window_color_list.splice( + Math.round(Math.random() * window_color_list.length), + 1 + )[0]; + } catch {} } } } @@ -352,11 +354,12 @@ export default store(function (/* { ssrContext } */) { }, pushWindow(state: StateInterface, playload?: WindowOpenNotifyEntity) { if (playload) { - playload.client_color = window_color_list.splice( - Math.round(Math.random() * window_color_list.length), - 1 - )[0]; - + try { + playload.client_color = window_color_list.splice( + Math.round(Math.random() * window_color_list.length), + 1 + )[0]; + } catch {} state.windows.push(playload); state.windows_sort.push(playload.uuid); }