2025-09-03 18:39:34 +08:00
|
|
|
|
//
|
|
|
|
|
// TurboModeStateManager.h
|
|
|
|
|
// YuMi
|
|
|
|
|
//
|
|
|
|
|
// Created by Linus on 2025/1/13.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
|
|
@interface TurboModeStateManager : NSObject
|
|
|
|
|
|
|
|
|
|
+ (instancetype)sharedManager;
|
|
|
|
|
|
|
|
|
|
// 全局 turbo mode 开关(不按房间)
|
|
|
|
|
- (void)setTurboModeEnabled:(BOOL)enabled;
|
2025-09-10 17:47:51 +08:00
|
|
|
|
- (void)setTurboModeEnabledSilently:(BOOL)enabled; // 🔧 新增:静默设置,不发送通知
|
2025-09-03 18:39:34 +08:00
|
|
|
|
- (BOOL)isTurboModeEnabled;
|
|
|
|
|
|
|
|
|
|
// 将当前全局 turbo mode 应用到指定房间的三个开关(礼物特效临时、两全局屏幕持久化)
|
|
|
|
|
- (void)applyTurboModeToSwitchesForRoom:(NSString *)roomId;
|
|
|
|
|
|
|
|
|
|
// 获取应用全局 turbo 后的房间三开关视图态
|
|
|
|
|
- (NSDictionary<NSString *, NSNumber *> *)getSwitchStatesAfterTurboModeForRoom:(NSString *)roomId;
|
|
|
|
|
|
|
|
|
|
// 重置全局 turbo mode
|
|
|
|
|
- (void)resetTurboMode;
|
|
|
|
|
|
2025-09-10 17:21:09 +08:00
|
|
|
|
// 🔧 新增:启动 TurboModeStateManager,在用户登录成功后调用
|
|
|
|
|
- (void)startupWithCurrentUser:(NSString *)userId;
|
|
|
|
|
|
|
|
|
|
// 🔧 新增:更新礼物特效开关状态(通过 RoomInfo.hasAnimationEffect 更新)
|
|
|
|
|
- (void)updateGiftEffectsForRoom:(NSString *)roomId enabled:(BOOL)enabled;
|
2025-09-23 10:47:34 +08:00
|
|
|
|
// 支持来源标记:fromUser=YES 表示用户手动开关,打上覆盖标记
|
|
|
|
|
- (void)updateGiftEffectsForRoom:(NSString *)roomId enabled:(BOOL)enabled fromUser:(BOOL)fromUser;
|
|
|
|
|
|
|
|
|
|
// 用户覆盖标记:用于阻止服务端推送覆盖用户选择
|
|
|
|
|
- (void)setGiftEffectsOverrideForRoom:(NSString *)roomId enabled:(BOOL)enabled;
|
|
|
|
|
- (BOOL)isGiftEffectsUserOverriddenForRoom:(NSString *)roomId;
|
2025-09-10 17:21:09 +08:00
|
|
|
|
|
|
|
|
|
// 🔧 新增:获取各开关状态
|
|
|
|
|
- (BOOL)isGiftEffectsEnabledForRoom:(NSString *)roomId;
|
|
|
|
|
- (BOOL)isGlobalGiftScreenEnabledForRoom:(NSString *)roomId;
|
|
|
|
|
- (BOOL)isGlobalGameScreenEnabledForRoom:(NSString *)roomId;
|
|
|
|
|
- (BOOL)isCpMicEnabledForRoom:(NSString *)roomId;
|
|
|
|
|
|
|
|
|
|
// 🔧 新增:设置各开关状态
|
|
|
|
|
- (void)setGlobalGiftScreenEnabledForRoom:(NSString *)roomId enabled:(BOOL)enabled;
|
|
|
|
|
- (void)setGlobalGameScreenEnabledForRoom:(NSString *)roomId enabled:(BOOL)enabled;
|
|
|
|
|
- (void)setCpMicEnabledForRoom:(NSString *)roomId enabled:(BOOL)enabled;
|
|
|
|
|
|
|
|
|
|
// 🔧 新增:设置当前房间ID(进房成功后调用)
|
|
|
|
|
- (void)setCurrentRoomId:(NSString *)roomId;
|
|
|
|
|
- (NSString *)loadCurrentRoomId;
|
|
|
|
|
|
2025-09-10 17:21:25 +08:00
|
|
|
|
// 🔧 新增:强制打开/关闭当前房间的所有开关(含通知与缓存更新)
|
|
|
|
|
- (void)forceCloseAllSwitches:(NSString *)roomId;
|
|
|
|
|
- (void)forceOpenAllSwitches:(NSString *)roomId;
|
|
|
|
|
|
2025-09-03 18:39:34 +08:00
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|