开通贵族公屏消息,贵族升级飘屏
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#import "XPRoomGiftBroadcastView.h"
|
||||
#import "XPRoomCandyGiftView.h"
|
||||
#import "XPRoomDatingAnimationView.h"
|
||||
#import "XPRoomNobleLevelUpView.h"
|
||||
|
||||
|
||||
@interface XPRoomAnimationView ()<SVGAPlayerDelegate,NIMBroadcastManagerDelegate, XPRoomGiftBroadcastViewDelegate>
|
||||
@@ -77,6 +78,8 @@
|
||||
@property (nonatomic,strong) NSMutableSet<NetImageView *> * giftVisibleArray;
|
||||
///糖果树礼物的队列
|
||||
@property (nonatomic,strong) NSMutableArray *candyTreegiftQueue;
|
||||
///贵族升级的队列
|
||||
@property (nonatomic, strong) NSMutableArray *nobleLevelUpQueue;
|
||||
#pragma mark - 进房座驾动画的
|
||||
@property (nonatomic, strong) NSMutableArray<NSString *> *carEffectQueue;
|
||||
@property (nonatomic,strong) SVGAImageView *carEffectView;
|
||||
@@ -162,7 +165,9 @@
|
||||
[self receiveDriveCarEnterRoom:attachment];
|
||||
} else if(attachment.first == CustomMessageType_RoomPlay_Dating && attachment.second == Custom_Message_Sub_Room_Play_Dating_Public_Result) {
|
||||
[self roomDatingPublicResult:attachment];
|
||||
}
|
||||
} else if (attachment.first == CustomMessageType_Noble_VIP && attachment.second == Custom_Message_Sub_Room_Noble_LevelUp_Suspend) { ///贵族升级飘屏
|
||||
[self receiveNobleLevelUp:attachment];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,6 +375,49 @@
|
||||
[candyTreeView pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"];
|
||||
}
|
||||
|
||||
#pragma mark - 贵族升级
|
||||
- (void)receiveNobleLevelUp:(AttachmentModel *)attachment {
|
||||
if (self.nobleLevelUpQueue.count == 0) {
|
||||
[self createNobleLevelUpBannerAnimation:attachment.data];
|
||||
}
|
||||
[self.nobleLevelUpQueue addObject:attachment.data];
|
||||
}
|
||||
|
||||
- (void)createNobleLevelUpBannerAnimation:(NSDictionary *)dic {
|
||||
XPRoomNobleLevelUpView *nobleLevelUpView = [[XPRoomNobleLevelUpView alloc] initWithFrame:CGRectMake(KScreenWidth, kNavigationHeight + 15, KScreenWidth, 90)];
|
||||
nobleLevelUpView.nobleInfo = dic;
|
||||
[self.middleLevelView addSubview:nobleLevelUpView];
|
||||
POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
springAnimation.springSpeed = 12;
|
||||
springAnimation.springBounciness = 10.f;
|
||||
springAnimation.fromValue = [NSValue valueWithCGPoint:nobleLevelUpView.center];
|
||||
springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(nobleLevelUpView.frame.size.width / 2, nobleLevelUpView.center.y)];
|
||||
[springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
|
||||
if (finished) {
|
||||
POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter];
|
||||
moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, nobleLevelUpView.center.y)];
|
||||
moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, nobleLevelUpView.center.y)];
|
||||
moveAnimation.beginTime = CACurrentMediaTime() + 3;
|
||||
moveAnimation.duration = 0.5;
|
||||
moveAnimation.repeatCount = 1;
|
||||
moveAnimation.removedOnCompletion = YES;
|
||||
@kWeakify(self);
|
||||
[moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
|
||||
@kStrongify(self);
|
||||
if (finished) {
|
||||
[nobleLevelUpView removeFromSuperview];
|
||||
[self.nobleLevelUpQueue removeObjectAtIndex:0];
|
||||
if (self.nobleLevelUpQueue.count > 0) {
|
||||
[self createNobleLevelUpBannerAnimation:self.nobleLevelUpQueue.firstObject];
|
||||
}
|
||||
}
|
||||
}];
|
||||
[nobleLevelUpView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"];
|
||||
}
|
||||
}];
|
||||
[nobleLevelUpView pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"];
|
||||
}
|
||||
|
||||
#pragma mark - 收到礼物展示动画
|
||||
- (void)receiveGiftHandleSendGiftAnimation:(AttachmentModel *)attachment {
|
||||
if (!self.delegate.getRoomInfo.hasAnimationEffect) {return;}
|
||||
@@ -1051,6 +1099,13 @@
|
||||
return _candyTreegiftQueue;
|
||||
}
|
||||
|
||||
- (NSMutableArray *)nobleLevelUpQueue {
|
||||
if (!_nobleLevelUpQueue) {
|
||||
_nobleLevelUpQueue = [NSMutableArray array];
|
||||
}
|
||||
return _nobleLevelUpQueue;
|
||||
}
|
||||
|
||||
- (NSMutableArray<NSString *> *)carEffectQueue {
|
||||
if (_carEffectQueue == nil) {
|
||||
_carEffectQueue = [NSMutableArray array];
|
||||
|
Reference in New Issue
Block a user