File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,15 @@ import { setReadHistory } from "@/store/userDataReducer";
88import { setStorage } from "../controller/storage/storageController" ;
99import { stageStateManager } from '@/Core/Modules/stage/stageStateManager' ;
1010
11+ let debugTextReadMode : boolean | null = null ;
12+
13+ export function setDebugTextReadMode ( isRead : boolean | null ) {
14+ debugTextReadMode = isRead ;
15+ if ( isRead !== null ) {
16+ stageStateManager . setStageAndCommit ( 'isRead' , isRead ) ;
17+ }
18+ }
19+
1120export class ReadHistoryManager {
1221 private history : Map < string , Uint8Array > = new Map ( ) ;
1322
@@ -107,7 +116,7 @@ export class ReadHistoryManager {
107116 const bitset = this . history . get ( scenarioName ) ! ;
108117 isRead = ( bitset [ index >> 3 ] & ( 1 << ( index & 7 ) ) ) !== 0 ;
109118 }
110- stageStateManager . setStage ( 'isRead' , isRead ) ;
119+ stageStateManager . setStage ( 'isRead' , debugTextReadMode ?? isRead ) ;
111120 if ( ! isRead ) {
112121 this . addReadHistory ( ) ;
113122 }
Original file line number Diff line number Diff line change 22 DebugCommand ,
33 IComponentVisibilityCommand ,
44 IDebugMessage ,
5+ ITextReadModeCommand ,
56 type IFastPreviewTimeoutPayload ,
67} from '@/types/debugProtocol' ;
78import { webgalStore } from '@/store/store' ;
@@ -16,6 +17,7 @@ import { logger } from '@/Core/util/logger';
1617import { syncWithOrigine } from './syncWithOrigine' ;
1718import { baseTransform , IEffect } from '@/Core/Modules/stage/stageInterface' ;
1819import { stageStateManager } from '@/Core/Modules/stage/stageStateManager' ;
20+ import { setDebugTextReadMode } from '@/Core/Modules/readHistory' ;
1921
2022let editorSocket : WebSocket | null = null ;
2123
@@ -158,6 +160,14 @@ export const webSocketFunc = () => {
158160 return ;
159161 }
160162 }
163+ if ( message . command === DebugCommand . SET_TEXT_READ_MODE ) {
164+ try {
165+ const command = JSON . parse ( message . message ) as ITextReadModeCommand ;
166+ setDebugTextReadMode ( command . isRead ) ;
167+ } catch ( e ) {
168+ logger . error ( `无法设置文本已读显示模式 ${ message . message } , ${ e } ` ) ;
169+ }
170+ }
161171 } ;
162172 socket . onerror = ( ) => {
163173 editorSocket = null ;
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ export enum DebugCommand {
2121 SET_EFFECT ,
2222 // 实时预览快进超时
2323 FAST_PREVIEW_TIMEOUT ,
24+ // 设置文本已读显示模式
25+ SET_TEXT_READ_MODE ,
2426}
2527
2628export interface IFastPreviewTimeoutPayload {
@@ -64,3 +66,7 @@ export interface IComponentVisibilityCommand {
6466 component : keyof IComponentsVisibility ;
6567 visibility : boolean ;
6668}
69+
70+ export interface ITextReadModeCommand {
71+ isRead : boolean ;
72+ }
You can’t perform that action at this time.
0 commit comments