修复了航海开出特效的不同步问题

This commit is contained in:
fengshuo
2022-08-24 18:28:13 +08:00
parent d444fe1c26
commit d683903509
3 changed files with 25 additions and 19 deletions

View File

@@ -9,6 +9,7 @@
#import "XPWeakTimer.h"
#import "XPMacro.h"
@interface XPRoomGraffitiGiftAnimationView ()
@property (nonatomic,strong) NSTimer *timer;
@property (nonatomic,assign) int index;

View File

@@ -12,11 +12,13 @@
#import "ThemeColor.h"
#import "RoomSailingPrizeModel.h"
#import "NSObject+MJExtension.h"
#import <MarqueeLabel.h>
@interface XPSailingAnimationView ()
///
@property (nonatomic,strong) UIImageView *backImageView;
///
@property (nonatomic,strong) UILabel *titleLabel;
///
@property (nonatomic,strong) MarqueeLabel *titleLabel;
@end
@implementation XPSailingAnimationView
@@ -67,7 +69,7 @@
}
[attribute appendAttributedString:[self createAttribute:nick color:UIColorFromRGB(0xFFFE95) fontSize:fontSize]];
[attribute appendAttributedString:[self createAttribute:@"在航海冒险中获得 " color:[UIColor whiteColor] fontSize:fontSize]];
[attribute appendAttributedString:[self createAttribute:info.prizeName color:[ThemeColor appEmphasizeColor] fontSize:fontSize]];
[attribute appendAttributedString:[self createAttribute:info.prizeName color:UIColorFromRGB(0xFFFE95) fontSize:fontSize]];
if (info.prizeNum > 1) {
[attribute appendAttributedString:[self createAttribute:[NSString stringWithFormat:@" X%d", info.prizeNum] color:[UIColor whiteColor] fontSize:fontSize]];
}
@@ -84,12 +86,13 @@
return _backImageView;
}
- (UILabel *)titleLabel {
- (MarqueeLabel *)titleLabel{
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel = [[MarqueeLabel alloc] init];
_titleLabel.scrollDuration = 4.0;
_titleLabel.userInteractionEnabled = YES;
}
return _titleLabel;
}
@end

View File

@@ -75,9 +75,7 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
@property (nonatomic,strong) UILabel *consumLabel;
///
@property (nonatomic,strong) UIStackView *tipsStackView;
///
@property (nonatomic,strong) UIButton *boxButton;
///
@property (nonatomic,strong) UILabel *tipLabel;
@property (nonatomic,strong) UIView * animationView;
@@ -86,8 +84,10 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
@property (nonatomic,strong) RoomSailingInfoModel *sailingInfo;
///uid
@property (nonatomic,strong) NSString *roomUid;
///
///
@property (nonatomic,strong) NSArray<NSString *> *levelArray;
///
@property (nonatomic,strong) RoomSailingPrizeListModel *prizeInfo;
@end
@implementation XPSailingViewController
@@ -292,6 +292,7 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
}
- (void)openSailingSuccess:(RoomSailingPrizeListModel *)model {
self.prizeInfo = model;
self.sailingInfo.keyNum = model.remainKeyNum;
NSString * fuleStr = [NSString stringWithFormat:@"%ld", self.sailingInfo.keyNum];
[self.fuleButton setTitle:fuleStr forState:UIControlStateNormal];
@@ -309,9 +310,6 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
if (model.specialStatus) {
[self startSailingPrizeCowrySVGA];
} else {
self.sailingImageView.hidden = NO;
[self.sailingView stopAnimation];
}
@@ -361,8 +359,11 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
#pragma mark - SVGAPlayerDelegate
- (void)svgaPlayerDidFinishedAnimation:(SVGAPlayer *)player {
if (player == self.sailingCowryView) {
[self.sailingView stopAnimation];
if (self.prizeInfo.specialStatus) {
if (player == self.sailingView) {
self.sailingImageView.hidden = NO;
}
} else {
self.sailingImageView.hidden = NO;
}
}
@@ -413,6 +414,7 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
}
- (void)exploreButtonAction:(UIButton *)sender {
self.prizeInfo = nil;
if (self.textField.text.integerValue > self.sailingInfo.keyNum) {
XPSailingBuyFuelView * buyView = [[XPSailingBuyFuelView alloc] init];
buyView.delegate = self;
@@ -430,10 +432,10 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
sender.selected = !sender.selected;
if (sender.selected) {
NSString * key = [NSString stringWithFormat:@"%@_%@", kSailingPrizeAlertKey, [AccountInfoStorage instance].getUid];
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:key];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:key];
} else {
NSString * key = [NSString stringWithFormat:@"%@_%@", kSailingPrizeAlertKey, [AccountInfoStorage instance].getUid];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:key];
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:key];
}
}
#pragma mark - NIMSystemNotificationManagerDelegate
@@ -700,7 +702,7 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
[_boxButton addTarget:self action:@selector(boxButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[_boxButton setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
NSString * key = [NSString stringWithFormat:@"%@_%@", kSailingPrizeAlertKey, [AccountInfoStorage instance].getUid];
_boxButton.selected = ![[NSUserDefaults standardUserDefaults] boolForKey:key];
_boxButton.selected = [[NSUserDefaults standardUserDefaults] boolForKey:key];
}
return _boxButton;
}
@@ -709,8 +711,8 @@ NSString * const kSailingPrizeAlertKey = @"kSailingPrizeAlertKey";
if (!_tipLabel) {
_tipLabel = [[UILabel alloc] init];
_tipLabel.font = [UIFont systemFontOfSize:10];
_tipLabel.textColor = UIColorFromRGB(0xE9C57B);
_tipLabel.text = @"显示中奖窗口";
_tipLabel.textColor = UIColorFromRGB(0xA16A2F);
_tipLabel.text = @"不展示结果弹框";
}
return _tipLabel;
}