fix: bug fix

This commit is contained in:
edwinQQQ
2025-01-09 18:05:02 +08:00
parent bc02ca29fc
commit a79bf667cc
3 changed files with 25 additions and 21 deletions

View File

@@ -1074,18 +1074,25 @@
- (XPMessageInfoModel *)createKickUserAttribute:(AttachmentModel *)attachment info:(XPKickUserModel *)info messageInfo:(XPMessageInfoModel *)messageInfo{
NSString * content= @"";
NSString * targetName = [NSString isEmpty:info.targetNick] ? @"" : info.targetNick;
NSString * handleName = [NSString isEmpty:info.handleNick] ? @"" : info.handleNick;
if (attachment.second == Custom_Message_Sub_Kick_BeKicked || attachment.second == Custom_Message_Sub_Hall_Super_Admin_Kick_Manager_Out_Room) {
content = [NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageParser93"),info.targetNick,info.handleNick];
content = [NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageParser93"),targetName,handleName];
} else if(attachment.second == Custom_Message_Sub_Kick_BlackList) {
content = [NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageParser94"),info.targetNick,info.handleNick];
content = [NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageParser94"),targetName,handleName];
} else if(attachment.second == Custom_Message_Sub_Queue_Kick) {
content = [NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageParser95"),info.targetNick,info.handleNick];
content = [NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageParser95"),targetName,handleName];
}
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:content attributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor messageDefaultTextColor],NSFontAttributeName:[UIFont systemFontOfSize:kRoomMessageDefalutFont]}];
[attribute addAttributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor messageNickColor],NSFontAttributeName:[UIFont systemFontOfSize:kRoomMessageDefalutFont]} range:[content rangeOfString:info.targetNick]];
[attribute addAttributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor messageNickColor],NSFontAttributeName:[UIFont systemFontOfSize:kRoomMessageDefalutFont]} range:[content rangeOfString:info.handleNick]];
[self attributeAddHihtLight:attribute range:[content rangeOfString:info.targetNick] uid:info.targetUid];
[self attributeAddHihtLight:attribute range:[content rangeOfString:info.handleNick] uid:info.handleUid];
if (![NSString isEmpty:targetName]) {
[attribute addAttributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor messageNickColor],NSFontAttributeName:[UIFont systemFontOfSize:kRoomMessageDefalutFont]} range:[content rangeOfString:targetName]];
[self attributeAddHihtLight:attribute range:[content rangeOfString:targetName] uid:info.targetUid];
}
if (![NSString isEmpty:handleName]) {
[attribute addAttributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor messageNickColor],NSFontAttributeName:[UIFont systemFontOfSize:kRoomMessageDefalutFont]} range:[content rangeOfString:handleName]];
[self attributeAddHihtLight:attribute range:[content rangeOfString:handleName] uid:info.handleUid];
}
messageInfo.content = attribute;
return messageInfo;
}

View File

@@ -248,30 +248,27 @@
- (void)setRoomInfo:(RoomInfoModel *)roomInfo {
_roomInfo = roomInfo;
self.avatarImage.imageUrl = roomInfo.avatar;
self.nameLabel.text = roomInfo.nick;
self.nameLabel.text = roomInfo.title;
}
- (void)setLevelInfo:(RoomLevelInfoModel *)LevelInfo {
_LevelInfo = LevelInfo;
self.levelImage.imageUrl = LevelInfo.currentLevelIcon;
self.expProgressView.progress = (LevelInfo.roomVal - LevelInfo.currentLevelExp) * 100.0 / (LevelInfo.nextLevelExp - LevelInfo.currentLevel) / 100.0;
self.valueLabel.text = [NSString stringWithFormat:@"%@%@", YMLocalizedString(@"1.0.33_text_6"), @(LevelInfo.roomVal)];
self.nextLevelLabel.text = [NSString stringWithFormat:@"%@%@", YMLocalizedString(@"1.0.33_text_9"), @(LevelInfo.nextLevel)];
self.currentLevelLabel.text = [NSString stringWithFormat:@"%@%@", YMLocalizedString(@"1.0.33_text_9"), @(LevelInfo.currentLevel)];
self.expToNextLabel.text = [NSString stringWithFormat:@"%@%@", YMLocalizedString(@"1.0.33_text_8"), @(LevelInfo.nextLevelExp - LevelInfo.roomVal)];
self.adminLabel.text = [NSString stringWithFormat:YMLocalizedString(@"1.0.33_text_7"), @(LevelInfo.currentManagerNum), @(LevelInfo.managerLimitNum)];
if (LevelInfo.nextLevel == 0) {
self.nextLevelLabel.text = [NSString stringWithFormat:@"%@%@", YMLocalizedString(@"1.0.33_text_9"), @(LevelInfo.currentLevel)];
self.currentLevelLabel.text = [NSString stringWithFormat:@"%@%@", YMLocalizedString(@"1.0.33_text_9"), @(LevelInfo.currentLevel - 1)];
self.expProgressView.progress = 1;
self.expToNextLabel.hidden = YES;
} else {
self.expToNextLabel.hidden = NO;
self.nextLevelLabel.text = [NSString stringWithFormat:@"%@%@", YMLocalizedString(@"1.0.33_text_9"), @(LevelInfo.nextLevel)];
self.currentLevelLabel.text = [NSString stringWithFormat:@"%@%@", YMLocalizedString(@"1.0.33_text_9"), @(LevelInfo.currentLevel)];
}
#if DEBUG
self.expProgressView.progress = 0.3;
#endif
self.valueLabel.text = [NSString stringWithFormat:@"%@%@", YMLocalizedString(@"1.0.33_text_6"), @(LevelInfo.roomVal)];
self.adminLabel.text = [NSString stringWithFormat:YMLocalizedString(@"1.0.33_text_7"), @(LevelInfo.currentManagerNum), @(LevelInfo.managerLimitNum)];
self.expToNextLabel.text = [NSString stringWithFormat:@"%@%@", YMLocalizedString(@"1.0.33_text_8"), @(LevelInfo.nextLevelExp - LevelInfo.roomVal)];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {

View File

@@ -1349,13 +1349,13 @@
} else {
// self.operaStackView.hidden = YES;
self.upMicFlag = YES;
int micCount = 9;
NSInteger micCount = 9;
switch (self.cardInfo.roomInfo.type) {
case RoomType_Anchor:
micCount = 4;
break;
case RoomType_MiniGame:
micCount = 6;
micCount = self.cardInfo.roomInfo.mgMicNum;
break;
case RoomType_Game:
micCount = 9;