修改小游戏坑位缩小的逻辑
This commit is contained in:
@@ -44,7 +44,8 @@
|
||||
#import "XPSendGiftView.h"
|
||||
#import "XPUserCardViewController.h"
|
||||
#import "XPRoomViewController.h"
|
||||
@interface XPRoomFunctionContainerView ()<XPAcrpssRoomPKPanelViewDelegate>
|
||||
#import "XPLittleGameMiniStageView.h"
|
||||
@interface XPRoomFunctionContainerView ()<XPAcrpssRoomPKPanelViewDelegate, XPLittleGameMiniStageViewDelegate>
|
||||
///host 代理
|
||||
@property (nonatomic,weak) id<RoomHostDelegate>delegate;
|
||||
///房间榜
|
||||
@@ -63,6 +64,8 @@
|
||||
@property (nonatomic,strong) UIButton *editButton;
|
||||
///跨房pk的面板
|
||||
@property (nonatomic,strong) XPAcrpssRoomPKPanelView *acrossPKPanelView;
|
||||
///小游戏 最小化的坑位
|
||||
@property (nonatomic,strong) XPLittleGameMiniStageView *littleGameMiniView;
|
||||
@end
|
||||
|
||||
@implementation XPRoomFunctionContainerView
|
||||
@@ -95,7 +98,7 @@
|
||||
- (void)initSubViewConstraints {
|
||||
[self.contributionButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(-12);
|
||||
make.top.mas_equalTo(statusbarHeight+57);
|
||||
make.top.mas_equalTo(kNavigationHeight+4);
|
||||
make.width.mas_equalTo(90);
|
||||
make.height.mas_equalTo(26);
|
||||
}];
|
||||
@@ -147,6 +150,7 @@
|
||||
[self.datingProgresButton removeFromSuperview];
|
||||
}
|
||||
}
|
||||
|
||||
if (roomInfo.type == RoomType_Anchor) {
|
||||
[self.contributionButton setTitle:@"主播榜" forState:UIControlStateNormal];
|
||||
self.anchorGiftValueView.hidden = !roomInfo.showGiftValue;
|
||||
@@ -164,6 +168,7 @@
|
||||
}];
|
||||
}
|
||||
[self updateRoomTopic];
|
||||
[self showLittleGameMiniView:roomInfo.type];
|
||||
}
|
||||
|
||||
- (void)onRoomEntered {
|
||||
@@ -201,7 +206,25 @@
|
||||
} roomUid:roomUid];
|
||||
}
|
||||
|
||||
if (roomInfo.type == RoomType_Anchor) {
|
||||
[self.contributionButton setTitle:@"主播榜" forState:UIControlStateNormal];
|
||||
self.anchorGiftValueView.hidden = !roomInfo.showGiftValue;
|
||||
if (!roomInfo.showGiftValue) {
|
||||
self.anchorGiftValueView.giftValue = 0;
|
||||
}
|
||||
[self.contributionButton mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(statusbarHeight+49);
|
||||
}];
|
||||
} else {
|
||||
[self.contributionButton setTitle:@"房间榜" forState:UIControlStateNormal];
|
||||
self.anchorGiftValueView.hidden = YES;
|
||||
[self.contributionButton mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(statusbarHeight+57);
|
||||
}];
|
||||
}
|
||||
|
||||
[self updateRoomTopic];
|
||||
[self showLittleGameMiniView:roomInfo.type];
|
||||
}
|
||||
|
||||
- (void)onMicroGiftValueUpdate:(NSDictionary *)data {
|
||||
@@ -360,6 +383,35 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)onMicroQueueUpdate:(NSMutableDictionary<NSString *,MicroQueueModel *> *)queue {
|
||||
if (self.delegate.getRoomInfo.type == RoomType_MiniGame) {
|
||||
[self.littleGameMiniView needRefreshPosition:queue];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - 小游戏的方法
|
||||
- (void)showLittleGameMiniView:(RoomType)type {
|
||||
if (type == RoomType_MiniGame) {
|
||||
if (!self.littleGameMiniView.superview) {
|
||||
[self addSubview:self.littleGameMiniView];
|
||||
[self.littleGameMiniView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(0);
|
||||
make.top.mas_equalTo(kNavigationHeight + 4);
|
||||
make.height.mas_equalTo(23);
|
||||
}];
|
||||
}
|
||||
|
||||
} else {
|
||||
if (self.littleGameMiniView.superview) {
|
||||
[self.littleGameMiniView removeFromSuperview];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)XPLittleGameMiniStageView:(XPLittleGameMiniStageView *)view didClickFoldButton:(UIButton *)sender {
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - XPAcrpssRoomPKPanelViewDelegate
|
||||
- (void)xPAcrpssRoomPKPanelView:(XPAcrpssRoomPKPanelView *)view onlookRoom:(NSString *)roomUid {
|
||||
[self.delegate exitRoom];
|
||||
@@ -458,7 +510,12 @@
|
||||
} roomUserId:roomUid roundId:roundId];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)foldButtonAction:(UIButton *)sender {
|
||||
sender.selected = !sender.selected;
|
||||
}
|
||||
|
||||
- (void)tapGiftValueRecognizer {
|
||||
if (self.anchorGiftValueView.hidden) return;
|
||||
@@ -696,4 +753,13 @@
|
||||
return _acrossPKPanelView;
|
||||
}
|
||||
|
||||
- (XPLittleGameMiniStageView *)littleGameMiniView {
|
||||
if (!_littleGameMiniView) {
|
||||
_littleGameMiniView = [[XPLittleGameMiniStageView alloc] init];
|
||||
_littleGameMiniView.delegate = self;
|
||||
}
|
||||
return _littleGameMiniView;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
Reference in New Issue
Block a user