@@ -43,10 +43,18 @@ function isYuiGuideLive2DPreparing() {
4343 ) ;
4444}
4545
46+ function isYuiGuideFloatingToolbarSuppressed ( ) {
47+ return ! ! (
48+ window . isNekoYuiGuideFloatingToolbarSuppressed
49+ && window . isNekoYuiGuideFloatingToolbarSuppressed ( )
50+ ) ;
51+ }
52+
4653function hideYuiGuideLive2DPreparingButtonStyles ( buttonsContainer ) {
4754 if ( ! buttonsContainer || ! buttonsContainer . style || typeof buttonsContainer . style . removeProperty !== 'function' ) {
4855 return ;
4956 }
57+ buttonsContainer . dataset . yuiGuideForcedHidden = 'true' ;
5058 buttonsContainer . style . setProperty ( 'display' , 'none' , 'important' ) ;
5159 buttonsContainer . style . setProperty ( 'visibility' , 'hidden' , 'important' ) ;
5260 buttonsContainer . style . setProperty ( 'opacity' , '0' , 'important' ) ;
@@ -57,10 +65,15 @@ function restoreYuiGuideLive2DPreparingButtonStyles(buttonsContainer) {
5765 if ( ! buttonsContainer || ! buttonsContainer . style || typeof buttonsContainer . style . removeProperty !== 'function' ) {
5866 return ;
5967 }
60- buttonsContainer . style . removeProperty ( 'display' ) ;
61- buttonsContainer . style . removeProperty ( 'visibility' ) ;
62- buttonsContainer . style . removeProperty ( 'opacity' ) ;
63- buttonsContainer . style . removeProperty ( 'pointer-events' ) ;
68+ const forcedHidden = buttonsContainer . dataset . yuiGuideForcedHidden === 'true' ;
69+ if ( ! forcedHidden ) {
70+ return ;
71+ }
72+ const forcedProperties = [ 'display' , 'visibility' , 'opacity' , 'pointer-events' ] ;
73+ forcedProperties . forEach ( ( property ) => {
74+ buttonsContainer . style . removeProperty ( property ) ;
75+ } ) ;
76+ delete buttonsContainer . dataset . yuiGuideForcedHidden ;
6477}
6578
6679/**
@@ -180,6 +193,17 @@ Live2DManager.prototype.setupHTMLLockIcon = function(model) {
180193 if ( shouldSkipLive2DUiTick ( this , '_x11LockIconLastTickAt' , LIVE2D_X11_UI_TICK_MS ) ) {
181194 return ;
182195 }
196+ if ( isYuiGuideFloatingToolbarSuppressed ( ) ) {
197+ lockIcon . dataset . yuiGuideForcedHidden = 'true' ;
198+ lockIcon . style . visibility = 'hidden' ;
199+ lockIcon . style . opacity = '0' ;
200+ return ;
201+ }
202+ if ( lockIcon . dataset . yuiGuideForcedHidden === 'true' ) {
203+ delete lockIcon . dataset . yuiGuideForcedHidden ;
204+ lockIcon . style . visibility = '' ;
205+ lockIcon . style . opacity = '' ;
206+ }
183207 if ( ! model || ! model . parent ) {
184208 // 教程期间不隐藏锁图标,防止高亮框位置被刷到 (0,0)
185209 if ( lockIcon && ! window . isInTutorial ) lockIcon . style . display = 'none' ;
@@ -596,6 +620,10 @@ Live2DManager.prototype.setupFloatingButtons = function(model) {
596620 if ( shouldSkipLive2DUiTick ( this , '_x11FloatingButtonsLastTickAt' , LIVE2D_X11_UI_TICK_MS ) ) {
597621 return ;
598622 }
623+ if ( isYuiGuideFloatingToolbarSuppressed ( ) ) {
624+ hideYuiGuideLive2DPreparingButtonStyles ( buttonsContainer ) ;
625+ return ;
626+ }
599627 if ( ! model || ! model . parent ) {
600628 return ;
601629 }
@@ -650,7 +678,7 @@ Live2DManager.prototype.setupFloatingButtons = function(model) {
650678 if ( this . isLocked ) {
651679 return ;
652680 }
653- if ( isYuiGuideLive2DPreparing ( ) ) {
681+ if ( isYuiGuideLive2DPreparing ( ) || isYuiGuideFloatingToolbarSuppressed ( ) ) {
654682 hideYuiGuideLive2DPreparingButtonStyles ( buttonsContainer ) ;
655683 return ;
656684 }
@@ -662,7 +690,7 @@ Live2DManager.prototype.setupFloatingButtons = function(model) {
662690 if ( ! this . isFocusing && ! inTutorial ) {
663691 buttonsContainer . style . display = 'none' ;
664692 } else if ( inTutorial ) {
665- if ( isYuiGuideLive2DPreparing ( ) ) {
693+ if ( isYuiGuideLive2DPreparing ( ) || isYuiGuideFloatingToolbarSuppressed ( ) ) {
666694 hideYuiGuideLive2DPreparingButtonStyles ( buttonsContainer ) ;
667695 } else {
668696 restoreYuiGuideLive2DPreparingButtonStyles ( buttonsContainer ) ;
@@ -679,10 +707,11 @@ Live2DManager.prototype.setupFloatingButtons = function(model) {
679707
680708 this . tutorialProtectionTimer = setInterval ( ( ) => {
681709 if ( window . isInTutorial === true ) {
682- if ( isYuiGuideLive2DPreparing ( ) ) {
710+ if ( isYuiGuideLive2DPreparing ( ) || isYuiGuideFloatingToolbarSuppressed ( ) ) {
683711 hideYuiGuideLive2DPreparingButtonStyles ( buttonsContainer ) ;
684712 return ;
685713 }
714+ restoreYuiGuideLive2DPreparingButtonStyles ( buttonsContainer ) ;
686715 const style = window . getComputedStyle ( buttonsContainer ) ;
687716 if ( style . display === 'none' ) {
688717 buttonsContainer . style . setProperty ( 'display' , 'flex' , 'important' ) ;
0 commit comments