feat: 完成礼物连击功能
This commit is contained in:
@@ -65,9 +65,11 @@
|
||||
#import "PIRoomGiftBroadcastWindow.h"
|
||||
#import "PIUniversalBannerModel.h"
|
||||
#import "PIUniversalBannerView.h"
|
||||
#import "GiftComboFlagView.h"
|
||||
|
||||
#import "GiftComboManager.h"
|
||||
#import "LuckyGiftWinningFlagView.h"
|
||||
|
||||
#import "LuckyGiftWinningBannerView.h"
|
||||
|
||||
@interface XPRoomAnimationView ()<SVGAPlayerDelegate,NIMBroadcastManagerDelegate, XPRoomGiftBroadcastViewDelegate, HWDMP4PlayDelegate, XPRoomLuckyBigPrizeViewDelegate, XPRoomGraffitiGiftAnimationViewDelegate, XPRoomStarKitchenBannerViewDelegate,PAGViewListener,XPRoomAnchorRankBannerViewDelegate,PIRoomGiftBroadcastWindowDelegate,PIUniversalBannerViewDelegate>
|
||||
///展示的不同层级
|
||||
@@ -156,6 +158,9 @@
|
||||
|
||||
@property (nonatomic, copy) NSString *GiftDynamicEffectListPath;
|
||||
|
||||
@property (nonatomic, strong) NSMutableArray *roomLuckWinningBannerModels;
|
||||
@property (nonatomic, assign) BOOL isDisplayLuckWinningBanner;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPRoomAnimationView
|
||||
@@ -185,6 +190,7 @@
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
|
||||
_roomLuckWinningBannerModels = [NSMutableArray array];
|
||||
_GiftDynamicEffectListPath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) xpSafeObjectAtIndex:0] stringByAppendingPathComponent:@"GiftDynamicEffectList"];
|
||||
|
||||
}
|
||||
@@ -355,6 +361,12 @@
|
||||
[self receiveCommonH5Banner:attachment];
|
||||
}else if (attachment.first == CustomMessageType_General_Floating_Screen && attachment.second == Custom_Message_Sub_General_Floating_Screen_One_Room){
|
||||
[self receiveRoomGeneralFloatingScreen:attachment];
|
||||
} else if (attachment.first == CustomMessageType_Super_Gift &&
|
||||
attachment.second == Custom_Message_Sub_Super_Gift_Winning_Coins) {
|
||||
[self receiveLuckGiftWinning:attachment];
|
||||
} else if (attachment.first == CustomMessageType_Super_Gift &&
|
||||
attachment.second == Custom_Message_Sub_Super_Gift_Winning_Coins_ALL_Room) {
|
||||
[self receiveLuckGiftBanner:attachment];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -376,23 +388,69 @@
|
||||
[self userEnterRoom:content ext:extModel];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - 收到送礼者中奖飘屏
|
||||
- (void)receiveLuckGiftWinning:(AttachmentModel *)attachment {
|
||||
|
||||
RoomInfoModel *roomInfo = self.delegate.getRoomInfo;
|
||||
|
||||
[LuckyGiftWinningFlagView display:self
|
||||
with:attachment
|
||||
roomID:roomInfo.roomId
|
||||
uID:[AccountInfoStorage instance].getUid];
|
||||
}
|
||||
|
||||
- (void)receiveLuckGiftBanner:(AttachmentModel *)attachment {
|
||||
[self.roomLuckWinningBannerModels addObject:attachment];
|
||||
if (!self.isDisplayLuckWinningBanner) {
|
||||
[self processNextLuckWinningAttachment];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)processNextLuckWinningAttachment {
|
||||
// 检查队列是否有元素
|
||||
if (self.roomLuckWinningBannerModels.count == 0) {
|
||||
// 如果队列为空,停止处理
|
||||
self.isDisplayLuckWinningBanner = NO;
|
||||
return;
|
||||
}
|
||||
|
||||
// 从队列中取出第一个元素并移出队列
|
||||
AttachmentModel *nextAttachment = [self.roomLuckWinningBannerModels firstObject];
|
||||
[self.roomLuckWinningBannerModels removeObjectAtIndex:0];
|
||||
|
||||
// 设置为正在显示的状态
|
||||
self.isDisplayLuckWinningBanner = YES;
|
||||
RoomInfoModel *roomInfo = self.delegate.getRoomInfo;
|
||||
// 执行 display 方法
|
||||
@kWeakify(self);
|
||||
[LuckyGiftWinningBannerView display:self inRoomUid:roomInfo.uid with:nextAttachment complete:^{
|
||||
@kStrongify(self);
|
||||
// Display 完成后,继续处理下一个
|
||||
[self processNextLuckWinningAttachment];
|
||||
} exitCurrentRoom:^{
|
||||
@kStrongify(self);
|
||||
[self.delegate exitRoom];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - 收到通用飘屏
|
||||
-(void)receiveRoomGeneralFloatingScreen:(AttachmentModel *)attacment{
|
||||
-(void)receiveRoomGeneralFloatingScreen:(AttachmentModel *)attachment{
|
||||
PIBaseAnimationViewModel *roomGraffiti = [PIBaseAnimationViewModel new];
|
||||
roomGraffiti.data = attacment.data;
|
||||
roomGraffiti.data = attachment.data;
|
||||
roomGraffiti.type = GiftBannerType_General_Floating_Screen;
|
||||
roomGraffiti.first = attacment.first;
|
||||
roomGraffiti.second = attacment.second;
|
||||
roomGraffiti.first = attachment.first;
|
||||
roomGraffiti.second = attachment.second;
|
||||
if(self.animationListB.count == 0 && self.isPlayOfB == NO){
|
||||
[self createGeneralFloatingScreenAnimation:roomGraffiti];
|
||||
}
|
||||
[self.animationListB addObject:roomGraffiti];
|
||||
}
|
||||
- (void)createGeneralFloatingScreenAnimation:(PIBaseAnimationViewModel *)attacment{
|
||||
- (void)createGeneralFloatingScreenAnimation:(PIBaseAnimationViewModel *)attachment{
|
||||
self.isPlayOfB = YES;
|
||||
CGFloat top = self.isPlayOfA == YES ? (self.broadCastHieght + statusbarHeight) : (kNavigationHeight + 15);
|
||||
|
||||
PIUniversalBannerModel *model = [PIUniversalBannerModel modelWithDictionary:attacment.data];
|
||||
PIUniversalBannerModel *model = [PIUniversalBannerModel modelWithDictionary:attachment.data];
|
||||
BOOL isSvga = [model.resourceType.uppercaseString isEqualToString:@"SVGA"];
|
||||
__block PIUniversalBannerView *bannerView;
|
||||
@kWeakify(self);
|
||||
@@ -1532,7 +1590,11 @@
|
||||
if ([[GiftComboManager sharedManager] isGiftCombing] &&
|
||||
[uid isEqualToString:[AccountInfoStorage instance].getUid] &&
|
||||
isEnd == false) {
|
||||
point = CGPointMake([UIScreen mainScreen].bounds.size.width - 60, [UIScreen mainScreen].bounds.size.height - kSafeAreaTopHeight - 60);
|
||||
if (isMSRTL()) {
|
||||
point = CGPointMake(kGetScaleWidth(80), [UIScreen mainScreen].bounds.size.height - kSafeAreaTopHeight - kGetScaleWidth(110));
|
||||
} else {
|
||||
point = CGPointMake(kGetScaleWidth([UIScreen mainScreen].bounds.size.width - kGetScaleWidth(110)), [UIScreen mainScreen].bounds.size.height - kSafeAreaTopHeight - kGetScaleWidth(110));
|
||||
}
|
||||
}
|
||||
|
||||
return point;
|
||||
|
Reference in New Issue
Block a user