From 5646168553ce2f96001537afcf4e64dd79c19611 Mon Sep 17 00:00:00 2001 From: edwinQQQ Date: Wed, 10 Sep 2025 17:47:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20XPRoomViewController=20?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=B5=8B=E8=AF=95=E6=8C=89=E9=92=AE=E5=8F=8A?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20RoomAnimationView=20=E7=9A=84=E5=8A=A8=E7=94=BB=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=92=8C=E6=B8=85=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20TurboModeStateManager=20=E7=9A=84=E9=9D=99?= =?UTF-8?q?=E9=BB=98=E8=AE=BE=E7=BD=AE=E5=8A=9F=E8=83=BD=EF=BC=8C=E7=A1=AE?= =?UTF-8?q?=E4=BF=9D=E5=9C=A8=E4=B8=8D=E5=8F=91=E9=80=81=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=E6=9B=B4=E6=96=B0=20Turbo?= =?UTF-8?q?=20=E6=A8=A1=E5=BC=8F=E7=8A=B6=E6=80=81=E3=80=82=E5=90=8C?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E4=BF=AE=E5=A4=8D=20XPEffectPanelViewControl?= =?UTF-8?q?ler=20=E4=B8=AD=E7=9A=84=E5=BC=80=E5=85=B3=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=BB=E8=BE=91=EF=BC=8C=E6=8F=90=E5=8D=87?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=8F=AF=E7=BB=B4=E6=8A=A4=E6=80=A7=E5=92=8C?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BD=93=E9=AA=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/AnimationView/RoomAnimationView.m | 15 ++++++- .../MoreView/Manager/TurboModeStateManager.h | 1 + .../MoreView/Manager/TurboModeStateManager.m | 9 ++++ .../View/XPEffectPanelViewController.m | 12 +++--- .../View/StageView/MicMidpointRectManager.m | 10 ----- .../Modules/YMRoom/View/StageView/StageView.m | 5 +++ .../YMRoom/View/XPRoomViewController.m | 43 ------------------- 7 files changed, 35 insertions(+), 60 deletions(-) diff --git a/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m b/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m index f3f8604d..fdd1c9f9 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m @@ -232,7 +232,17 @@ BannerSchedulerDelegate return; } - [self cancelAllAnimations]; + // 执行实际的取消动画逻辑 + [self pop_removeAllAnimations]; + + // 取消所有容器的子视图动画 + NSArray *containers = @[self.bannerContainer, self.topContainer, self.middleContainer, self.bottomContainer]; + for (UIView *container in containers) { + if (!container) continue; + for (UIView *subview in container.subviews) { + [subview pop_removeAllAnimations]; + } + } } @@ -251,7 +261,8 @@ BannerSchedulerDelegate return; } - [self cleanupAllSubviews]; + // 执行实际的清理逻辑 + [self forceCleanupAllSubviews]; } - (void)forceCleanupAllSubviews { diff --git a/YuMi/Modules/YMRoom/View/MoreView/Manager/TurboModeStateManager.h b/YuMi/Modules/YMRoom/View/MoreView/Manager/TurboModeStateManager.h index dc362927..46327a18 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Manager/TurboModeStateManager.h +++ b/YuMi/Modules/YMRoom/View/MoreView/Manager/TurboModeStateManager.h @@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN // 全局 turbo mode 开关(不按房间) - (void)setTurboModeEnabled:(BOOL)enabled; +- (void)setTurboModeEnabledSilently:(BOOL)enabled; // 🔧 新增:静默设置,不发送通知 - (BOOL)isTurboModeEnabled; // 将当前全局 turbo mode 应用到指定房间的三个开关(礼物特效临时、两全局屏幕持久化) diff --git a/YuMi/Modules/YMRoom/View/MoreView/Manager/TurboModeStateManager.m b/YuMi/Modules/YMRoom/View/MoreView/Manager/TurboModeStateManager.m index ee75ea4e..632958ee 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Manager/TurboModeStateManager.m +++ b/YuMi/Modules/YMRoom/View/MoreView/Manager/TurboModeStateManager.m @@ -195,6 +195,15 @@ userInfo:@{@"enabled": @(enabled)}]; } +// 🔧 新增:静默设置 turbo mode 状态,不发送通知 +- (void)setTurboModeEnabledSilently:(BOOL)enabled { + self.globalTurboEnabled = enabled; + [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"TurboMode_Global"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + + NSLog(@"🎮 TurboModeStateManager: 全局 turbo mode 静默设置为 %@", enabled ? @"开启" : @"关闭"); +} + - (BOOL)isTurboModeEnabled { return self.globalTurboEnabled; } diff --git a/YuMi/Modules/YMRoom/View/MoreView/View/XPEffectPanelViewController.m b/YuMi/Modules/YMRoom/View/MoreView/View/XPEffectPanelViewController.m index a1ae3bfe..8d077f81 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/View/XPEffectPanelViewController.m +++ b/YuMi/Modules/YMRoom/View/MoreView/View/XPEffectPanelViewController.m @@ -205,12 +205,14 @@ BOOL currentTurboMode = [[TurboModeStateManager sharedManager] isTurboModeEnabled]; if (currentTurboMode && isOn) { - // turbo mode 开启时,用户点击开启开关,自动关闭 turbo mode - [[TurboModeStateManager sharedManager] setTurboModeEnabled:NO]; + // turbo mode 开启时,用户点击开启开关,静默关闭 turbo mode(不发送通知) + [[TurboModeStateManager sharedManager] setTurboModeEnabledSilently:NO]; - // 🔧 修改:直接使用 TurboModeStateManager 更新开关状态 + // 🔧 修复:只更新被操作的开关状态,不触发所有开关打开 TurboModeStateManager *manager = [TurboModeStateManager sharedManager]; - if (sender.tag == 1) { // 全局礼物屏幕 + if (sender.tag == 0) { // 礼物特效开关 + [manager updateGiftEffectsForRoom:self.roomId enabled:YES]; + } else if (sender.tag == 1) { // 全局礼物屏幕 [manager setGlobalGiftScreenEnabledForRoom:self.roomId enabled:YES]; } else if (sender.tag == 2) { // 全局游戏屏幕 [manager setGlobalGameScreenEnabledForRoom:self.roomId enabled:YES]; @@ -218,7 +220,7 @@ [manager setCpMicEnabledForRoom:self.roomId enabled:YES]; } - NSLog(@"🎮 Turbo Mode 已自动关闭,开关 %ld 已开启", (long)sender.tag); + NSLog(@"🎮 Turbo Mode 已静默关闭,开关 %ld 已开启", (long)sender.tag); return; } diff --git a/YuMi/Modules/YMRoom/View/StageView/MicMidpointRectManager.m b/YuMi/Modules/YMRoom/View/StageView/MicMidpointRectManager.m index 373d2589..358df355 100644 --- a/YuMi/Modules/YMRoom/View/StageView/MicMidpointRectManager.m +++ b/YuMi/Modules/YMRoom/View/StageView/MicMidpointRectManager.m @@ -62,16 +62,6 @@ rectView.userInteractionEnabled = NO; rectView.tag = 56002; -#if DEBUG - // 仅在DEBUG显示麦位对文本,50%透明 - UILabel *label = [[UILabel alloc] init]; - label.text = micPairText; - label.textColor = [[UIColor whiteColor] colorWithAlphaComponent:0.5]; - label.font = [UIFont boldSystemFontOfSize:12]; - label.textAlignment = NSTextAlignmentCenter; - label.frame = rectView.bounds; - [rectView addSubview:label]; -#endif // 添加到容器视图 [self.containerView addSubview:rectView]; diff --git a/YuMi/Modules/YMRoom/View/StageView/StageView.m b/YuMi/Modules/YMRoom/View/StageView/StageView.m index b00fd0c4..df225b5f 100644 --- a/YuMi/Modules/YMRoom/View/StageView/StageView.m +++ b/YuMi/Modules/YMRoom/View/StageView/StageView.m @@ -905,6 +905,11 @@ @kStrongify(self); if (error || members.count == 0) { +#if DEBUG + [XNDJTDDLoadingTool showErrorWithMessage:error.localizedDescription]; +#else + [XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"HttpRequestHelper4")]; +#endif self.isUpingMic = NO; return; } diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m index fc2403e9..e7bce202 100644 --- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m +++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m @@ -671,10 +671,6 @@ XPCandyTreeInsufficientBalanceViewDelegate> [self.view addSubview:self.functionView]; [self.view addSubview:self.animationView]; - // 🔧 新增:添加测试按钮,用于测试 Turbo Mode Tips 弹窗 -#if DEBUG - [self addTestButton]; -#endif } - (void)__layoutTwentyMicStage { @@ -3628,45 +3624,6 @@ XPCandyTreeInsufficientBalanceViewDelegate> NSLog(@" - stageView.class: %@", NSStringFromClass([self.stageView class])); } -#pragma mark - 测试按钮相关 - -- (void)addTestButton { - // 创建简单的测试按钮 - UIButton *testButton = [UIButton buttonWithType:UIButtonTypeSystem]; - [testButton setTitle:@"🧪 Test Tips" forState:UIControlStateNormal]; - [testButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - testButton.backgroundColor = [UIColor colorWithRed:0.2 green:0.6 blue:0.8 alpha:0.9]; - testButton.layer.cornerRadius = 15.0; - testButton.layer.borderWidth = 1.0; - testButton.layer.borderColor = [UIColor whiteColor].CGColor; - - // 添加点击事件 - [testButton addTarget:self action:@selector(testButtonTapped) forControlEvents:UIControlEventTouchUpInside]; - - // 添加到视图 - [self.view addSubview:testButton]; - - // 设置约束 - 放在右上角,不遮挡其他重要内容 - [testButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.view).offset(100); // 在房间头部下方 - make.trailing.equalTo(self.view).offset(-20); - make.width.equalTo(@120); - make.height.equalTo(@35); - }]; - - NSLog(@"🎮 测试按钮已添加到房间界面 - 位置:右上角,距离顶部100,距离右边20"); -} - -- (void)testButtonTapped { - NSLog(@"🎮 测试按钮被点击,准备模拟卡顿检测"); - NSLog(@"🎮 当前时间:%@", [NSDate date]); - NSLog(@"🎮 房间状态:%@", self.roomInfo ? @"已进入" : @"未进入"); - - // 调用 BuglyManager 模拟卡顿检测,增加计数 - [[BuglyManager sharedManager] simulateLagDetection]; - - NSLog(@"🎮 卡顿检测模拟已触发,计数将增加"); -} /// 在 StageView 上绘制符合条件的相邻麦位中点矩形 - (void)drawSocialStageMidpointRects {