diff --git a/YuMi/Modules/YMRoom/View/RoomGame/View/MSRoomGameVC.h b/YuMi/Modules/YMRoom/View/RoomGame/View/MSRoomGameVC.h new file mode 100644 index 00000000..188de001 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/RoomGame/View/MSRoomGameVC.h @@ -0,0 +1,16 @@ +// +// MSRoomGameVC.h +// YuMi +// +// Created by duoban on 2024/5/27. +// + +#import "MvpViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface MSRoomGameVC : MvpViewController +- (instancetype)initWithRoomUid:(NSString *)roomUid; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/RoomGame/View/MSRoomGameVC.m b/YuMi/Modules/YMRoom/View/RoomGame/View/MSRoomGameVC.m new file mode 100644 index 00000000..65f2391b --- /dev/null +++ b/YuMi/Modules/YMRoom/View/RoomGame/View/MSRoomGameVC.m @@ -0,0 +1,129 @@ +// +// MSRoomGameVC.m +// YuMi +// +// Created by duoban on 2024/5/27. +// + +#import "MSRoomGameVC.h" +#import "MSRoomGameHeadView.h" +#import "MsRoomMessagChatHallView.h" +#import "MSRoomGameMsgView.h" +#import "MSRoomGameSendMsgView.h" +#import "XPRoomLittleGameContainerView.h" +#import "MSRoomGameVictoryView.h" +#import "MSRoomGameQuitGameView.h" +@interface MSRoomGameVC () +@property(nonatomic,strong) UIImageView *bgImageView; +@property(nonatomic,strong) MSRoomGameHeadView *headView; +@property(nonatomic,strong) MsRoomMessagChatHallView *chatView; +@property(nonatomic,strong) MSRoomGameMsgView *msgView; +@property (nonatomic,copy)NSString *roomUid; +@property(nonatomic,strong) MSRoomGameSendMsgView *sendMsgView; +///小游戏的容器 +@property (nonatomic,strong) XPRoomLittleGameContainerView *littleGameView; +@end + +@implementation MSRoomGameVC +- (instancetype)initWithRoomUid:(NSString *)roomUid { + self = [super init]; + if (self) { + self.roomUid = roomUid; + } + return self; +} +- (void)viewDidLoad { + [super viewDidLoad]; + [self installUI]; + [self installConstraints]; + + +} +-(void)installUI{ + [self.view addSubview:self.bgImageView]; + [self.view addSubview:self.littleGameView]; + [self.view addSubview:self.headView]; + [self.view addSubview:self.msgView]; + [self.view addSubview:self.sendMsgView]; +} +-(void)installConstraints{ + [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self.view); + }]; + [self.littleGameView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self.view); + }]; + [self.headView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(kStatusBarHeight); + make.leading.trailing.equalTo(self.view).inset(kGetScaleWidth(0)); + make.height.mas_equalTo(kGetScaleWidth(236)); + }]; + [self.sendMsgView mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.bottom.equalTo(self.view); + make.height.mas_equalTo(kGetScaleWidth(70)); + }]; + [self.msgView mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.equalTo(self.view); + make.height.mas_equalTo(kGetScaleWidth(101)); + make.bottom.equalTo(self.sendMsgView.mas_top).mas_offset(-kGetScaleWidth(10)); + }]; +} +- (BOOL)isHiddenNavBar { + return YES; +} +#pragma mark -MSRoomGameVictoryViewDelegate +- (void)closeGameAction{ + +} +-(void)rematchGameAction{ + +} +#pragma mark - MSRoomGameQuitGameViewDelegate +- (void)quitGameAction{ + +} +#pragma mark -MSRoomGameHeadViewDelegate +- (void)clickQuitGameAction{ +// MSRoomGameQuitGameView *quitGameView = [[MSRoomGameQuitGameView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; +// quitGameView.delegate = self; +// [TTPopup popupView:quitGameView style:TTPopupStyleAlert]; + MSRoomGameVictoryView *victoryView = [[MSRoomGameVictoryView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; + victoryView.delegate = self; + [TTPopup popupView:victoryView style:TTPopupStyleAlert]; +} +#pragma mark - 懒加载 +- (UIImageView *)bgImageView{ + if(!_bgImageView){ + _bgImageView = [UIImageView new]; + _bgImageView.image = kImage(@"ms_room_game_underwa_bg"); + _bgImageView.userInteractionEnabled = YES; + } + return _bgImageView; +} +- (MSRoomGameHeadView *)headView{ + if(!_headView){ + _headView = [[MSRoomGameHeadView alloc]initWithFrame:CGRectZero]; + _headView.delegate = self; + } + return _headView; +} +- (MSRoomGameMsgView *)msgView{ + if(!_msgView){ + _msgView = [[MSRoomGameMsgView alloc]initWithRoomUid:self.roomUid]; + } + return _msgView; +} +- (MSRoomGameSendMsgView *)sendMsgView{ + if(!_sendMsgView){ + _sendMsgView = [[MSRoomGameSendMsgView alloc]initWithFrame:CGRectZero]; + } + return _sendMsgView; +} +- (XPRoomLittleGameContainerView *)littleGameView { + if (!_littleGameView) { + _littleGameView = [[XPRoomLittleGameContainerView alloc] initWithDelegate:self]; + _littleGameView.delegate = self; + } + return _littleGameView; +} +@end