移除 XPRoomViewController 中的测试按钮及相关逻辑,优化 RoomAnimationView 的动画取消和清理逻辑,新增 TurboModeStateManager 的静默设置功能,确保在不发送通知的情况下更新 Turbo 模式状态。同时,修复 XPEffectPanelViewController 中的开关状态更新逻辑,提升代码可维护性和用户体验。
This commit is contained in:
@@ -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 {
|
||||
|
@@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
// 全局 turbo mode 开关(不按房间)
|
||||
- (void)setTurboModeEnabled:(BOOL)enabled;
|
||||
- (void)setTurboModeEnabledSilently:(BOOL)enabled; // 🔧 新增:静默设置,不发送通知
|
||||
- (BOOL)isTurboModeEnabled;
|
||||
|
||||
// 将当前全局 turbo mode 应用到指定房间的三个开关(礼物特效临时、两全局屏幕持久化)
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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];
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user