File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
controlService/controller/concrete Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ export const settingsSchema = z.object({
152152 theme : z . string ( ) . default ( "dark-blue" ) ,
153153 telemetry : z . boolean ( ) . default ( true ) ,
154154 isStealthModeEnabled : z . boolean ( ) . default ( false ) ,
155- stealthModeScopeRadius : z . number ( ) . min ( 50 ) . max ( 500 ) . int ( ) . default ( 150 ) ,
155+ stealthModeScopeRadius : z . number ( ) . min ( 10 ) . max ( 500 ) . int ( ) . default ( 150 ) ,
156156} ) ;
157157
158158export type Settings = z . infer < typeof settingsSchema > ;
Original file line number Diff line number Diff line change @@ -235,6 +235,9 @@ export class ControllerCameraClass extends ControllerClass {
235235 * @param event - 滚轮事件
236236 */
237237 public mousewheel = ( event : WheelEvent ) => {
238+ if ( this . dealStealthMode ( event ) ) {
239+ return ;
240+ }
238241 if ( this . project . controller . isCameraLocked ) {
239242 return ;
240243 }
@@ -272,6 +275,18 @@ export class ControllerCameraClass extends ControllerClass {
272275 this . mousewheelFunction ( event ) ;
273276 } ;
274277
278+ private dealStealthMode ( event : WheelEvent ) {
279+ if ( Settings . isStealthModeEnabled && this . project . controller . pressingKeySet . has ( "shift" ) ) {
280+ console . log ( event ) ;
281+ const delta = event . deltaX > 0 ? - 10 : 10 ; // 上滚增大半径,下滚减小半径
282+ const newRadius = Math . max ( 10 , Math . min ( 500 , Settings . stealthModeScopeRadius + delta ) ) ;
283+ Settings . stealthModeScopeRadius = newRadius ;
284+ this . project . effects . addEffect ( MouseTipFeedbackEffect . default ( delta > 0 ? "expand" : "shrink" ) ) ;
285+ return true ;
286+ }
287+ return false ;
288+ }
289+
275290 /**
276291 * 在上游代码已经确认是鼠标滚轮事件,这里进行处理
277292 * @param event
You can’t perform that action at this time.
0 commit comments