航海完成了

This commit is contained in:
fengshuo
2022-08-19 17:42:14 +08:00
parent f037a280ac
commit fdd6224fa6
48 changed files with 733 additions and 106 deletions

View File

@@ -52,6 +52,7 @@
#import "XPRoomLicneseHourRankView.h"
#import "XPRoomLuckyBigPrizeView.h"
#import "XPRoomGiftCompoundView.h"
#import "XPSailingAnimationView.h"
@interface XPRoomAnimationView ()<SVGAPlayerDelegate,NIMBroadcastManagerDelegate, XPRoomGiftBroadcastViewDelegate, HWDMP4PlayDelegate, XPRoomLuckyBigPrizeViewDelegate,XPRoomLicneseHourRankViewDelegate>
///
@@ -121,6 +122,8 @@
@property (nonatomic,strong) SVGAImageView *datingEffectView;
#pragma mark - PK
@property (nonatomic, strong) NSMutableArray<AcrossRoomPKPrizeModel *> *acrossRoomPKQueue;
#pragma mark -
@property (nonatomic, strong) NSMutableArray<AttachmentModel *> *sailingQueue;
///
@property (nonatomic,assign) BOOL isLuckyGiftAnimation;
@end
@@ -272,7 +275,9 @@
[self receiveLicneseHourRank:attachment];
} else if (attachment.first == CustomMessageType_Gift_Compound && attachment.second == Custom_Message_Sub_Gift_Compound) {///
[self receiveGiftCompound:attachment];
}
} else if(attachment.first == CustomMessageType_Room_Sailing) {
[self receiveRoomSailing:attachment];
}
}
}
@@ -614,6 +619,51 @@
[candyTreeView pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"];
}
#pragma mark -
- (void)receiveRoomSailing:(AttachmentModel *)attachment {
if ([self isInSudGame]) {return;}
if (self.sailingQueue.count == 0) {
[self createSailingBannerAnimation:attachment];
}
[self.sailingQueue addObject:attachment];
}
- (void)createSailingBannerAnimation:(AttachmentModel *)attatchment {
CGFloat kscale = (CGFloat)60 / (CGFloat)375;
XPSailingAnimationView *sailingView = [[XPSailingAnimationView alloc] initWithFrame:CGRectMake(KScreenWidth, kNavigationHeight + 15, KScreenWidth, KScreenWidth * kscale)];
sailingView.prizeInfo = attatchment.data;
[self.middleLevelView addSubview:sailingView];
POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter];
springAnimation.springSpeed = 12;
springAnimation.springBounciness = 10.f;
springAnimation.fromValue = [NSValue valueWithCGPoint:sailingView.center];
springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(sailingView.frame.size.width / 2, sailingView.center.y)];
[springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) {
if (finished) {
POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter];
moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, sailingView.center.y)];
moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, sailingView.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) {
[sailingView removeFromSuperview];
[self.sailingQueue removeObjectAtIndex:0];
if (self.sailingQueue.count > 0) {
[self createSailingBannerAnimation:self.sailingQueue.firstObject];
}
}
}];
[sailingView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"];
}
}];
[sailingView pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"];
}
#pragma mark -
- (void)receiveNobleLevelUp:(AttachmentModel *)attachment {
if (self.nobleLevelUpQueue.count == 0) {
@@ -1765,5 +1815,12 @@
return _acrossRoomPKQueue;
}
- (NSMutableArray<AttachmentModel *> *)sailingQueue {
if (!_sailingQueue) {
_sailingQueue = [NSMutableArray array];
}
return _sailingQueue;
}
@end