修改了小游戏中可以切换玩法的bug

This commit is contained in:
fengshuo
2022-03-30 17:41:34 +08:00
committed by chenguilong
parent 59d0e521ef
commit e3768c684a

View File

@@ -191,6 +191,25 @@
return isGamePlaying;
}
///
- (BOOL)currentRoomIsInSudGame {
BOOL isGamePlaying = NO;
if (self.delegate.getRoomInfo.type == RoomType_MiniGame) {
for (int i = -1; i<5; i++) {
NSMutableDictionary * micQueue = self.delegate.getMicroQueue;
MicroQueueModel *micSequence = [micQueue objectForKey:[NSString stringWithFormat:@"%d", i]];
if (micSequence == nil || micSequence.userInfo == nil) {
continue;
}
if (micSequence.userInfo.gameStatus == LittleGamePlayStatus_Plying) {
isGamePlaying = YES;
break;
}
}
}
return isGamePlaying;
}
#pragma mark - RoomGuestDelegate
- (void)onRoomUpdate {
@@ -762,7 +781,7 @@
}
- (void)xPRoomLittleGameListView:(XPLittleGameRoomListView *)view didSelectChooseType:(UIButton *)sender {
if ([self isInSudGame]) {
if ([self currentRoomIsInSudGame]) {
[XCHUDTool showErrorWithMessage:@"游戏中不可切换游戏或玩法!"];
} else {
sender.selected = !sender.selected;