diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index 836b5ed6..7dc672f2 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -520,6 +520,7 @@ 545888362C1C306B00897585 /* XPRoomPKPaneAvatarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 545888352C1C306B00897585 /* XPRoomPKPaneAvatarView.m */; }; 5468995D2C8AFE4C0049136A /* GiftComboFlagView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5468995C2C8AFE4C0049136A /* GiftComboFlagView.m */; }; 547853A12C258F2A00F45E60 /* XPMineUserViewHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 547853A02C258F2A00F45E60 /* XPMineUserViewHeader.m */; }; + 547B30F92CB511700041E962 /* RoomBoomEntryView.m in Sources */ = {isa = PBXBuildFile; fileRef = 547B30F82CB511700041E962 /* RoomBoomEntryView.m */; }; 5484E1FD2CA2897B008E8754 /* IAPManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5484E1FC2CA2897B008E8754 /* IAPManager.m */; }; 548E01C52C3F78360071C83D /* FeedBackViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 548E01C22C3F78360071C83D /* FeedBackViewController.xib */; }; 548E01C62C3F78360071C83D /* FeedBackViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 548E01C42C3F78360071C83D /* FeedBackViewController.m */; }; @@ -551,7 +552,7 @@ 54E4D5332C90658C009E1FEA /* LuckyGiftWinningBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E4D5322C90658C009E1FEA /* LuckyGiftWinningBannerView.m */; }; 54E82E9F2CA6876300C931D9 /* RoomBoomManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82E9E2CA6876300C931D9 /* RoomBoomManager.m */; }; 54E82EA22CA6886700C931D9 /* RoomBoomBannerAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EA12CA6886700C931D9 /* RoomBoomBannerAnimation.m */; }; - 54E82EA52CA693FA00C931D9 /* RoomBoomProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EA42CA693FA00C931D9 /* RoomBoomProgressView.m */; }; + 54E82EA52CA693FA00C931D9 /* RoomBoomExplosionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EA42CA693FA00C931D9 /* RoomBoomExplosionView.m */; }; 54E82EA82CA6940900C931D9 /* RoomBoomResultView.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EA72CA6940900C931D9 /* RoomBoomResultView.m */; }; 54E82EAB2CA9261000C931D9 /* Api+Boom.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EAA2CA9261000C931D9 /* Api+Boom.m */; }; 54E82EAE2CA9293C00C931D9 /* BoomInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EAD2CA9293C00C931D9 /* BoomInfoModel.m */; }; @@ -2601,6 +2602,8 @@ 5468995C2C8AFE4C0049136A /* GiftComboFlagView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiftComboFlagView.m; sourceTree = ""; }; 5478539F2C258F2A00F45E60 /* XPMineUserViewHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserViewHeader.h; sourceTree = ""; }; 547853A02C258F2A00F45E60 /* XPMineUserViewHeader.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserViewHeader.m; sourceTree = ""; }; + 547B30F72CB511700041E962 /* RoomBoomEntryView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomBoomEntryView.h; sourceTree = ""; }; + 547B30F82CB511700041E962 /* RoomBoomEntryView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBoomEntryView.m; sourceTree = ""; }; 5484E1FB2CA2897B008E8754 /* IAPManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IAPManager.h; sourceTree = ""; }; 5484E1FC2CA2897B008E8754 /* IAPManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IAPManager.m; sourceTree = ""; }; 548E01C22C3F78360071C83D /* FeedBackViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FeedBackViewController.xib; sourceTree = ""; }; @@ -2659,8 +2662,8 @@ 54E82E9E2CA6876300C931D9 /* RoomBoomManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBoomManager.m; sourceTree = ""; }; 54E82EA02CA6886700C931D9 /* RoomBoomBannerAnimation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomBoomBannerAnimation.h; sourceTree = ""; }; 54E82EA12CA6886700C931D9 /* RoomBoomBannerAnimation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBoomBannerAnimation.m; sourceTree = ""; }; - 54E82EA32CA693FA00C931D9 /* RoomBoomProgressView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomBoomProgressView.h; sourceTree = ""; }; - 54E82EA42CA693FA00C931D9 /* RoomBoomProgressView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBoomProgressView.m; sourceTree = ""; }; + 54E82EA32CA693FA00C931D9 /* RoomBoomExplosionView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomBoomExplosionView.h; sourceTree = ""; }; + 54E82EA42CA693FA00C931D9 /* RoomBoomExplosionView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBoomExplosionView.m; sourceTree = ""; }; 54E82EA62CA6940900C931D9 /* RoomBoomResultView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomBoomResultView.h; sourceTree = ""; }; 54E82EA72CA6940900C931D9 /* RoomBoomResultView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBoomResultView.m; sourceTree = ""; }; 54E82EA92CA9261000C931D9 /* Api+Boom.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+Boom.h"; sourceTree = ""; }; @@ -6542,12 +6545,14 @@ 54E82E9E2CA6876300C931D9 /* RoomBoomManager.m */, 54E82EA02CA6886700C931D9 /* RoomBoomBannerAnimation.h */, 54E82EA12CA6886700C931D9 /* RoomBoomBannerAnimation.m */, - 54E82EA32CA693FA00C931D9 /* RoomBoomProgressView.h */, - 54E82EA42CA693FA00C931D9 /* RoomBoomProgressView.m */, + 54E82EA32CA693FA00C931D9 /* RoomBoomExplosionView.h */, + 54E82EA42CA693FA00C931D9 /* RoomBoomExplosionView.m */, 54E82EA62CA6940900C931D9 /* RoomBoomResultView.h */, 54E82EA72CA6940900C931D9 /* RoomBoomResultView.m */, 54E82EAF2CA93BE200C931D9 /* BoomInfoViewController.h */, 54E82EB02CA93BE200C931D9 /* BoomInfoViewController.m */, + 547B30F72CB511700041E962 /* RoomBoomEntryView.h */, + 547B30F82CB511700041E962 /* RoomBoomEntryView.m */, ); path = Boom; sourceTree = ""; @@ -11693,7 +11698,7 @@ 23FF25762ABD66B90064E904 /* XPFreeGiftsObtainView.m in Sources */, E81C27A226EF23490031E639 /* YUMINNNN.h in Sources */, E80E900C27E0358900434B90 /* XPRoomTopicAlertView.m in Sources */, - 54E82EA52CA693FA00C931D9 /* RoomBoomProgressView.m in Sources */, + 54E82EA52CA693FA00C931D9 /* RoomBoomExplosionView.m in Sources */, 9BDA3E7A27FD43EF00517FE6 /* XPAnchorFansTeamEntranceView.m in Sources */, E81C279826EB3AC40031E639 /* LoginForgetPasswordProtocol.h in Sources */, 9BD8D4E328911E9900AE03FF /* XPMineCollectRoomListViewController.m in Sources */, @@ -12530,6 +12535,7 @@ E8AB630D28ADD8C60023B0D2 /* XPMomentTopicContainerViewController.m in Sources */, 23E9EA7C2A83977400B792F2 /* MessageContentTreasureFairyView.m in Sources */, E8D4DE472940473500EC788D /* GiftTwelveStarFirstModel.m in Sources */, + 547B30F92CB511700041E962 /* RoomBoomEntryView.m in Sources */, E87DF4FB2A42CCDE009C1185 /* XPHomeRedommendCollectionViewCell.m in Sources */, 2368ECDA2BC3C02800EDF4C9 /* XPMineSwitchLanguageVC.m in Sources */, 187EEEF026E89FE8002833B2 /* AccountInfoStorage.m in Sources */, diff --git a/YuMi/Assets.xcassets/1.0.17/容器 8182.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.17/boom_banner_bg.imageset/Contents.json similarity index 100% rename from YuMi/Assets.xcassets/1.0.17/容器 8182.imageset/Contents.json rename to YuMi/Assets.xcassets/1.0.17/boom_banner_bg.imageset/Contents.json diff --git a/YuMi/Assets.xcassets/1.0.17/容器 8182.imageset/容器 8182@3x.png b/YuMi/Assets.xcassets/1.0.17/boom_banner_bg.imageset/容器 8182@3x.png similarity index 100% rename from YuMi/Assets.xcassets/1.0.17/容器 8182.imageset/容器 8182@3x.png rename to YuMi/Assets.xcassets/1.0.17/boom_banner_bg.imageset/容器 8182@3x.png diff --git a/YuMi/Assets.xcassets/1.0.17/容器 8192.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.17/boom_banner_go.imageset/Contents.json similarity index 100% rename from YuMi/Assets.xcassets/1.0.17/容器 8192.imageset/Contents.json rename to YuMi/Assets.xcassets/1.0.17/boom_banner_go.imageset/Contents.json diff --git a/YuMi/Assets.xcassets/1.0.17/容器 8192.imageset/容器 8192@3x.png b/YuMi/Assets.xcassets/1.0.17/boom_banner_go.imageset/容器 8192@3x.png similarity index 100% rename from YuMi/Assets.xcassets/1.0.17/容器 8192.imageset/容器 8192@3x.png rename to YuMi/Assets.xcassets/1.0.17/boom_banner_go.imageset/容器 8192@3x.png diff --git a/YuMi/Assets.xcassets/1.0.17/容器 8191.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.17/boom_banner_wear.imageset/Contents.json similarity index 100% rename from YuMi/Assets.xcassets/1.0.17/容器 8191.imageset/Contents.json rename to YuMi/Assets.xcassets/1.0.17/boom_banner_wear.imageset/Contents.json diff --git a/YuMi/Assets.xcassets/1.0.17/容器 8191.imageset/容器 8191@3x.png b/YuMi/Assets.xcassets/1.0.17/boom_banner_wear.imageset/容器 8191@3x.png similarity index 100% rename from YuMi/Assets.xcassets/1.0.17/容器 8191.imageset/容器 8191@3x.png rename to YuMi/Assets.xcassets/1.0.17/boom_banner_wear.imageset/容器 8191@3x.png diff --git a/YuMi/Assets.xcassets/1.0.17/room_boom_entry_progress_bar.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.17/room_boom_entry_progress_bar.imageset/Contents.json new file mode 100644 index 00000000..7e1f9d1b --- /dev/null +++ b/YuMi/Assets.xcassets/1.0.17/room_boom_entry_progress_bar.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "蒙版组 64@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/1.0.17/room_boom_entry_progress_bar.imageset/蒙版组 64@3x.png b/YuMi/Assets.xcassets/1.0.17/room_boom_entry_progress_bar.imageset/蒙版组 64@3x.png new file mode 100644 index 00000000..9572e115 Binary files /dev/null and b/YuMi/Assets.xcassets/1.0.17/room_boom_entry_progress_bar.imageset/蒙版组 64@3x.png differ diff --git a/YuMi/Assets.xcassets/1.0.17/room_boom_entry_progress_bar_bg.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.17/room_boom_entry_progress_bar_bg.imageset/Contents.json new file mode 100644 index 00000000..52b1eab3 --- /dev/null +++ b/YuMi/Assets.xcassets/1.0.17/room_boom_entry_progress_bar_bg.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "进度条空@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/1.0.17/room_boom_entry_progress_bar_bg.imageset/进度条空@3x.png b/YuMi/Assets.xcassets/1.0.17/room_boom_entry_progress_bar_bg.imageset/进度条空@3x.png new file mode 100644 index 00000000..b87e36fa Binary files /dev/null and b/YuMi/Assets.xcassets/1.0.17/room_boom_entry_progress_bar_bg.imageset/进度条空@3x.png differ diff --git a/YuMi/Assets.xcassets/1.0.17/room_boom_progress_bar.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.17/room_boom_progress_bar.imageset/Contents.json new file mode 100644 index 00000000..3577148b --- /dev/null +++ b/YuMi/Assets.xcassets/1.0.17/room_boom_progress_bar.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "图层 18 拷贝 3.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/1.0.17/room_boom_progress_bar.imageset/图层 18 拷贝 3.png b/YuMi/Assets.xcassets/1.0.17/room_boom_progress_bar.imageset/图层 18 拷贝 3.png new file mode 100644 index 00000000..3e817033 Binary files /dev/null and b/YuMi/Assets.xcassets/1.0.17/room_boom_progress_bar.imageset/图层 18 拷贝 3.png differ diff --git a/YuMi/Assets.xcassets/1.0.17/room_boom_raning_title.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.17/room_boom_raning_title.imageset/Contents.json new file mode 100644 index 00000000..645bbcc5 --- /dev/null +++ b/YuMi/Assets.xcassets/1.0.17/room_boom_raning_title.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "组 10@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/1.0.17/room_boom_raning_title.imageset/组 10@3x.png b/YuMi/Assets.xcassets/1.0.17/room_boom_raning_title.imageset/组 10@3x.png new file mode 100644 index 00000000..d0526479 Binary files /dev/null and b/YuMi/Assets.xcassets/1.0.17/room_boom_raning_title.imageset/组 10@3x.png differ diff --git a/YuMi/Assets.xcassets/1.0.17/room_boom_ranking_bg.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.17/room_boom_ranking_bg.imageset/Contents.json new file mode 100644 index 00000000..786a6ba5 --- /dev/null +++ b/YuMi/Assets.xcassets/1.0.17/room_boom_ranking_bg.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "色相/饱和度 9@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/1.0.17/room_boom_ranking_bg.imageset/色相/饱和度 9@3x.png b/YuMi/Assets.xcassets/1.0.17/room_boom_ranking_bg.imageset/色相/饱和度 9@3x.png new file mode 100644 index 00000000..8bae32f8 Binary files /dev/null and b/YuMi/Assets.xcassets/1.0.17/room_boom_ranking_bg.imageset/色相/饱和度 9@3x.png differ diff --git a/YuMi/Assets.xcassets/1.0.17/色相/饱和度 9-5.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.17/room_boom_ranking_name_bg.imageset/Contents.json similarity index 100% rename from YuMi/Assets.xcassets/1.0.17/色相/饱和度 9-5.imageset/Contents.json rename to YuMi/Assets.xcassets/1.0.17/room_boom_ranking_name_bg.imageset/Contents.json diff --git a/YuMi/Assets.xcassets/1.0.17/色相/饱和度 9-5.imageset/色相/饱和度 9@3x-5.png b/YuMi/Assets.xcassets/1.0.17/room_boom_ranking_name_bg.imageset/色相/饱和度 9@3x-5.png similarity index 100% rename from YuMi/Assets.xcassets/1.0.17/色相/饱和度 9-5.imageset/色相/饱和度 9@3x-5.png rename to YuMi/Assets.xcassets/1.0.17/room_boom_ranking_name_bg.imageset/色相/饱和度 9@3x-5.png diff --git a/YuMi/Global/YUMIMacroUitls.h b/YuMi/Global/YUMIMacroUitls.h index c3957245..56d239c1 100644 --- a/YuMi/Global/YUMIMacroUitls.h +++ b/YuMi/Global/YUMIMacroUitls.h @@ -38,6 +38,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns #define kImage(image) [UIImage imageNamed:image] ///UIFont +#define kFontLight(font) [UIFont systemFontOfSize:kGetScaleWidth(font) weight:UIFontWeightLight] #define kFontRegular(font) [UIFont systemFontOfSize:kGetScaleWidth(font) weight:UIFontWeightRegular] #define kFontMedium(font) [UIFont systemFontOfSize:kGetScaleWidth(font) weight:UIFontWeightMedium] #define kFontSemibold(font) [UIFont systemFontOfSize:kGetScaleWidth(font) weight:UIFontWeightSemibold] diff --git a/YuMi/Modules/YMMessage/Model/AttachmentModel.h b/YuMi/Modules/YMMessage/Model/AttachmentModel.h index 03895c6a..5b526c5d 100644 --- a/YuMi/Modules/YMMessage/Model/AttachmentModel.h +++ b/YuMi/Modules/YMMessage/Model/AttachmentModel.h @@ -64,6 +64,8 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) { CustomMessageType_LuckyBag = 61, ///发现萌新 CustomMessageType_FindNew = 62, + ///房间火箭 + CustomMessageType_RoomBoom = 63, /// CP 礼物 CustomMessageType_CP = 64, ///塔罗 @@ -388,6 +390,15 @@ typedef NS_ENUM(NSUInteger, CustomMessageFindNewUserGreet) { /// 打招呼 Custom_Message_Find_New_Greet_New_User = 621, }; +///first == CustomMessageType_RoomBoom 房间火箭 +typedef NS_ENUM(NSUInteger, CustomMessageRoomBoom) { + /// 经验值更新 + Custom_Message_Room_Boom_EXP = 631, + /// 升级 + Custom_Message_Room_Boom_LevelUp = 632, + /// 奖励 + Custom_Message_Room_Boom_Award = 633, +}; ///跳转类型 typedef NS_ENUM(NSUInteger, CustomMessageRouter) { /// 跳转H5 diff --git a/YuMi/Modules/YMMine/View/SubViews/CPCard.m b/YuMi/Modules/YMMine/View/SubViews/CPCard.m index b9d07b2d..8e75c081 100644 --- a/YuMi/Modules/YMMine/View/SubViews/CPCard.m +++ b/YuMi/Modules/YMMine/View/SubViews/CPCard.m @@ -232,11 +232,10 @@ - (void)didTapCPAvatar { if (self.relationUser.cpUid > 0) { - + XPMineUserInfoViewController * infoVC = [[XPMineUserInfoViewController alloc] init]; + infoVC.uid = self.relationUser.cpUid; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:infoVC animated:YES]; } - XPMineUserInfoViewController * infoVC = [[XPMineUserInfoViewController alloc] init]; - infoVC.uid = self.relationUser.cpUid; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:infoVC animated:YES]; } #pragma mark - diff --git a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m index 6e61d05a..0f877714 100644 --- a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m +++ b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m @@ -160,7 +160,7 @@ return view;\ numberOfLines = ceil(textRect.size.height / lineHeight); } - height = kGetScaleWidth(530) + lineHeight * numberOfLines; + height = kGetScaleWidth(540) + lineHeight * numberOfLines; return height; } diff --git a/YuMi/Modules/YMRoom/Api/Api+Boom.h b/YuMi/Modules/YMRoom/Api/Api+Boom.h index 153378de..f5810eb2 100644 --- a/YuMi/Modules/YMRoom/Api/Api+Boom.h +++ b/YuMi/Modules/YMRoom/Api/Api+Boom.h @@ -9,8 +9,12 @@ NS_ASSUME_NONNULL_BEGIN -@interface Api_Boom : Api +@interface Api(Boom) ++ (void)getBoomRocketAnimationInfo:(HttpRequestHelperCompletion)completion + roomUid:(NSString *)roomUid; ++ (void)getBoomDetailInfo:(HttpRequestHelperCompletion)completion + roomUid:(NSString *)roomUid; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/Api/Api+Boom.m b/YuMi/Modules/YMRoom/Api/Api+Boom.m index 1b500c37..7ff1d762 100644 --- a/YuMi/Modules/YMRoom/Api/Api+Boom.m +++ b/YuMi/Modules/YMRoom/Api/Api+Boom.m @@ -7,6 +7,19 @@ #import "Api+Boom.h" -@implementation Api_Boom +@implementation Api(Boom) ++ (void)getBoomRocketAnimationInfo:(HttpRequestHelperCompletion)completion + roomUid:(NSString *)roomUid { + [self makeRequest:@"room/boom/draw/info" + method:HttpRequestHelperMethodGET + completion:completion, __FUNCTION__, roomUid, nil]; +} + ++ (void)getBoomDetailInfo:(HttpRequestHelperCompletion)completion + roomUid:(NSString *)roomUid { + [self makeRequest:@"room/boom/level/info" + method:HttpRequestHelperMethodGET + completion:completion, __FUNCTION__, roomUid, nil]; +} @end diff --git a/YuMi/Modules/YMRoom/Api/Api+Room.m b/YuMi/Modules/YMRoom/Api/Api+Room.m index 4faab57d..31a6ffe2 100644 --- a/YuMi/Modules/YMRoom/Api/Api+Room.m +++ b/YuMi/Modules/YMRoom/Api/Api+Room.m @@ -105,7 +105,6 @@ /// @param roomId 房间的id + (void)roomActivityList:(HttpRequestHelperCompletion)completion roomId:(NSString *)roomId { - [self makeRequest:@"resource/list" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, roomId, nil]; } +(void)getPlayList:(HttpRequestHelperCompletion)completion roomId:(NSString *)roomId{ diff --git a/YuMi/Modules/YMRoom/Features/Boom/BoomInfoViewController.h b/YuMi/Modules/YMRoom/Features/Boom/BoomInfoViewController.h index 6895e044..f7e1e405 100644 --- a/YuMi/Modules/YMRoom/Features/Boom/BoomInfoViewController.h +++ b/YuMi/Modules/YMRoom/Features/Boom/BoomInfoViewController.h @@ -7,10 +7,14 @@ #import "MvpViewController.h" +//@class BoomDetailModel; + NS_ASSUME_NONNULL_BEGIN @interface BoomInfoViewController : MvpViewController +//+ (BoomInfoViewController *)vcFromBoomProgress:(NSArray *)models; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/Features/Boom/BoomInfoViewController.m b/YuMi/Modules/YMRoom/Features/Boom/BoomInfoViewController.m index f680eca0..aa45d0c2 100644 --- a/YuMi/Modules/YMRoom/Features/Boom/BoomInfoViewController.m +++ b/YuMi/Modules/YMRoom/Features/Boom/BoomInfoViewController.m @@ -7,25 +7,995 @@ #import "BoomInfoViewController.h" -@interface BoomInfoViewController () +#import "BoomInfoModel.h" +#import "RoomBoomManager.h" +#import "RoomBoomExplosionView.h" +#import "XPRoomGiftAnimationParser.h" + +#import + +@interface RocketBox : UIView + +@property (nonatomic, strong) NetImageView *icon; +@property (nonatomic, strong) UILabel *levelLabel; + +@property (nonatomic, assign) NSInteger level; +@property (nonatomic, assign) BOOL isSelected; +@property (nonatomic, copy) void(^didTapRocket)(NSInteger level); + +@end + +@implementation RocketBox + +- (instancetype)init { + if (self = [super init]) { + [self setupUI]; + [self setupTap]; + } + return self; +} + +- (void)setupUI { + [self addSubview:self.icon]; + [self.icon mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(0); + make.leading.mas_equalTo(4.5); + make.width.mas_equalTo(23); + make.height.mas_equalTo(36); + }]; + + [self addSubview:self.levelLabel]; + [self.levelLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self); + make.leading.mas_equalTo(self.icon.mas_trailing).offset(7); + make.trailing.mas_equalTo(0); + }]; +} + +- (void)setupTap { + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap)]; + [self addGestureRecognizer:tap]; +} + +- (void)handleTap { + if (_didTapRocket) { + self.didTapRocket(self.level); + } +} + +- (void)setLevel:(NSInteger)level { + _level = level; + +// NSString *iconPicName = [NSString stringWithFormat:@"room_boom_rocket_box_%ld", (long)level]; +// self.icon.image = kImage(iconPicName); + + self.levelLabel.text = [NSString stringWithFormat:@"LV.%ld", (long)level]; +} + +- (void)setIsSelected:(BOOL)isSelected { + _isSelected = isSelected; + if (isSelected) { + self.backgroundColor = UIColorFromRGB(0x9739FF); + } else { + self.backgroundColor = [UIColor clearColor]; + } +} + +- (NetImageView *)icon { + if (!_icon) { + _icon = [[NetImageView alloc] init]; + _icon.userInteractionEnabled = YES; + } + return _icon; +} + +- (UILabel *)levelLabel { + if (!_levelLabel) { + _levelLabel = [UILabel labelInitWithText:@"" font:kFontMedium(12) textColor:UIColorFromRGB(0xF8F4C9)]; + _levelLabel.textAlignment = NSTextAlignmentCenter; + _levelLabel.userInteractionEnabled = YES; + } + return _levelLabel; +} + +@end + + +@interface BoomInfoViewController () + +@property (nonatomic, strong) UIView *giftsView; +@property (nonatomic, strong) NetImageView *giftBig; +@property (nonatomic, strong) NetImageView *giftSmall_1; +@property (nonatomic, strong) NetImageView *giftSmall_2; +@property (nonatomic, strong) NetImageView *giftSmall_3; +@property (nonatomic, strong) NetImageView *giftSmall_4; + +@property (nonatomic, strong) RocketBox *rocket_lv_1; +@property (nonatomic, strong) RocketBox *rocket_lv_2; +@property (nonatomic, strong) RocketBox *rocket_lv_3; +@property (nonatomic, strong) RocketBox *rocket_lv_4; +@property (nonatomic, strong) RocketBox *rocket_lv_5; + +@property (nonatomic, strong) UILabel *progressLabel; + +@property (nonatomic, copy) NSArray * boomInfoArray; + +@property (nonatomic, strong) VAPView *vapView; +@property (nonatomic, strong) XPRoomGiftAnimationParser *vapParser; + +@property (nonatomic, assign) NSInteger selectedIndex; +@property (nonatomic, strong) UIImageView *progressBar; + +@property (nonatomic, strong) UIView *rankingView; +@property (nonatomic, strong) NetImageView *rankAvatar_1; +@property (nonatomic, strong) NetImageView *rankAvatar_2; +@property (nonatomic, strong) NetImageView *rankAvatar_3; +@property (nonatomic, strong) UILabel *rankName_1; +@property (nonatomic, strong) UILabel *rankName_2; +@property (nonatomic, strong) UILabel *rankName_3; @end @implementation BoomInfoViewController + +- (instancetype)init { + if (self = [super init]) { + self.view.backgroundColor = [UIColor clearColor]; + + } + return self; +} + +- (void)dealloc { + [self.vapView stopHWDMP4]; + [self.vapView removeFromSuperview]; + self.vapView = nil; + + [[RoomBoomManager sharedManager] removeEventListenerForTarget:self]; +} + - (void)viewDidLoad { [super viewDidLoad]; - // Do any additional setup after loading the view. + + [self setupUI]; + + @kWeakify(self); + [[RoomBoomManager sharedManager] registerBoomProgressUpdate:^(id _Nonnull sth) { + @kStrongify(self); + if ([sth isKindOfClass:[BoomDetailModel class]]) { + self.boomInfoArray = [[RoomBoomManager sharedManager] loadBoomDetails]; + } + } target:self]; + + self.selectedIndex = -1; + self.boomInfoArray = [[RoomBoomManager sharedManager] loadBoomDetails]; + + for (BoomDetailModel *boom in self.boomInfoArray) { + if (boom.currLevel == 1 || boom.speed > 0) { + [self handleTapRocket:boom level:boom.level]; + } + + switch (boom.level) { + case 1: + self.rocket_lv_1.icon.imageUrl = boom.pic; + break; + case 2: + self.rocket_lv_2.icon.imageUrl = boom.pic; + break; + case 3: + self.rocket_lv_3.icon.imageUrl = boom.pic; + break; + case 4: + self.rocket_lv_4.icon.imageUrl = boom.pic; + break; + case 5: + self.rocket_lv_5.icon.imageUrl = boom.pic; + break; + + default: + break; + } + } + + if (self.selectedIndex == -1) { + [self handleTapRocket:nil level:1]; + } } -/* -#pragma mark - Navigation +- (void)setBoomInfoArray:(NSArray *)boomInfoArray { + _boomInfoArray = boomInfoArray; -// In a storyboard-based application, you will often want to do a little preparation before navigation -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. + if (self.selectedIndex != -1) { + [self handleTapRocket:nil level:self.selectedIndex]; + } } -*/ + +- (void)setupUI { + UIImageView *backgroundImageView = [self backgroundImageView]; + [self.view addSubview:backgroundImageView]; + [backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.leading.trailing.mas_equalTo(self.view); + make.top.mas_equalTo(self.view).offset(kGetScaleWidth(154)); + }]; + + UIButton *leaveButton = [self leaveButton]; + [self.view addSubview:leaveButton]; + [leaveButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.leading.trailing.mas_equalTo(self.view); + make.height.mas_equalTo(kGetScaleWidth(188)); + }]; + + UIButton *bottomButton = [self bottomButton]; + [self.view addSubview:bottomButton]; + [bottomButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self.view); + make.bottom.mas_equalTo(self.view).offset(-11 - kSafeAreaBottomHeight); + make.width.mas_equalTo(kGetScaleWidth(340)); + make.height.mas_equalTo(kGetScaleWidth(44)); + }]; + + _vapView = [[VAPView alloc] init]; + _vapView.contentMode = UIViewContentModeScaleAspectFit; + [self.view addSubview:_vapView]; + [_vapView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self.view); + make.top.mas_equalTo(self.view).offset(kGetScaleWidth(170)); + make.width.mas_equalTo(kGetScaleWidth(211)); + make.height.mas_equalTo(kGetScaleWidth(489)); + }]; + + [self.view addSubview:self.giftsView]; + [self.giftsView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(bottomButton.mas_top).offset(-10); + make.centerX.mas_equalTo(self.view); + make.leading.mas_equalTo(10); + make.trailing.mas_equalTo(-10); + make.height.equalTo(self.giftsView.mas_width).multipliedBy(230.0/355.0); + }]; + UIImageView *jackpotBackgroundImageView = [self jackpotBackgroundImageView]; + [self.giftsView addSubview:jackpotBackgroundImageView]; + [jackpotBackgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.giftsView); + }]; + + UIButton *helpButton = [self helpButton]; + [self.giftsView addSubview:helpButton]; + [helpButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(jackpotBackgroundImageView).offset(-8); + make.trailing.mas_equalTo(jackpotBackgroundImageView).offset(-3); + make.width.height.mas_equalTo(43); + }]; + + UIImageView *jackpotTitleImageView = [self jackpotTitleView]; + [self.giftsView addSubview:jackpotTitleImageView]; + [jackpotTitleImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(jackpotBackgroundImageView); + make.centerY.mas_equalTo(helpButton); + make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(166), kGetScaleWidth(52))); + }]; + + UILabel *tipsLabel = [self jackpotTipsLabel]; + [self.giftsView addSubview:tipsLabel]; + [tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(jackpotTitleImageView.mas_bottom).offset(4.5); + make.leading.mas_equalTo(jackpotBackgroundImageView).offset(28); + make.trailing.mas_equalTo(jackpotBackgroundImageView).offset(-28); + make.height.mas_equalTo(12); + }]; + + UIImageView *giftBigBG = [self jackpotGiftBigBG]; + [self.giftsView addSubview:giftBigBG]; + [giftBigBG mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(tipsLabel.mas_bottom).offset(11.5); + make.bottom.mas_equalTo(jackpotBackgroundImageView).offset(-11); + make.leading.mas_equalTo(jackpotBackgroundImageView).offset(32); + make.width.mas_equalTo(kGetScaleWidth(120)); + }]; + + [giftBigBG addSubview:self.giftBig]; + [self.giftBig mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(giftBigBG); + make.size.mas_equalTo(giftBigBG).multipliedBy(0.8); + }]; + + UIImageView *giftSmall_1 = [self jackpotGiftSmallBG]; + [self.giftsView addSubview:giftSmall_1]; + [giftSmall_1 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(giftBigBG); + make.leading.mas_equalTo(giftBigBG.mas_trailing).offset(13); + make.width.height.mas_equalTo(kGetScaleWidth(73.5)); + }]; + + [giftSmall_1 addSubview:self.giftSmall_1]; + [self.giftSmall_1 mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(giftSmall_1); + make.size.mas_equalTo(giftSmall_1).multipliedBy(0.8); + }]; + + UIImageView *giftSmall_2 = [self jackpotGiftSmallBG]; + [self.giftsView addSubview:giftSmall_2]; + [giftSmall_2 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(giftBigBG); + make.leading.mas_equalTo(giftSmall_1.mas_trailing).offset(13); + make.width.height.mas_equalTo(kGetScaleWidth(73.5)); + }]; + + [giftSmall_2 addSubview:self.giftSmall_2]; + [self.giftSmall_2 mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(giftSmall_2); + make.size.mas_equalTo(giftSmall_2).multipliedBy(0.8); + }]; + + UIImageView *giftSmall_3 = [self jackpotGiftSmallBG]; + [self.giftsView addSubview:giftSmall_3]; + [giftSmall_3 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(giftSmall_1.mas_bottom).offset(5.5); + make.leading.mas_equalTo(giftBigBG.mas_trailing).offset(13); + make.width.height.mas_equalTo(kGetScaleWidth(73.5)); + }]; + + [giftSmall_3 addSubview:self.giftSmall_3]; + [self.giftSmall_3 mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(giftSmall_3); + make.size.mas_equalTo(giftSmall_3).multipliedBy(0.8); + }]; + + UIImageView *giftSmall_4 = [self jackpotGiftSmallBG]; + [self.giftsView addSubview:giftSmall_4]; + [giftSmall_4 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(giftSmall_3); + make.leading.mas_equalTo(giftSmall_3.mas_trailing).offset(13); + make.width.height.mas_equalTo(kGetScaleWidth(73.5)); + }]; + + [giftSmall_4 addSubview:self.giftSmall_4]; + [self.giftSmall_4 mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(giftSmall_4); + make.size.mas_equalTo(giftSmall_4).multipliedBy(0.8); + }]; + + UIImageView *progressBG = [self progressBarBG]; + [self.view addSubview:progressBG]; + [progressBG mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(helpButton.mas_top).offset(-13); + make.trailing.mas_equalTo(self.view).offset(-6); + make.width.mas_equalTo(kGetScaleWidth(58)); + make.height.mas_equalTo(kGetScaleWidth(240)); + }]; + + [progressBG addSubview:self.progressBar]; + [self.progressBar mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(progressBG); + make.bottom.mas_equalTo(progressBG).offset(kGetScaleWidth(-35)); + make.width.mas_equalTo(kGetScaleWidth(18)); + make.height.mas_equalTo(kGetScaleWidth(180)).multipliedBy(1); + }]; + + UIImageView *progressNumberBG = [self progressBarNumberBG]; + [self.view addSubview:progressNumberBG]; + [progressNumberBG mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(progressBG).offset(kGetScaleWidth(-13)); + make.centerX.mas_equalTo(progressBG); + make.width.height.mas_equalTo(kGetScaleWidth(43)); + }]; + + [self.view addSubview:self.progressLabel]; + [self.progressLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(progressNumberBG); + }]; + + UIImageView *rocketsBG = [self rocketsBG]; + [self.view addSubview:rocketsBG]; + [rocketsBG mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(self.view); + make.bottom.mas_equalTo(jackpotBackgroundImageView.mas_top); + make.width.mas_equalTo(kGetScaleWidth(71)); + make.height.mas_equalTo(kGetScaleWidth(247)); + }]; + + [rocketsBG addSubview:self.rocket_lv_5]; + [self.rocket_lv_5 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(rocketsBG).offset(kGetScaleWidth(11.5)); + make.leading.mas_equalTo(rocketsBG); + make.width.mas_equalTo(rocketsBG.mas_width).offset(-7.5); + make.height.mas_equalTo(kGetScaleWidth(38.5)); + }]; + + [rocketsBG addSubview:self.rocket_lv_4]; + [self.rocket_lv_4 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.rocket_lv_5.mas_bottom).offset(kGetScaleWidth(7)); + make.leading.mas_equalTo(rocketsBG); + make.width.mas_equalTo(self.rocket_lv_5); + make.height.mas_equalTo(self.rocket_lv_5); + }]; + + [rocketsBG addSubview:self.rocket_lv_3]; + [self.rocket_lv_3 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.rocket_lv_4.mas_bottom).offset(kGetScaleWidth(7)); + make.leading.mas_equalTo(rocketsBG); + make.width.mas_equalTo(self.rocket_lv_5); + make.height.mas_equalTo(self.rocket_lv_5); + }]; + + [rocketsBG addSubview:self.rocket_lv_2]; + [self.rocket_lv_2 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.rocket_lv_3.mas_bottom).offset(kGetScaleWidth(7)); + make.leading.mas_equalTo(rocketsBG); + make.width.mas_equalTo(self.rocket_lv_5); + make.height.mas_equalTo(self.rocket_lv_5); + }]; + + [rocketsBG addSubview:self.rocket_lv_1]; + [self.rocket_lv_1 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.rocket_lv_2.mas_bottom).offset(kGetScaleWidth(7)); + make.leading.mas_equalTo(rocketsBG); + make.width.mas_equalTo(self.rocket_lv_5); + make.height.mas_equalTo(self.rocket_lv_5); + }]; + + [self.view addSubview:self.rankingView]; + [self.rankingView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.view).offset(-16); + make.leading.mas_equalTo(self.view).offset(10); + make.trailing.mas_equalTo(self.view).offset(-10); + make.height.mas_equalTo(kGetScaleWidth(288)); + }]; + + UIImageView *rankingBG = [self rankingBG]; + [self.rankingView addSubview:rankingBG]; + [rankingBG mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.rankingView); + }]; + + UIButton *helpButton_2 = [self helpButton]; + [self.rankingView addSubview:helpButton_2]; + [helpButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(rankingBG).offset(-8); + make.trailing.mas_equalTo(rankingBG).offset(-3); + make.width.height.mas_equalTo(43); + }]; + + UIImageView *rankingTitle = [self rankingTitle]; + [self.rankingView addSubview:rankingTitle]; + [rankingTitle mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(rankingBG.mas_top).offset(-14); + make.centerX.mas_equalTo(self.rankingView); + make.width.mas_equalTo(kGetScaleWidth(215)); + make.height.mas_equalTo(kGetScaleWidth(52)); + }]; + + [self.rankingView addSubview:self.rankAvatar_1]; + [self.rankAvatar_1 mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self.rankingView); + make.top.mas_equalTo(rankingBG).offset(kGetScaleWidth(60)); + make.width.height.mas_equalTo(kGetScaleWidth(86)); + }]; + UIImageView *wear_1 = [self rankingAvatarWear]; + [self.rankingView addSubview:wear_1]; + [wear_1 mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(self.rankAvatar_1); + make.width.height.mas_equalTo(kGetScaleWidth(124)); + }]; + + [self.rankingView addSubview:self.rankAvatar_2]; + [self.rankAvatar_2 mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(rankingBG).offset(30); + make.top.mas_equalTo(rankingBG).offset(kGetScaleWidth(108)); + make.width.height.mas_equalTo(kGetScaleWidth(66)); + }]; + UIImageView *wear_2 = [self rankingAvatarWear]; + [self.rankingView addSubview:wear_2]; + [wear_2 mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(self.rankAvatar_2); + make.width.height.mas_equalTo(kGetScaleWidth(94)); + }]; + + [self.rankingView addSubview:self.rankAvatar_3]; + [self.rankAvatar_3 mas_makeConstraints:^(MASConstraintMaker *make) { + make.trailing.mas_equalTo(rankingBG).offset(-30); + make.top.mas_equalTo(rankingBG).offset(kGetScaleWidth(108)); + make.width.height.mas_equalTo(kGetScaleWidth(66)); + }]; + UIImageView *wear_3 = [self rankingAvatarWear]; + [self.rankingView addSubview:wear_3]; + [wear_3 mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(self.rankAvatar_3); + make.width.height.mas_equalTo(kGetScaleWidth(94)); + }]; + + UIImageView *nameBG_1 = [self rankingNameBG]; + [self.rankingView addSubview:nameBG_1]; + [nameBG_1 mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(wear_1); + make.top.mas_equalTo(wear_1.mas_bottom).offset(6); + make.width.mas_equalTo(kGetScaleWidth(98)); + make.height.mas_equalTo(kGetScaleWidth(28)); + }]; + [self.rankingView addSubview:self.rankName_1]; + [self.rankName_1 mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(nameBG_1); + }]; + + UIImageView *nameBG_2 = [self rankingNameBG]; + [self.rankingView addSubview:nameBG_2]; + [nameBG_2 mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(wear_2); + make.top.mas_equalTo(wear_2.mas_bottom).offset(6); + make.width.mas_equalTo(kGetScaleWidth(98)); + make.height.mas_equalTo(kGetScaleWidth(28)); + }]; + [self.rankingView addSubview:self.rankName_2]; + [self.rankName_2 mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(nameBG_2); + }]; + + UIImageView *nameBG_3 = [self rankingNameBG]; + [self.rankingView addSubview:nameBG_3]; + [nameBG_3 mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(wear_3); + make.top.mas_equalTo(wear_3.mas_bottom).offset(6); + make.width.mas_equalTo(kGetScaleWidth(98)); + make.height.mas_equalTo(kGetScaleWidth(28)); + }]; + [self.rankingView addSubview:self.rankName_3]; + [self.rankName_3 mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(nameBG_3); + }]; + + UILabel *tipsLabel_2 = [self rankTipsLabel]; + [self.rankingView addSubview:tipsLabel_2]; + [tipsLabel_2 mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self.rankingView); + make.bottom.mas_equalTo(-15); + }]; +} + +- (void)handleTapBottomButton { + [self dismissViewControllerAnimated:YES completion:nil]; +} + +- (void)handleTapHelpButton { + +} + +- (void)handleTapEmptySpace { + [self dismissViewControllerAnimated:YES completion:nil]; +} + +- (void)handleTapRocket:(BoomDetailModel * _Nullable )boom level:(NSInteger)level { + + self.selectedIndex = level; + + self.rocket_lv_1.isSelected = NO; + self.rocket_lv_2.isSelected = NO; + self.rocket_lv_3.isSelected = NO; + self.rocket_lv_4.isSelected = NO; + self.rocket_lv_5.isSelected = NO; + + switch (level) { + case 1: + self.rocket_lv_1.isSelected = YES; + break; + case 2: + self.rocket_lv_2.isSelected = YES; + break; + case 3: + self.rocket_lv_3.isSelected = YES; + break; + case 4: + self.rocket_lv_4.isSelected = YES; + break; + case 5: + self.rocket_lv_5.isSelected = YES; + break; + default: + break; + } + + if (boom == nil) { + for (BoomDetailModel *boomInfo in self.boomInfoArray) { + if (boomInfo.level == level) { + boom = boomInfo; + break; + } + } + } + + self.progressLabel.text = @(boom.speed).stringValue; + CGFloat progress = boom.speed * 1.0 / 100.0; + if (progress == 0) { + progress = 0.05; + } + [UIView animateWithDuration:0.3 animations:^{ + [self.progressBar mas_updateConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(kGetScaleWidth(180) * progress); // 动态调整高度 + }]; + [self.view layoutIfNeeded]; + }]; + + [self playMP4:boom.vapUrl]; + + if (boom.roomBoomRankVos.count > 0) { + self.rankingView.hidden = NO; + self.giftsView.hidden = YES; + for (roomBoomRankVo *rank in boom.roomBoomRankVos) { + switch (rank.position) { + case 1: + self.rankAvatar_1.imageUrl = rank.avatar; + self.rankName_1.text = rank.nick; + break; + case 2: + self.rankAvatar_2.imageUrl = rank.avatar; + self.rankName_2.text = rank.nick; + break; + case 3: + self.rankAvatar_3.imageUrl = rank.avatar; + self.rankName_3.text = rank.nick; + break; + default: + break; + } + } + } else { + self.rankingView.hidden = YES; + self.giftsView.hidden = NO; + for (roomBoomLevelAwardVo *award in boom.roomBoomLevelAwardVos) { + if (award.isShow != 1) { + continue; + } + switch (award.seq) { + case 1: + self.giftBig.imageUrl = award.awardPic; + break; + case 2: + self.giftSmall_1.imageUrl = award.awardPic; + break; + case 3: + self.giftSmall_2.imageUrl = award.awardPic; + break; + case 4: + self.giftSmall_3.imageUrl = award.awardPic; + break; + case 5: + self.giftSmall_4.imageUrl = award.awardPic; + break; + default: + break; + } + } + } +} + +- (void)playMP4:(NSString *)path { + NSString *mp4Path = [path stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if (mp4Path.length == 0) { + return; + } + + NSString *encodingUrl = [mp4Path stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; + @kWeakify(self); + [self.vapParser parseWithURL:encodingUrl completionBlock:^(NSString * _Nullable videoUrl) { + @kStrongify(self); + if (videoUrl.length) { + [self.vapView setMute:YES]; + [self.vapView playHWDMP4:videoUrl repeatCount:-1 delegate:self]; + } + } failureBlock:^(NSError * _Nullable error) { + NSLog(@"%@", error); + }]; +} + +#pragma mark - HWDMP4PlayDelegate +//即将开始播放时询问,true马上开始播放,false放弃播放 +- (BOOL)shouldStartPlayMP4:(VAPView *)container config:(QGVAPConfigModel *)config { + return YES; +} + +- (void)viewDidFinishPlayMP4:(NSInteger)totalFrameCount view:(VAPView *)container { + +} + +- (void)viewDidStopPlayMP4:(NSInteger)lastFrameIndex view:(VAPView *)container { + +} +- (void)viewDidFailPlayMP4:(NSError *)error{ + +} + +#pragma mark - +- (UILabel *)progressLabel { + if (!_progressLabel) { + _progressLabel = [UILabel labelInitWithText:@"99" font:kFontMedium(15) textColor:UIColorFromRGB(0xF0E7BA)]; + } + return _progressLabel; +} + +- (UIButton *)leaveButton { + UIButton *b = [UIButton buttonWithType:UIButtonTypeCustom]; + [b addTarget:self action:@selector(handleTapEmptySpace) forControlEvents:UIControlEventTouchUpInside]; + return b; +} + +- (UIImageView *)backgroundImageView { + UIImageView *bg = [[UIImageView alloc] initWithImage:kImage(@"room_boom_progress_bg")]; + bg.contentMode = UIViewContentModeScaleAspectFit; + bg.userInteractionEnabled = YES; + return bg; +} + +- (UIView *)giftsView { + if (!_giftsView) { + _giftsView = [[UIView alloc] init]; + _giftsView.hidden = YES; + } + return _giftsView; +} + +- (UIButton *)bottomButton { + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; + [button setTitle:YMLocalizedString(@"RoomBoom_2") forState:UIControlStateNormal]; + [button setBackgroundImage:kImage(@"room_boom_progress_bottom_bg") forState:UIControlStateNormal]; + [button addTarget:self action:@selector(handleTapBottomButton) forControlEvents:UIControlEventTouchUpInside]; + return button; +} + +- (UIImageView *)jackpotBackgroundImageView { + UIImageView *bg = [[UIImageView alloc] initWithImage:kImage(@"room_boom_progress_jackpot_bg")]; + bg.contentMode = UIViewContentModeScaleToFill; + return bg; +} + +- (UIButton *)helpButton { + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; + [button setBackgroundImage:kImage(@"room_boom_progress_help") forState:UIControlStateNormal]; + [button addTarget:self action:@selector(handleTapHelpButton) forControlEvents:UIControlEventTouchUpInside]; + return button; +} + +- (UIImageView *)jackpotTitleView { + UIImageView *imageView = [[UIImageView alloc] initWithImage:kImage(@"room_boom_progress_jsckpot_title")]; + return imageView; +} + +- (UILabel *)jackpotTipsLabel { + UILabel *label = [UILabel labelInitWithText:@"以下的奖励仅供参考,具体发放的礼物由您的贡献值和幸运程度决定" font:kFontRegular(10) textColor:UIColorFromRGB(0xCBA1FF)]; + label.textAlignment = NSTextAlignmentCenter; + return label; +} + +- (UIImageView *)jackpotGiftBigBG { + UIImageView *imageView = [[UIImageView alloc] initWithImage:kImage(@"room_boom_progress_gift_big_bg")]; + return imageView; +} + +- (UIImageView *)jackpotGiftSmallBG { + UIImageView *imageView = [[UIImageView alloc] initWithImage:kImage(@"room_boom_progress_gift_small_bg")]; + return imageView; +} + +- (UIView *)rankingView { + if (!_rankingView) { + _rankingView = [[UIView alloc] init]; + _rankingView.hidden = YES; + } + return _rankingView; +} + +- (UIImageView *)rankingBG { + UIImageView *imageView = [[UIImageView alloc] initWithImage:kImage(@"room_boom_ranking_bg")]; + return imageView; +} + +- (UIImageView *)rankingTitle { + UIImageView *imageView = [[UIImageView alloc] initWithImage:kImage(@"room_boom_raning_title")]; + return imageView; +} + +- (UIImageView *)rankingAvatarWear { + UIImageView *imageView = [[UIImageView alloc] initWithImage:kImage(@"room_boom_progress_avatar")]; + return imageView; +} + +- (UIImageView *)rankingNameBG { + UIImageView *imageView = [[UIImageView alloc] initWithImage:kImage(@"room_boom_ranking_name_bg")]; + return imageView; +} + +- (UILabel *)rankName_1 { + if (!_rankName_1) { + _rankName_1 = [UILabel labelInitWithText:@"" font:kFontMedium(15) textColor:UIColorFromRGB(0xF0E7BA)]; + } + return _rankName_1; +} + +- (UILabel *)rankName_2 { + if (!_rankName_2) { + _rankName_2 = [UILabel labelInitWithText:@"" font:kFontMedium(15) textColor:UIColorFromRGB(0xF0E7BA)]; + } + return _rankName_2; +} + +- (UILabel *)rankName_3 { + if (!_rankName_3) { + _rankName_3 = [UILabel labelInitWithText:@"" font:kFontMedium(15) textColor:UIColorFromRGB(0xF0E7BA)]; + } + return _rankName_3; +} + +- (NetImageView *)rankAvatar_1 { + if (!_rankAvatar_1) { + _rankAvatar_1 = [[NetImageView alloc] init]; + _rankAvatar_1.contentMode = UIViewContentModeScaleAspectFit; + _rankAvatar_1.layer.cornerRadius = 86/2; + _rankAvatar_1.layer.masksToBounds = YES; + } + return _rankAvatar_1; +} + +- (NetImageView *)rankAvatar_2 { + if (!_rankAvatar_2) { + _rankAvatar_2 = [[NetImageView alloc] init]; + _rankAvatar_2.contentMode = UIViewContentModeScaleAspectFit; + _rankAvatar_2.layer.cornerRadius = 66/2; + _rankAvatar_2.layer.masksToBounds = YES; + } + return _rankAvatar_2; +} + +- (NetImageView *)rankAvatar_3 { + if (!_rankAvatar_3) { + _rankAvatar_3 = [[NetImageView alloc] init]; + _rankAvatar_3.contentMode = UIViewContentModeScaleAspectFit; + _rankAvatar_3.layer.cornerRadius = 66/2; + _rankAvatar_3.layer.masksToBounds = YES; + } + return _rankAvatar_3; +} + +- (UIImageView *)progressBarBG { + UIImageView *imageView = [[UIImageView alloc] initWithImage:kImage(@"room_boom_progress_bar_bg")]; + return imageView; +} + +- (UIImageView *)progressBarNumberBG { + UIImageView *imageView = [[UIImageView alloc] initWithImage:kImage(@"room_boom_progress_number_bg")]; + return imageView; +} + +- (UIImageView *)rocketsBG { + UIImageView *imageView = [[UIImageView alloc] initWithImage:kImage(@"room_boom_progress_rockets_bg")]; + imageView.userInteractionEnabled = YES; + return imageView; +} + +- (NetImageView *)giftBig { + if (!_giftBig) { + _giftBig = [[NetImageView alloc] init]; + _giftBig.contentMode = UIViewContentModeScaleAspectFit; + } + return _giftBig; +} + +- (NetImageView *)giftSmall_1 { + if (!_giftSmall_1) { + _giftSmall_1 = [[NetImageView alloc] init]; + _giftSmall_1.contentMode = UIViewContentModeScaleAspectFit; + } + return _giftSmall_1; +} + +- (NetImageView *)giftSmall_2 { + if (!_giftSmall_2) { + _giftSmall_2 = [[NetImageView alloc] init]; + _giftSmall_2.contentMode = UIViewContentModeScaleAspectFit; + } + return _giftSmall_2; +} + +- (NetImageView *)giftSmall_3 { + if (!_giftSmall_3) { + _giftSmall_3 = [[NetImageView alloc] init]; + _giftSmall_3.contentMode = UIViewContentModeScaleAspectFit; + } + return _giftSmall_3; +} + +- (NetImageView *)giftSmall_4 { + if (!_giftSmall_4) { + _giftSmall_4 = [[NetImageView alloc] init]; + _giftSmall_4.contentMode = UIViewContentModeScaleAspectFit; + } + return _giftSmall_4; +} + +- (RocketBox *)rocket_lv_1 { + if (!_rocket_lv_1) { + _rocket_lv_1 = [[RocketBox alloc] init]; + _rocket_lv_1.level = 1; + @kWeakify(self); + _rocket_lv_1.didTapRocket = ^(NSInteger level) { + @kStrongify(self); + [self handleTapRocket:nil level:level]; + }; + } + return _rocket_lv_1; +} + +- (RocketBox *)rocket_lv_2 { + if (!_rocket_lv_2) { + _rocket_lv_2 = [[RocketBox alloc] init]; + _rocket_lv_2.level = 2; + @kWeakify(self); + _rocket_lv_2.didTapRocket = ^(NSInteger level) { + @kStrongify(self); + [self handleTapRocket:nil level:level]; + }; + } + return _rocket_lv_2; +} + +- (RocketBox *)rocket_lv_3 { + if (!_rocket_lv_3) { + _rocket_lv_3 = [[RocketBox alloc] init]; + _rocket_lv_3.level = 3; + @kWeakify(self); + _rocket_lv_3.didTapRocket = ^(NSInteger level) { + @kStrongify(self); + [self handleTapRocket:nil level:level]; + }; + } + return _rocket_lv_3; +} + +- (RocketBox *)rocket_lv_4 { + if (!_rocket_lv_4) { + _rocket_lv_4 = [[RocketBox alloc] init]; + _rocket_lv_4.level = 4; + @kWeakify(self); + _rocket_lv_4.didTapRocket = ^(NSInteger level) { + @kStrongify(self); + [self handleTapRocket:nil level:level]; + }; + } + return _rocket_lv_4; +} + +- (RocketBox *)rocket_lv_5 { + if (!_rocket_lv_5) { + _rocket_lv_5 = [[RocketBox alloc] init]; + _rocket_lv_5.level = 5; + @kWeakify(self); + _rocket_lv_5.didTapRocket = ^(NSInteger level) { + @kStrongify(self); + [self handleTapRocket:nil level:level]; + }; + } + return _rocket_lv_5; +} + +- (XPRoomGiftAnimationParser *)vapParser { + if (!_vapParser) { + _vapParser = [[XPRoomGiftAnimationParser alloc] init]; + } + return _vapParser; +} + +- (UIImageView *)progressBar { + if (!_progressBar) { + UIImage *progressImage = [kImage(@"room_boom_progress_bar") resizableImageWithCapInsets:UIEdgeInsetsMake(10, 0, 10, 0) resizingMode:UIImageResizingModeStretch]; + _progressBar = [[UIImageView alloc] initWithImage:progressImage]; + _progressBar.userInteractionEnabled = YES; + _progressBar.hidden = NO; + } + return _progressBar; +} + +- (UILabel *)rankTipsLabel { + UILabel *label = [UILabel labelInitWithText:YMLocalizedString(@"RoomBoom_6") font:kFontLight(12) textColor:[UIColor whiteColor]]; + label.textAlignment = NSTextAlignmentCenter; + return label; +} + @end diff --git a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomBannerAnimation.h b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomBannerAnimation.h index bd325e30..497ce931 100644 --- a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomBannerAnimation.h +++ b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomBannerAnimation.h @@ -7,10 +7,24 @@ #import +@class AttachmentModel; + NS_ASSUME_NONNULL_BEGIN @interface RoomBoomBannerAnimation : UIView + +/// 播放房间特效的方法,后续有机会重构,所有对象按此方法进行 +/// - Parameters: +/// - superView: 加载特效的视图 +/// - attachment: 构建视图内容的数据 +/// - handleTapToRoom: 是否响应点击事件,点击后在内部处理逻辑 +/// - complete: 播放完成回调 ++ (void)display:(UIView *)superView + with:(AttachmentModel *)attachment + tapToRoom:(BOOL)handleTapToRoom + complete:(void(^)(void))complete; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomBannerAnimation.m b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomBannerAnimation.m index 9063c73e..dde6ec90 100644 --- a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomBannerAnimation.m +++ b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomBannerAnimation.m @@ -7,14 +7,233 @@ #import "RoomBoomBannerAnimation.h" -@implementation RoomBoomBannerAnimation +#import "RoomBoomManager.h" -/* -// Only override drawRect: if you perform custom drawing. -// An empty implementation adversely affects performance during animation. -- (void)drawRect:(CGRect)rect { - // Drawing code -} -*/ +#import "RoomInfoModel.h" +#import "BoomInfoModel.h" +#import "AttachmentModel.h" +#import "RoomHostDelegate.h" +#import "XPRoomViewController.h" +#import "XCCurrentVCStackManager.h" + +@interface RoomBoomBannerAnimation () + +@property (nonatomic, strong) NetImageView *avatar; +@property (nonatomic, strong) NetImageView *rocket; +@property (nonatomic, strong) UILabel *titleLabel; +@property (nonatomic, strong) UILabel *contentLabel; + +@property (nonatomic, strong) Boom632Model *model; + +//@property (nonatomic, copy) void(^didTapGo)(void); +@property (nonatomic, assign) BOOL needHandleTap; + +@end + +@implementation RoomBoomBannerAnimation + ++ (void)display:(UIView *)superView + with:(AttachmentModel *)attachment + tapToRoom:(BOOL)handleTapToRoom + complete:(nonnull void (^)(void))complete { + + if (!attachment) { + return; + } + + Boom632Model *m = [Boom632Model modelWithJSON:attachment.data]; + + CGFloat width = KScreenWidth-32; + CGFloat height = kGetScaleWidth(90); + RoomBoomBannerAnimation *bannerView = [[RoomBoomBannerAnimation alloc] initWithFrame:CGRectMake(KScreenWidth, 80, width, height)]; + bannerView.model = m; + bannerView.needHandleTap = handleTapToRoom; + [superView addSubview:bannerView]; + + @kWeakify(bannerView); + [UIView animateWithDuration:0.25 animations:^{ + bannerView.center = CGPointMake(superView.center.x, height/2 + 80); + } completion:^(BOOL finished) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ + bannerView.frame = CGRectMake(-KScreenWidth, 80, width, height); + } completion:^(BOOL finished) { + @kStrongify(bannerView); + [bannerView removeFromSuperview]; + + [[RoomBoomManager sharedManager] bannerDisplayEnd]; + }]; + }); + }]; +} + +- (void)setModel:(Boom632Model *)model { + _model = model; + self.avatar.imageUrl = model.avatar; + self.rocket.imageUrl = model.pic; + self.titleLabel.text = [NSString stringWithFormat:@"%@%@", YMLocalizedString(@"RoomBoom_5"), model.roomTitle]; +} + +- (void)handleTapGo { + if (self.needHandleTap) { + + // 找到當前房間 + UIViewController * controllerView = [XCCurrentVCStackManager shareManager].getCurrentVC; + __block XPRoomViewController *roomVC = nil; + [controllerView.navigationController.viewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + if ([obj isKindOfClass:[XPRoomViewController class]]) { + [controllerView.navigationController popToRootViewControllerAnimated:NO]; + roomVC = obj; + *stop = YES; + } + }]; + + if (roomVC) { + // 是否相同房間 + if ([roomVC getRoomInfo].uid == self.model.roomUid) { + return; + } + + @kWeakify(self); + [TTPopup alertWithMessage:YMLocalizedString(@"Combo_10") confirmHandler:^{ + @kStrongify(self); + [roomVC exitRoom]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [XPRoomViewController openRoom:@(self.model.roomUid).stringValue + viewController:[XCCurrentVCStackManager shareManager].getCurrentVC]; + }); + } cancelHandler:^{}]; + + } else { + [XPRoomViewController openRoom:@(self.model.roomUid).stringValue + viewController:[XCCurrentVCStackManager shareManager].getCurrentVC]; + } + } +} + +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + + self.backgroundColor = [UIColor yellowColor]; + + UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage:kImage(@"boom_banner_bg")]; + backgroundImageView.contentMode = UIViewContentModeScaleAspectFit; + [self addSubview:backgroundImageView]; + [backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.right.bottom.mas_equalTo(self); + make.width.mas_equalTo(kGetScaleWidth(285)); + }]; + + UIButton *goButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [goButton addTarget:self action:@selector(handleTapGo) forControlEvents:UIControlEventTouchUpInside]; + [goButton setBackgroundImage:kImage(@"boom_banner_go") forState:UIControlStateNormal]; + [self addSubview:goButton]; + [goButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.right.bottom.mas_equalTo(self); + make.width.mas_equalTo(kGetScaleWidth(97)); + }]; + + UIImageView *avatarWearImageView = [[UIImageView alloc] initWithImage:kImage(@"boom_banner_wear")]; + avatarWearImageView.contentMode = UIViewContentModeScaleAspectFit; + [self addSubview:avatarWearImageView]; + [avatarWearImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.left.bottom.mas_equalTo(self); + make.width.mas_equalTo(kGetScaleWidth(94)); + }]; + + [self insertSubview:self.avatar belowSubview:avatarWearImageView]; + [self.avatar mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(avatarWearImageView); + make.top.mas_equalTo(avatarWearImageView).offset(19); + make.width.height.mas_equalTo(kGetScaleWidth(57)); + }]; + + [self addSubview:self.rocket]; + [self.rocket mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(avatarWearImageView.mas_right); + make.centerY.mas_equalTo(avatarWearImageView); + make.width.height.mas_equalTo(kGetScaleWidth(35)); + }]; + + [self addSubview:self.titleLabel]; + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(kGetScaleWidth(38)); + make.left.mas_equalTo(self.rocket.mas_right).offset(4); + make.right.mas_equalTo(goButton.mas_left); + make.height.mas_offset(17); + }]; + + [self addSubview:self.contentLabel]; + [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.titleLabel.mas_bottom); + make.left.mas_equalTo(self.rocket.mas_right).offset(4); + make.right.mas_equalTo(goButton.mas_left); + make.height.mas_offset(17); + }]; + + } + return self; +} + + +- (NetImageConfig *)avatarConfig { + NetImageConfig * config = [[NetImageConfig alloc]init]; + config.imageType = ImageTypeUserIcon; + config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; + return config; +} + +- (NetImageView *)avatar { + if (!_avatar) { + _avatar = [[NetImageView alloc] initWithConfig:[self avatarConfig]]; + _avatar.layer.masksToBounds = YES; + _avatar.layer.cornerRadius = 56/2; + _avatar.layer.borderColor = [UIColor whiteColor].CGColor; + _avatar.layer.borderWidth = 1; + } + return _avatar; +} + +- (NetImageView *)rocket { + if (!_rocket) { + _rocket = [[NetImageView alloc] init]; + + _rocket.backgroundColor = [UIColor purpleColor]; + } + return _rocket; +} + +- (UILabel *)titleLabel { + if (!_titleLabel) { + _titleLabel = [UILabel labelInitWithText:@"" + font:kFontMedium(12) + textColor:[UIColor whiteColor]]; + // 设置文本阴影颜色 + _titleLabel.shadowColor = [UIColor redColor]; + + // 设置阴影的偏移量,(width, height),正值表示向右下偏移,负值表示向左上偏移 + _titleLabel.shadowOffset = CGSizeMake(2, 2); + } + return _titleLabel; +} + +- (UILabel *)contentLabel { + if (!_contentLabel) { + _contentLabel = [UILabel labelInitWithText:@"触发了BOOM,前去围观" + font:kFontMedium(10) + textColor:[UIColor whiteColor]]; + NSAttributedString *as_2 = [[NSAttributedString alloc] initWithString:@"Boom" + attributes:@{NSFontAttributeName: kFontMedium(10), + NSForegroundColorAttributeName: UIColorFromRGB(0xFFE018)}]; + NSAttributedString *as_3 = [[NSAttributedString alloc] initWithString:YMLocalizedString(@"RoomBoom_4") + attributes:@{NSFontAttributeName: kFontMedium(10), + NSForegroundColorAttributeName: [UIColor whiteColor]}]; + NSMutableAttributedString *content = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"RoomBoom_3") attributes:@{NSFontAttributeName: kFontMedium(10), NSForegroundColorAttributeName: [UIColor whiteColor]}]; + [content appendAttributedString:as_2]; + [content appendAttributedString:as_3]; + _contentLabel.attributedText = content; + } + return _contentLabel; +} @end diff --git a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomEntryView.h b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomEntryView.h new file mode 100644 index 00000000..1905cc79 --- /dev/null +++ b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomEntryView.h @@ -0,0 +1,20 @@ +// +// RoomBoomEntryView.h +// YuMi +// +// Created by P on 2024/10/8. +// + +#import + +@class BoomDetailModel; + +NS_ASSUME_NONNULL_BEGIN + +@interface RoomBoomEntryView : UIView + +@property (nonatomic, strong) BoomDetailModel *boomModel; + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomEntryView.m b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomEntryView.m new file mode 100644 index 00000000..29d169da --- /dev/null +++ b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomEntryView.m @@ -0,0 +1,99 @@ +// +// RoomBoomEntryView.m +// YuMi +// +// Created by P on 2024/10/8. +// + +#import "RoomBoomEntryView.h" + +#import "BoomInfoModel.h" + +@interface RoomBoomEntryView() + +@property (nonatomic, strong) NetImageView *icon; +@property (nonatomic, strong) UIImageView *progress; +@property (nonatomic, strong) UIImageView *progressBG; + +@end + +@implementation RoomBoomEntryView + +- (void)setBoomModel:(BoomDetailModel *)boomModel { + _boomModel = boomModel; + @kWeakify(self); + dispatch_async(dispatch_get_main_queue(), ^{ + @kStrongify(self); + self.icon.imageUrl = boomModel.pic; + CGFloat progress = boomModel.speed * 1.0 / 100.0; + if (progress == 0) { + self.progress.hidden = YES; + } else { + self.progress.hidden = NO; + [UIView animateWithDuration:0.3 animations:^{ + [self.progress mas_updateConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(kGetScaleWidth(32) * progress); + }]; + // 强制布局更新以确保约束生效,并在动画期间平滑变化 + [self layoutIfNeeded]; + }]; + } + }); +} + +- (instancetype)init { + if (self = [super init]) { + [self addSubview:self.icon]; + [self.icon mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(self); + make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(40), kGetScaleWidth(40))); + }]; + + [self addSubview:self.progressBG]; + [self.progressBG mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.icon).offset(3); + make.leading.mas_equalTo(self.icon).offset(3); + make.trailing.mas_equalTo(self.icon).offset(-3); + make.height.mas_equalTo(7); + }]; + + [self addSubview:self.progress]; + [self.progress mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.progressBG); + make.leading.mas_equalTo(self.icon).offset(4); + make.width.mas_equalTo(0); + make.height.mas_equalTo(5); + }]; + } + return self; +} + +- (UIImageView *)icon { + if (!_icon) { + _icon = [[NetImageView alloc] init]; + _icon.userInteractionEnabled = YES; + _icon.contentMode = UIViewContentModeScaleAspectFit; + _icon.transform = CGAffineTransformMakeRotation(-M_PI / 6); + } + return _icon; +} + +- (UIImageView *)progress { + if (!_progress) { + UIImage *progressImage = [kImage(@"room_boom_entry_progress_bar") resizableImageWithCapInsets:UIEdgeInsetsMake(0, 3, 0, 3) resizingMode:UIImageResizingModeStretch]; + _progress = [[UIImageView alloc] initWithImage:progressImage]; + _progress.userInteractionEnabled = YES; + _progress.hidden = NO; + } + return _progress; +} + +- (UIImageView *)progressBG { + if (!_progressBG) { + _progressBG = [[UIImageView alloc] initWithImage:kImage(@"room_boom_entry_progress_bar_bg")]; + _progressBG.userInteractionEnabled = YES; + } + return _progressBG; +} + +@end diff --git a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomExplosionView.h b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomExplosionView.h new file mode 100644 index 00000000..365892f2 --- /dev/null +++ b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomExplosionView.h @@ -0,0 +1,32 @@ +// +// RoomBoomProgressView.h +// YuMi +// +// Created by P on 2024/9/27. +// + +#import + +@class AttachmentModel, BoomInfoModel; + +NS_ASSUME_NONNULL_BEGIN + +@interface RoomBoomExplosionView : UIView + ++ (void)display:(UIView *)superView + with:(NSArray *)vapSources + complete:(void(^)(void))complete; + +//+ (void)display:(UIView *)superView +// with:(AttachmentModel *)attachment +// complete:(void(^)(void))complete; +// +//+ (void)displayWhenEnter:(UIView *)superView +// with:(BoomInfoModel *)model +// complete:(void(^)(void))complete; + +- (void)saveCurrenRoomUID:(NSInteger)room; + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomExplosionView.m b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomExplosionView.m new file mode 100644 index 00000000..f8c64469 --- /dev/null +++ b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomExplosionView.m @@ -0,0 +1,211 @@ +// +// RoomBoomProgressView.m +// YuMi +// +// Created by P on 2024/9/27. +// + +#import "RoomBoomExplosionView.h" + +#import +#import "BoomInfoModel.h" +#import "AttachmentModel.h" +#import "RoomBoomManager.h" +#import "XPRoomGiftAnimationParser.h" + +@interface RoomBoomExplosionView() + +@property (nonatomic, strong) VAPView *vapView; +@property (nonatomic, strong) XPRoomGiftAnimationParser *vapParser; +//@property (nonatomic, strong) Boom632Model *model; +//@property (nonatomic, strong) BoomInfoModel *boomInfo; +@property (nonatomic, assign) NSInteger seq; + +@property (nonatomic, copy) NSString *countDownURLString; +@property (nonatomic, copy) NSString *endURLString; + +@property (nonatomic, copy) void(^completeDisplay)(void); + +@end + +@implementation RoomBoomExplosionView + ++ (void)display:(UIView *)superView + with:(NSArray *)vapSources + complete:(void(^)(void))complete { + if (vapSources.count < 2) { + return; + } + + RoomBoomExplosionView *explosionView = [[RoomBoomExplosionView alloc] initWithFrame:CGRectMake(0, 0, superView.bounds.size.width, superView.bounds.size.height)]; + explosionView.userInteractionEnabled = NO; + explosionView.completeDisplay = complete; + [superView addSubview:explosionView]; + explosionView.countDownURLString = [vapSources firstObject]; + explosionView.endURLString = [vapSources lastObject]; + + [explosionView play_count]; +} + +- (void)saveCurrenRoomUID:(NSInteger)room { + +} + +//+ (void)display:(UIView *)superView +// with:(AttachmentModel *)attachment +// complete:(void(^)(void))complete { +// +// if (!attachment) { +// return; +// } +// +// Boom632Model *m = [Boom632Model modelWithJSON:attachment.data]; +// +// RoomBoomExplosionView *explosionView = [[RoomBoomExplosionView alloc] initWithFrame:CGRectMake(0, 0, superView.bounds.size.width, superView.bounds.size.height)]; +// explosionView.userInteractionEnabled = NO; +// explosionView.completeDisplay = complete; +// [superView addSubview:explosionView]; +// explosionView.model = m; +//} +// +//+ (void)displayWhenEnter:(UIView *)superView +// with:(BoomInfoModel *)model +// complete:(void(^)(void))complete { +// if (!model) { +// return; +// } +// +// RoomBoomExplosionView *explosionView = [[RoomBoomExplosionView alloc] initWithFrame:CGRectMake(0, 0, superView.bounds.size.width, superView.bounds.size.height)]; +// explosionView.userInteractionEnabled = NO; +// explosionView.completeDisplay = complete; +// [superView addSubview:explosionView]; +// explosionView.boomInfo = model; +//} + +- (void)dealloc +{ + [self.vapView stopHWDMP4]; + [self.vapView removeFromSuperview]; + self.vapView = nil; +} + +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + + self.seq = 0; + self.backgroundColor = [UIColor colorWithWhite:0.6 alpha:0.3]; + + [self addSubview:self.vapView]; + [self.vapView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self); + }]; + } + return self; +} + +//- (void)setModel:(Boom632Model *)model { +// _model = model; +// self.countDownURLString = model.countDownVapUrl; +// self.endURLString = model.endVapUrl; +// [self play_count]; +//} +// +//- (void)setBoomInfo:(BoomInfoModel *)boomInfo { +// _boomInfo = boomInfo; +//} + +- (void)play_count { + self.seq = 1; + + NSString *path = [self.countDownURLString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if (path.length == 0) { + return; + } + + NSString *encodingUrl = [path stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; + @kWeakify(self); + [self.vapParser parseWithURL:encodingUrl completionBlock:^(NSString * _Nullable videoUrl) { + @kStrongify(self); + if (videoUrl.length) { + [self.vapView setMute:NO]; + [self.vapView playHWDMP4:videoUrl repeatCount:0 delegate:self]; + } + } failureBlock:^(NSError * _Nullable error) { + + }]; +} + +- (void)play_boom { + self.seq = 2; + NSString *path = [self.endURLString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if (path.length == 0) { + return; + } + + NSString *encodingUrl = [path stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; + @kWeakify(self); + [self.vapParser parseWithURL:encodingUrl completionBlock:^(NSString * _Nullable videoUrl) { + @kStrongify(self); + if (videoUrl.length) { + [self.vapView setMute:NO]; + [self.vapView playHWDMP4:videoUrl repeatCount:0 delegate:self]; + } + } failureBlock:^(NSError * _Nullable error) { + + }]; +} + + +#pragma mark - HWDMP4PlayDelegate +//即将开始播放时询问,true马上开始播放,false放弃播放 +- (BOOL)shouldStartPlayMP4:(VAPView *)container config:(QGVAPConfigModel *)config { + return YES; +} + +- (void)viewDidFinishPlayMP4:(NSInteger)totalFrameCount view:(VAPView *)container { + if (self.seq == 1) { + [self play_boom]; + } else if (self.seq == 2) { + self.seq = 0; + @kWeakify(self); + dispatch_async(dispatch_get_main_queue(), ^{ + @kStrongify(self); + [[RoomBoomManager sharedManager] explosionEnd]; + [self removeFromSuperview]; +// if (self.completeDisplay) { +// self.completeDisplay(); +// +// } + }); + } +} + +- (void)viewDidStopPlayMP4:(NSInteger)lastFrameIndex view:(VAPView *)container { + +} +- (void)viewDidFailPlayMP4:(NSError *)error{ + @kWeakify(self); + dispatch_async(dispatch_get_main_queue(), ^{ + @kStrongify(self); + [[RoomBoomManager sharedManager] explosionEnd]; + [self removeFromSuperview]; + }); +} + +#pragma mark - +- (VAPView *)vapView { + if (!_vapView) { + _vapView = [[VAPView alloc] init]; + _vapView.contentMode = UIViewContentModeScaleAspectFill; + } + return _vapView; +} + +- (XPRoomGiftAnimationParser *)vapParser { + if (!_vapParser) { + _vapParser = [[XPRoomGiftAnimationParser alloc] init]; + } + return _vapParser; +} + +@end diff --git a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomManager.h b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomManager.h index be572c01..fffc4b6f 100644 --- a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomManager.h +++ b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomManager.h @@ -7,10 +7,39 @@ #import +@class AttachmentModel, BoomInfoModel, BoomDetailModel; + NS_ASSUME_NONNULL_BEGIN +typedef void(^BoomEventBlock)(id sth); + @interface RoomBoomManager : NSObject ++ (instancetype)sharedManager; + +- (NSArray *)loadBoomDetails; + +- (void)updateBoomDetailArray:(NSArray *)array; +- (void)updateBoomDetail:(BoomDetailModel *)boomDetail; +- (void)cleanBoomDetail; + +/// 视图注册监听对应的火箭事件,通过 block 回调 +- (void)registerBoomBanner:(BoomEventBlock)block target:(id)target; +- (void)registerBoomExplosion:(BoomEventBlock)block target:(id)target; +- (void)registerBoomEnterRoomExplosion:(BoomEventBlock)block target:(id)target; +- (void)registerBoomProgressUpdate:(BoomEventBlock)block target:(id)target; +- (void)registerBoomGiftDisplay:(BoomEventBlock)block target:(id)target; + +- (void)explosionEnd; +- (void)giftDisplayEnd; +- (void)bannerDisplayEnd; + +- (void)removeEventListenerForTarget:(id)target; + +- (void)receiveEnterRoomBoom:(BoomInfoModel *)model; + +- (void)receiveNIMResponse:(AttachmentModel *)attachment; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomManager.m b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomManager.m index b2c283bc..a1690397 100644 --- a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomManager.m +++ b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomManager.m @@ -7,6 +7,337 @@ #import "RoomBoomManager.h" -@implementation RoomBoomManager +#import "BoomInfoModel.h" +#import "AttachmentModel.h" + +@interface RoomBoomManager () + +@property (nonatomic, strong) NSMutableArray *bannerListeners; +@property (nonatomic, strong) NSMutableArray *ExplosionListeners; +@property (nonatomic, strong) NSMutableArray *enterRoomExplosionListeners; +@property (nonatomic, strong) NSMutableArray *progressUpdateListeners; +@property (nonatomic, strong) NSMutableArray *boomGiftsListeners; + +@property (nonatomic, strong) NSMutableArray *boomDetailArray; + +@property (nonatomic, strong) NSMutableArray *boomEventsQueue; +@property (nonatomic, strong) NSMutableArray *giftEventsQueue; +@property (nonatomic, strong) NSMutableArray *bannerEventsQueue; + +@property (nonatomic, assign) BOOL isBooming; +@property (nonatomic, assign) BOOL isGitfing; +@property (nonatomic, assign) BOOL isBannering; + +@end + +@implementation RoomBoomManager + ++ (instancetype)sharedManager { + static RoomBoomManager *instance; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + instance = [[self alloc] init]; + instance.bannerListeners = @[].mutableCopy; + instance.ExplosionListeners = @[].mutableCopy; + instance.enterRoomExplosionListeners = @[].mutableCopy; + instance.progressUpdateListeners = @[].mutableCopy; + instance.boomGiftsListeners = @[].mutableCopy; + + instance.boomDetailArray = @[].mutableCopy; + + instance.boomEventsQueue = @[].mutableCopy; + instance.giftEventsQueue = @[].mutableCopy; + instance.bannerEventsQueue = @[].mutableCopy; + +// [[NIMSDK sharedSDK].chatManager addDelegate:instance]; + [[NIMSDK sharedSDK].broadcastManager addDelegate:instance]; + }); + return instance; +} + +- (void)test { + [self handleBannerUpdate:nil]; + [self handleExplosionUpdate:nil]; +} + +- (NSArray *)loadBoomDetails { + return self.boomDetailArray; +} + +- (void)updateBoomDetailArray:(NSArray *)array { + self.boomDetailArray = array.mutableCopy; +} + +- (void)updateBoomDetail:(BoomDetailModel *)boomDetail { + for (int i = 0; i < self.boomDetailArray.count; i++) { + BoomDetailModel *detail = [self.boomDetailArray xpSafeObjectAtIndex:i]; + if (detail.level == boomDetail.level) { + detail.exp = boomDetail.exp; + detail.speed = boomDetail.speed; + break; + } + } +} + +- (void)cleanBoomDetail { + +} + +- (void)registerBoomBanner:(BoomEventBlock)block target:(id)target { + @synchronized (self.bannerListeners) { + [self.bannerListeners addObject:@{NSStringFromClass([target class]) : block}]; + } +} + +- (void)registerBoomExplosion:(BoomEventBlock)block target:(id)target { + @synchronized (self.ExplosionListeners) { + [self.ExplosionListeners addObject:@{NSStringFromClass([target class]) : block}]; + } +} + +- (void)registerBoomEnterRoomExplosion:(BoomEventBlock)block target:(id)target { + @synchronized (self.enterRoomExplosionListeners) { + [self.enterRoomExplosionListeners addObject:@{NSStringFromClass([target class]) : block}]; + } +} + +- (void)registerBoomProgressUpdate:(BoomEventBlock)block target:(id)target { + @synchronized (self.progressUpdateListeners) { + [self.progressUpdateListeners addObject:@{NSStringFromClass([target class]) : block}]; + } +} + +- (void)registerBoomGiftDisplay:(BoomEventBlock)block target:(id)target { + @synchronized (self.boomGiftsListeners) { + [self.boomGiftsListeners addObject:@{NSStringFromClass([target class]) : block}]; + } +} + +- (void)checkAndStartBoomEvent { + if (self.isBooming) { + return; + } + if (self.boomEventsQueue.count > 0) { + id obj = self.boomEventsQueue.firstObject; + + NSString *url_1 = @""; + NSString *url_2 = @""; + + if ([obj isKindOfClass:[AttachmentModel class]]) { + Boom632Model *m = [Boom632Model modelWithJSON:[(AttachmentModel *)obj data]]; + url_1 = m.countDownVapUrl; + url_2 = m.endVapUrl; + } else if ([obj isKindOfClass:[RoomBoomSignVo class]]) { + url_1 = [(RoomBoomSignVo *)obj countDownVapUrl]; + url_1 = [(RoomBoomSignVo *)obj endVapUrl]; + } + + if (url_1.length > 0 && url_2.length > 0) { + self.isBooming = YES; + [self handleExplosionUpdate:@[url_1, url_2]]; + } + + [self.boomEventsQueue removeObjectAtIndex:0]; + } +} + +- (void)checkAndStartBannerEvent { + if (self.isBannering) { + return; + } + if (self.bannerEventsQueue.count > 0) { + self.isBannering = YES; + id obj = self.bannerEventsQueue.firstObject; + [self handleBannerUpdate:obj]; + [self.bannerEventsQueue removeObjectAtIndex:0]; + } +} + +- (void)explosionEnd { + self.isBooming = NO; + if (self.giftEventsQueue.count > 0) { + id obj = self.giftEventsQueue.firstObject; + [self handleBoomGiftUpdate:obj]; + [self.giftEventsQueue removeObjectAtIndex:0]; + } else { + [self checkAndStartBoomEvent]; + } +} + +- (void)giftDisplayEnd { + [self checkAndStartBoomEvent]; +} + +- (void)bannerDisplayEnd { + self.isBannering = NO; + [self checkAndStartBannerEvent]; +} + +- (void)removeEventListenerForTarget:(id)target { + @synchronized (self.progressUpdateListeners) { + NSString *key = NSStringFromClass([target class]); + + for (NSDictionary *dic in self.progressUpdateListeners) { + if ([[dic allKeys] containsObject:key]) { + [self.progressUpdateListeners removeObject:dic]; + break; + } + } + } + + @synchronized (self.ExplosionListeners) { + NSString *key = NSStringFromClass([target class]); + + for (NSDictionary *dic in self.ExplosionListeners) { + if ([[dic allKeys] containsObject:key]) { + [self.ExplosionListeners removeObject:dic]; + break; + } + } + } + + @synchronized (self.bannerListeners) { + NSString *key = NSStringFromClass([target class]); + + for (NSDictionary *dic in self.bannerListeners) { + if ([[dic allKeys] containsObject:key]) { + [self.bannerListeners removeObject:dic]; + break; + } + } + } + + @synchronized (self.boomGiftsListeners) { + NSString *key = NSStringFromClass([target class]); + + for (NSDictionary *dic in self.boomGiftsListeners) { + if ([[dic allKeys] containsObject:key]) { + [self.boomGiftsListeners removeObject:dic]; + break; + } + } + } + + @synchronized (self.enterRoomExplosionListeners) { + NSString *key = NSStringFromClass([target class]); + + for (NSDictionary *dic in self.enterRoomExplosionListeners) { + if ([[dic allKeys] containsObject:key]) { + [self.enterRoomExplosionListeners removeObject:dic]; + break; + } + } + } +} + +- (void)receiveEnterRoomBoom:(BoomInfoModel *)model { + [self.boomEventsQueue addObjectsFromArray:model.roomBoomSignVoList]; + [self checkAndStartBoomEvent]; +} + +- (void)receiveNIMResponse:(AttachmentModel *)attachment { + // TODO: 增加隊列處理 + switch (attachment.second) { + case Custom_Message_Room_Boom_EXP: { + NSLog(@" -------- 631 : %@", attachment.data); + BoomDetailModel *boomDetail = [BoomDetailModel modelWithJSON:attachment.data]; + [self handleProgressUpdate:boomDetail]; + } + break; + case Custom_Message_Room_Boom_LevelUp: { + NSLog(@" 火箭 -------- 632 : %@", attachment.data); + [self.boomEventsQueue addObject:attachment]; +// [self handleExplosionUpdate:attachment]; +// [self handleBannerUpdate:attachment]; + [self.bannerEventsQueue addObject:attachment]; + + [self checkAndStartBoomEvent]; + [self checkAndStartBannerEvent]; + } + break; + case Custom_Message_Room_Boom_Award: + NSLog(@" 火箭 -------- 633 : %@", attachment.data); + [self.giftEventsQueue addObject:attachment]; +// [self handleBoomGiftUpdate:attachment]; + break; + default: + break; + } +} + +- (void)handleProgressUpdate:(BoomDetailModel *)model { + [self updateBoomDetail:model]; + + @synchronized (self.progressUpdateListeners) { + for (NSDictionary *dic in self.progressUpdateListeners) { + BoomEventBlock listener = [dic allValues].firstObject; + if (listener) { + listener(model); + } + } + } +} + +- (void)handleExplosionUpdate:(id)model { + @synchronized (self.ExplosionListeners) { + for (NSDictionary *dic in self.ExplosionListeners) { + BoomEventBlock listener = [dic allValues].firstObject; + if (listener) { + listener(model); + } + } + } +} + +- (void)handleBannerUpdate:(id)model { + @synchronized (self.bannerListeners) { + for (NSDictionary *dic in self.bannerListeners) { + BoomEventBlock listener = [dic allValues].firstObject; + if (listener) { + listener(model); + } + } + } +} + +- (void)handleBoomGiftUpdate:(id)model { + @synchronized (self.boomGiftsListeners) { + for (NSDictionary *dic in self.boomGiftsListeners) { + BoomEventBlock listener = [dic allValues].firstObject; + if (listener) { + listener(model); + } + } + } +} + +#pragma mark - +- (void)onRecvMessages:(NSArray *)messages +{ +// for (NIMMessage * message in messages) { +// if (message.messageType == NIMMessageTypeCustom) { +// NIMCustomObject *obj = (NIMCustomObject *)message.messageObject; +// if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) { +// AttachmentModel * attachment = (AttachmentModel *)obj.attachment; +// if (attachment.first == CustomMessageType_RoomBoom) { +// [self receiveNIMResponse:attachment]; +// } +// } +// } +// } +} + +- (void)onReceiveBroadcastMessage:(NIMBroadcastMessage *)broadcastMessage { + if ([AccountInfoStorage instance].getUid.length == 0) { + return; + } + if (broadcastMessage.content) { + NSDictionary *msgDictionary = [broadcastMessage.content toJSONObject]; + AttachmentModel *attachment = [AttachmentModel modelWithJSON:msgDictionary[@"body"]]; + if (attachment.first == CustomMessageType_RoomBoom) { + [self receiveNIMResponse:attachment]; + } + } +} @end diff --git a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomProgressView.h b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomProgressView.h deleted file mode 100644 index 4e3156d6..00000000 --- a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomProgressView.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// RoomBoomProgressView.h -// YuMi -// -// Created by P on 2024/9/27. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface RoomBoomProgressView : UIView - -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomProgressView.m b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomProgressView.m deleted file mode 100644 index eb453d80..00000000 --- a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomProgressView.m +++ /dev/null @@ -1,20 +0,0 @@ -// -// RoomBoomProgressView.m -// YuMi -// -// Created by P on 2024/9/27. -// - -#import "RoomBoomProgressView.h" - -@implementation RoomBoomProgressView - -/* -// Only override drawRect: if you perform custom drawing. -// An empty implementation adversely affects performance during animation. -- (void)drawRect:(CGRect)rect { - // Drawing code -} -*/ - -@end diff --git a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomResultView.h b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomResultView.h index 9a4cfcc6..896e44b1 100644 --- a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomResultView.h +++ b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomResultView.h @@ -11,6 +11,11 @@ NS_ASSUME_NONNULL_BEGIN @interface RoomBoomResultView : UIView ++ (void)displayEmptyView:(UIView *)superView; + ++ (void)display:(UIView *)superView gifts:(NSArray *)giftsArray; + + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomResultView.m b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomResultView.m index 09830fda..4cb18550 100644 --- a/YuMi/Modules/YMRoom/Features/Boom/RoomBoomResultView.m +++ b/YuMi/Modules/YMRoom/Features/Boom/RoomBoomResultView.m @@ -7,14 +7,232 @@ #import "RoomBoomResultView.h" -@implementation RoomBoomResultView +@interface RoomBoomResultCollectionViewCell : UICollectionViewCell + +@property (nonatomic, strong) NetImageView *giftPic; + +@end + +@implementation RoomBoomResultCollectionViewCell + +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + self.backgroundColor = [UIColor clearColor]; + self.contentView.backgroundColor = [UIColor clearColor]; + + UIImageView *bg = [self bgView]; + [self.contentView addSubview:bg]; + [bg mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.contentView); + }]; + + [self.contentView addSubview:self.giftPic]; + [self.giftPic mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(bg).insets(UIEdgeInsetsMake(10, 10, 10, 10)); + }]; + } + return self; +} + +- (UIImageView *)bgView { + UIImageView *bg = [[UIImageView alloc] initWithImage:kImage(@"room_boom_result_gift_cell_bg")]; + return bg; +} + +- (NetImageView *)giftPic { + if (!_giftPic) { + _giftPic = [[NetImageView alloc] init]; + } + return _giftPic; +} + +@end + +@interface RoomBoomResultView() + +@property (nonatomic, strong) UIImageView *backgroundImageView; +@property (nonatomic, strong) UILabel *contentLabel; +@property (nonatomic, strong) UIButton *bottomButton; +@property (nonatomic, strong) UICollectionView *giftsCollectionView; + +@end + +@implementation RoomBoomResultView + ++ (void)displayEmptyView:(UIView *)superView { + RoomBoomResultView *resultView = [[RoomBoomResultView alloc] init]; + resultView.alpha = 0; + [superView addSubview:resultView]; + [resultView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(kGetScaleWidth(190)); + make.leading.mas_equalTo(10); + make.trailing.mas_equalTo(-10); + make.height.mas_equalTo(kGetScaleWidth(198)); + }]; + + [resultView setupForEmpty]; + + [UIView animateWithDuration:0.2 animations:^{ + resultView.alpha = 1; + }]; +} + ++ (void)display:(UIView *)superView gifts:(NSArray *)giftsArray { + RoomBoomResultView *resultView = [[RoomBoomResultView alloc] init]; + resultView.alpha = 0; + [superView addSubview:resultView]; + [resultView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(kGetScaleWidth(190)); + make.leading.mas_equalTo(10); + make.trailing.mas_equalTo(-10); + make.height.mas_equalTo(kGetScaleWidth(394)); + }]; + + [resultView setupFroGifts:giftsArray.count]; + + [UIView animateWithDuration:0.2 animations:^{ + resultView.alpha = 1; + }]; +} + +- (instancetype)init { + if (self = [super init]) {} + return self; +} + +- (void)setupForEmpty { + self.backgroundImageView.image = kImage(@"room_boom_empty_result_bg"); + [self addSubview:self.backgroundImageView]; + [self.backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self); + }]; + + self.contentLabel.text = YMLocalizedString(@"RoomBoom_0"); + [self addSubview:self.contentLabel]; + [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self).offset(kGetScaleWidth(68)); + make.leading.mas_equalTo(24); + make.trailing.mas_equalTo(-24); + }]; + + [self.bottomButton setTitle:@"OK" forState:UIControlStateNormal]; + [self.bottomButton setBackgroundImage:kImage(@"room_boom_result_button_bg_1") forState:UIControlStateNormal]; + [self addSubview:self.bottomButton]; + [self.bottomButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self).offset(kGetScaleWidth(-24)); + make.centerX.mas_equalTo(self); + make.size.mas_equalTo(CGSizeMake(176, 44)); + }]; +} + +- (void)setupFroGifts:(NSInteger)giftsCount { + self.backgroundImageView.image = kImage(@"room_boom_gifts_result_bg"); + [self addSubview:self.backgroundImageView]; + [self.backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self); + }]; + + UIImageView *topContentImageView = [[UIImageView alloc] initWithImage:kImage(@"room_boom_result_top_bg")]; + [self addSubview:topContentImageView]; + [topContentImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.backgroundImageView.mas_top); + make.centerX.mas_equalTo(self.backgroundImageView); + make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(214.5), kGetScaleWidth(52.5))); + }]; + + UILabel *topContentLabel = [UILabel labelInitWithText:YMLocalizedString(@"Combo_6") font:kFontMedium(17.5) textColor:UIColorFromRGB(0xF0E7BA)]; + [self addSubview:topContentLabel]; + [topContentLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(topContentImageView); + }]; + + self.contentLabel.text = YMLocalizedString(@"RoomBoom_1"); + self.contentLabel.font = kFontRegular(10); + [self addSubview:self.contentLabel]; + [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(topContentImageView.mas_bottom).offset(kGetScaleWidth(14)); + make.leading.mas_equalTo(50); + make.trailing.mas_equalTo(-50); + }]; + + [self.bottomButton setTitle:@"GREAT" forState:UIControlStateNormal]; + [self.bottomButton setBackgroundImage:kImage(@"room_boom_result_button_bg_1") forState:UIControlStateNormal]; + [self addSubview:self.bottomButton]; + [self.bottomButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self).offset(kGetScaleWidth(-26)); + make.centerX.mas_equalTo(self); + make.size.mas_equalTo(CGSizeMake(176, 44)); + }]; + + [self addSubview:self.giftsCollectionView]; + [self.giftsCollectionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.contentLabel.mas_bottom).offset(16); + make.leading.mas_equalTo(kGetScaleWidth(35)); + make.trailing.mas_equalTo(kGetScaleWidth(-35)); + make.bottom.mas_equalTo(self.bottomButton.mas_top).offset(kGetScaleWidth(-30)); + }]; +} + +- (void)didTapBottomButton { + [self removeFromSuperview]; +} + +#pragma mark - UICollectionView delegate & datasource +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + return arc4random()%30; +} + +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + RoomBoomResultCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"GiftCell" forIndexPath:indexPath]; + return cell; +} + +#pragma mark - +- (UIImageView *)backgroundImageView { + if (!_backgroundImageView) { + _backgroundImageView = [[UIImageView alloc] init]; + _backgroundImageView.contentMode = UIViewContentModeScaleAspectFill; + } + return _backgroundImageView; +} + +- (UILabel *)contentLabel { + if (!_contentLabel) { + _contentLabel = [UILabel labelInitWithText:@"" font:kFontRegular(12) textColor:UIColorFromRGB(0xCBA1FF)]; + _contentLabel.textAlignment = NSTextAlignmentCenter; + _contentLabel.numberOfLines = 0; + } + return _contentLabel; +} + +- (UIButton *)bottomButton { + if (!_bottomButton) { + _bottomButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_bottomButton.titleLabel setFont:kFontMedium(15)]; + [_bottomButton addTarget:self action:@selector(didTapBottomButton) forControlEvents:UIControlEventTouchUpInside]; + } + return _bottomButton; +} + +- (UICollectionView *)giftsCollectionView { + if (!_giftsCollectionView) { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.itemSize = CGSizeMake(kGetScaleWidth(88), kGetScaleWidth(88)); // 设置每个item的大小 + layout.minimumLineSpacing = 20; // 行间距 + layout.minimumInteritemSpacing = 11.5; // 列间距 + layout.scrollDirection = UICollectionViewScrollDirectionVertical; // 垂直滚动 +// layout.sectionInset = UIEdgeInsetsMake(10, 10, 10, 10); // 设置边距 + + _giftsCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero + collectionViewLayout:layout]; + _giftsCollectionView.dataSource = self; + _giftsCollectionView.delegate = self; + _giftsCollectionView.showsVerticalScrollIndicator = NO; + _giftsCollectionView.backgroundColor = [UIColor clearColor]; + [_giftsCollectionView registerClass:[RoomBoomResultCollectionViewCell class] forCellWithReuseIdentifier:@"GiftCell"]; + } + return _giftsCollectionView; +} -/* -// Only override drawRect: if you perform custom drawing. -// An empty implementation adversely affects performance during animation. -- (void)drawRect:(CGRect)rect { - // Drawing code -} -*/ @end diff --git a/YuMi/Modules/YMRoom/Model/BoomInfoModel.h b/YuMi/Modules/YMRoom/Model/BoomInfoModel.h index e2dc13b3..2004d146 100644 --- a/YuMi/Modules/YMRoom/Model/BoomInfoModel.h +++ b/YuMi/Modules/YMRoom/Model/BoomInfoModel.h @@ -9,8 +9,88 @@ NS_ASSUME_NONNULL_BEGIN +@interface RoomBoomSignVo : PIBaseModel + +@property (nonatomic, assign) NSInteger drawTime; +@property (nonatomic, copy) NSString *vapUrl; +@property (nonatomic, copy) NSString *pic; +@property (nonatomic, copy) NSString *countDownVapUrl; +@property (nonatomic, copy) NSString *endVapUrl; +@property (nonatomic, assign) NSInteger level; + +@end + @interface BoomInfoModel : PIBaseModel +@property (nonatomic, assign) NSInteger exp; +@property (nonatomic, assign) NSInteger level; +@property (nonatomic, assign) NSInteger goldNum; +@property (nonatomic, assign) NSInteger speed; +@property (nonatomic, copy) NSString *vapUrl; +@property (nonatomic, copy) NSString *pic; +@property (nonatomic, copy) NSArray *roomBoomSignVoList; + +@end + + +@interface roomBoomLevelAwardVo : PIBaseModel +@property (nonatomic, copy) NSString *awardName; +@property (nonatomic, copy) NSString *awardPic; +@property (nonatomic, assign) NSInteger awardType; +@property (nonatomic, assign) NSInteger isShow; +@property (nonatomic, assign) NSInteger seq; +@end + +@interface roomBoomRankVo : PIBaseModel +@property (nonatomic, copy) NSString *avatar; +@property (nonatomic, copy) NSString *nick; +@property (nonatomic, assign) NSInteger exper; +@property (nonatomic, assign) NSInteger position; +@property (nonatomic, assign) NSInteger uid; +@end + +@interface BoomDetailModel : PIBaseModel + +@property (nonatomic, copy) NSString *countDownVapUrl; +@property (nonatomic, assign) NSInteger currLevel; +@property (nonatomic, copy) NSString *endVapUrl; +@property (nonatomic, assign) NSInteger exp; +@property (nonatomic, assign) NSInteger goldNum; +@property (nonatomic, assign) NSInteger hot; +@property (nonatomic, assign) NSInteger level; +@property (nonatomic, copy) NSString *pic; +@property (nonatomic, assign) NSInteger rank; +@property (nonatomic, copy) NSArray *roomBoomRankVos; +@property (nonatomic, copy) NSArray *roomBoomLevelAwardVos; +@property (nonatomic, assign) NSInteger speed; +@property (nonatomic, copy) NSString *vapUrl; +@property (nonatomic, assign) NSTimeInterval messTime; + +@end + +@interface Boom632Model : PIBaseModel + +@property (nonatomic, assign) NSInteger status; +@property (nonatomic, assign) NSInteger notifyStaySecond; +@property (nonatomic, copy) NSString *floatingScreenPic; +@property (nonatomic, copy) NSString *countDownVapUrl; +@property (nonatomic, assign) NSInteger erbanNo; +@property (nonatomic, copy) NSString *roomTitle; +@property (nonatomic, copy) NSString *endVapUrl; +@property (nonatomic, assign) NSInteger partitionId; +@property (nonatomic, copy) NSString *roomAvatar; +@property (nonatomic, assign) NSTimeInterval drawTime; +@property (nonatomic, assign) NSInteger id; +@property (nonatomic, copy) NSString *vapUrl; +@property (nonatomic, assign) NSInteger level; +@property (nonatomic, assign) NSInteger uid; +@property (nonatomic, copy) NSString *pic; +@property (nonatomic, assign) NSTimeInterval drawTimeLong; +@property (nonatomic, copy) NSString *nick; +@property (nonatomic, copy) NSString *avatar; +@property (nonatomic, assign) NSInteger roomUid; +@property (nonatomic, copy) NSString *targetIcon; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/Model/BoomInfoModel.m b/YuMi/Modules/YMRoom/Model/BoomInfoModel.m index aa27cd0d..eb33f343 100644 --- a/YuMi/Modules/YMRoom/Model/BoomInfoModel.m +++ b/YuMi/Modules/YMRoom/Model/BoomInfoModel.m @@ -7,6 +7,43 @@ #import "BoomInfoModel.h" -@implementation BoomInfoModel +@implementation RoomBoomSignVo + + +@end + +@implementation BoomInfoModel + ++ (NSDictionary *)objectClassInArray { + return @{ + @"roomBoomSignVoList":RoomBoomSignVo.class + }; +} + +@end + +@implementation roomBoomLevelAwardVo + +@end + +@implementation roomBoomRankVo + + +@end + +@implementation BoomDetailModel + ++ (NSDictionary *)objectClassInArray { + return @{ + @"roomBoomRankVos":roomBoomRankVo.class, + @"roomBoomLevelAwardVos":roomBoomLevelAwardVo.class + }; +} + +@end + +@implementation Boom632Model + + @end diff --git a/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.h b/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.h index 7f13faa6..7f5e375f 100644 --- a/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.h +++ b/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.h @@ -78,6 +78,13 @@ NS_ASSUME_NONNULL_BEGIN ///得到踢人名单 /// @param roomUid 房间id -(void)getKickUserListWithRoomUid:(NSString *)roomUid; + + +// TODO: 转移到 Manager 管理逻辑 +- (void)getBoomRocketAnimationInfo:(NSString *)roomUid; + +- (void)getBoomDetail:(NSString *)roomUid; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.m b/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.m index 9d9cd514..eea81dd5 100644 --- a/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.m +++ b/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.m @@ -10,6 +10,7 @@ ///API #import "Api+Room.h" #import "Api+Gift.h" +#import "Api+Boom.h" #import "UserInfoModel.h" #import "GuildSuperAdminInfoModel.h" ///Tool @@ -24,6 +25,7 @@ #import "XPRedPacketModel.h" #import "FirstChargeRoomWindowModel.h" #import "XPFreeGiftModel.h" +#import "BoomInfoModel.h" ///P #import "XPRoomProtocol.h" @@ -320,4 +322,34 @@ } fail:^(NSInteger code, NSString * _Nullable msg) { } showLoading:NO errorToast:NO] roomUid:roomUid]; } + +- (void)getBoomRocketAnimationInfo:(NSString *)roomUid { + @kWeakify(self); + [Api getBoomRocketAnimationInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + @kStrongify(self); + BoomInfoModel *model = [BoomInfoModel modelWithJSON:data.data]; + [[self getView] getRoomBoomExplosionSuccess:model]; + } + fail:^(NSInteger code, NSString * _Nullable msg) { + + } + showLoading:NO] + roomUid:roomUid]; +} + + +- (void)getBoomDetail:(NSString *)roomUid { + @kWeakify(self); + [Api getBoomDetailInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + @kStrongify(self); + NSArray *array = [BoomDetailModel modelsWithArray:data.data]; + [[self getView] getRoomBoomInfoSuccess:array]; + } + fail:^(NSInteger code, NSString * _Nullable msg) { + + } + showLoading:NO] + roomUid:roomUid]; +} + @end diff --git a/YuMi/Modules/YMRoom/Protocol/XPRoomProtocol.h b/YuMi/Modules/YMRoom/Protocol/XPRoomProtocol.h index 757d41f1..dffcd73f 100644 --- a/YuMi/Modules/YMRoom/Protocol/XPRoomProtocol.h +++ b/YuMi/Modules/YMRoom/Protocol/XPRoomProtocol.h @@ -9,8 +9,8 @@ NS_ASSUME_NONNULL_BEGIN -@class RoomInfoModel; -@class UserInfoModel, NIMChatroom, FirstChargeRoomWindowModel,XPRedPacketModel; + +@class RoomInfoModel, UserInfoModel, NIMChatroom, FirstChargeRoomWindowModel, XPRedPacketModel, BoomInfoModel, BoomDetailModel; @protocol XPRoomProtocol @@ -41,6 +41,9 @@ NS_ASSUME_NONNULL_BEGIN -(void)getUnlockRoomAlbumPhotoListSuccessWithList:(NSArray *)list; ///获取踢人房间列表 -(void)getKickUserListSuccessWithList:(NSArray *)list; + +- (void)getRoomBoomInfoSuccess:(NSArray *)models; +- (void)getRoomBoomExplosionSuccess:(BoomInfoModel *)model; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.h b/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.h index fae724b0..37a8f902 100644 --- a/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.h +++ b/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.h @@ -13,6 +13,8 @@ #import "ActivityInfoModel.h" #import "LittleGameInfoModel.h" +@class BoomDetailModel; + typedef void(^OpenRedPacketHandle)(XPRedPacketModel *_Nullable,RoomType type ,BOOL isChangeRoom); NS_ASSUME_NONNULL_BEGIN @@ -24,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic,strong) NSMutableArray *littleGameList; - (instancetype)initWithDelegate:(id)delegate; - (void)updateView; +- (void)updateForBoomDetailArray:(NSArray *)models; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m b/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m index 2dbcdb78..8fcb27da 100644 --- a/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m +++ b/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m @@ -47,8 +47,11 @@ #import "MSRoomMenuGameVC.h" #import "BoomInfoModel.h" +#import "RoomBoomManager.h" +#import "RoomBoomEntryView.h" #import "BoomInfoViewController.h" + UIKIT_EXTERN NSString *kShowFirstRechargeView; @interface XPRoomActivityContainerView () ///容器 @@ -72,8 +75,9 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; ///是否加载了活动 @property (nonatomic,assign) BOOL isLoadActivity; -@property (nonatomic, strong) UIView *boomView; -@property (nonatomic, strong) BoomInfoModel *boomModel; +@property (nonatomic, strong) RoomBoomEntryView *boomView; +@property (nonatomic, copy) NSArray *boomModels; +@property (nonatomic, strong) BoomDetailModel *currentLevelBoomModel; @property (nonatomic, strong) NetImageView *loader_url_1; @property (nonatomic, strong) NetImageView *loader_url_2; @@ -83,13 +87,17 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; @implementation XPRoomActivityContainerView -(void)dealloc{ [[NSNotificationCenter defaultCenter]removeObserver:self]; + [[RoomBoomManager sharedManager] removeEventListenerForTarget:self]; } + - (instancetype)initWithDelegate:(id)delegate { self = [super init]; if (self) { self.hostDelegate = delegate; [self initSubViews]; [self initSubViewConstraints]; + + [self setupBoomManager]; } return self; } @@ -102,13 +110,31 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; } } -- (void)updateForBoom:(BoomInfoModel *)model { - _boomModel = model; - if (model) { - self.boomView.hidden = NO; +- (void)updateForBoomDetailArray:(NSArray *)models { + _boomModels = models; + + self.boomView.hidden = NO; + if (models) { + for (BoomDetailModel *boom in models) { + if (boom.currLevel == 1) { + self.boomView.boomModel = boom; + self.boomView.hidden = NO; + break; + } + } } } +- (void)setupBoomManager { + @kWeakify(self); + [[RoomBoomManager sharedManager] registerBoomProgressUpdate:^(id _Nonnull sth) { + @kStrongify(self); + if ([sth isKindOfClass:[BoomDetailModel class]]) { + self.boomView.boomModel = (BoomDetailModel *)sth; + } + } target:self]; +} + #pragma mark - Private Method - (void)initSubViews { [self addSubview:self.stackView]; @@ -614,7 +640,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; } - (void)displayBoomInfoProgress { - BoomInfoViewController *vc = [BoomInfoViewController vcFromBoomProgress:self.boomModel]; + BoomInfoViewController *vc = [[BoomInfoViewController alloc] init]; vc.modalPresentationStyle = UIModalPresentationOverFullScreen; [self.hostDelegate.getCurrentNav presentViewController:vc animated:YES completion:nil]; } @@ -822,12 +848,11 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; return _pkMenuButton; } -- (UIView *)boomView { +- (RoomBoomEntryView *)boomView { if (!_boomView) { - _boomView = [[UIView alloc] init]; + _boomView = [[RoomBoomEntryView alloc] init]; _boomView.hidden = YES; _boomView.userInteractionEnabled = YES; - _boomView.backgroundColor = [UIColor systemYellowColor]; UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(displayBoomInfoProgress)]; [_boomView addGestureRecognizer:tap]; } diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m index 3d7d52b1..31311067 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m @@ -2881,10 +2881,6 @@ HWDMP4PlayDelegate> return _giftVisibleArray; } - - - - - (NSMutableArray *)carEffectQueue { if (_carEffectQueue == nil) { _carEffectQueue = [NSMutableArray array]; diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m index cb9b2da8..d5c54d62 100644 --- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m +++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m @@ -22,7 +22,6 @@ #import "StatisticsServiceHelper.h" #import "NSArray+Safe.h" #import "NSMutableDictionary+Saft.h" -#import "XPSkillCardPlayerManager.h" #import "XCCurrentVCStackManager.h" #import "CountDownHelper.h" ///Model @@ -64,7 +63,6 @@ #import "XPWebViewController.h" #import "SessionViewController.h" #import "XPFreeGiftsObtainView.h" -#import "MSRoomMenuGameVC.h" ///P #import "XPRoomPresenter.h" @@ -86,6 +84,11 @@ #import "GiftComboManager.h" #import "LuckyGiftWinningFlagView.h" +#import "RoomBoomResultView.h" +#import "RoomBoomManager.h" +#import "RoomBoomExplosionView.h" +#import "RoomBoomResultView.h" + UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; UIKIT_EXTERN NSString * const kRoomMiniNotificationKey; UIKIT_EXTERN NSString * kNewUserRechargeKey; @@ -94,7 +97,22 @@ UIKIT_EXTERN NSString * const kFreeGiftCountdownNotification; NSString * const kHadShowAnchorRoomTipKey = @"kHadShowAnchorRoomTipKey";//是否展示过个播房上划用户引导 NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出过非自己房间 -@interface XPRoomViewController () +@interface XPRoomViewController ()< +XPRoomProtocol, +RoomHostDelegate, +NIMChatroomManagerDelegate, +NIMChatManagerDelegate, +NIMConversationManagerDelegate, +NIMLoginManagerDelegate, +XPRoomSettingInputViewDelegate, +AnchorRoomScrollViewDelegate, +XPFirstRechargeViewDelegate, +NIMBroadcastManagerDelegate, +XPRoomLittleGameContainerViewDelegate, +CountDownHelperDelegate, +PIRoomEnterRedPacketViewDelegate, +XPReceiveRedPacketViewDelegate, +XPCandyTreeInsufficientBalanceViewDelegate> { NSTimer * timer; } @@ -191,7 +209,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [viewController presentViewController:baseNav animated:YES completion:nil]; return YES; } -+ (BOOL) openRoom:(NSString*)roomUid fromNick:(NSString * __nullable)fromNick fromType:(UserEnterRoomFromType)fromType fromUid:(NSString * __nullable)fromUid viewController:(UIViewController*)viewController { ++ (BOOL)openRoom:(NSString*)roomUid fromNick:(NSString * __nullable)fromNick fromType:(UserEnterRoomFromType)fromType fromUid:(NSString * __nullable)fromUid viewController:(UIViewController*)viewController { XPRoomViewController * roomVC = [[self alloc] init]; roomVC.roomUid = roomUid; roomVC.fromUid = fromUid; @@ -267,15 +285,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [timer fire]; timer = nil; } - - [XPSkillCardPlayerManager shareInstance].photoIdList = nil; - [XPSkillCardPlayerManager shareInstance].isInRoomVC = NO; - [XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge = NO; - [XPSkillCardPlayerManager shareInstance].isInRoom = NO; - [XPSkillCardPlayerManager shareInstance].roomUid = @""; - if([[XPRoomMiniManager shareManager] getRoomInfo]==nil){ - [XPSkillCardPlayerManager shareInstance].isMineInMic = NO; - } + [[CountDownHelper shareHelper] stopCountDown]; [CountDownHelper shareHelper].delegate = nil; [[NIMSDK sharedSDK].chatroomManager removeDelegate:self]; @@ -284,6 +294,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [[NIMSDK sharedSDK].conversationManager removeDelegate:self]; [[NIMSDK sharedSDK].broadcastManager removeDelegate:self]; + [[RoomBoomManager sharedManager] removeEventListenerForTarget:self]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; } @@ -298,10 +310,10 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 - (void)viewDidLoad { [super viewDidLoad]; - [self preLoadGifts]; - [self exitOldRoom]; + [self preLoadGifts]; + [self initSubViews]; [self initSubViewConstraints]; @@ -319,14 +331,59 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self startCheckOnlineCountTimer]; [CountDownHelper shareHelper].delegate = self; - [XPSkillCardPlayerManager shareInstance].isInRoom = YES; + + [self setupFroBoom]; + + +//#if DEBUG +// UIButton *b = [UIButton buttonWithType:UIButtonTypeInfoLight]; +// b.frame = CGRectMake(100, 100, 100, 100); +// [self.view addSubview:b]; +// [b addTarget:self action:@selector(test) forControlEvents:UIControlEventTouchUpInside]; +//#endif } +- (void)setupFroBoom { + @kWeakify(self); + [[RoomBoomManager sharedManager] registerBoomExplosion:^(id _Nonnull sth) { + @kStrongify(self); + dispatch_async(dispatch_get_main_queue(), ^{ + [RoomBoomExplosionView display:self.view with:sth complete:^{ + + }]; + }); + } target:self]; + + [[RoomBoomManager sharedManager] registerBoomGiftDisplay:^(id _Nonnull sth) { + @kStrongify(self); + dispatch_async(dispatch_get_main_queue(), ^{ + [RoomBoomResultView displayEmptyView:self.view]; + }); + } target:self]; + + [[RoomBoomManager sharedManager] registerBoomEnterRoomExplosion:^(id _Nonnull sth) { + @kStrongify(self); + dispatch_async(dispatch_get_main_queue(), ^{ + [RoomBoomExplosionView display:self.view with:sth complete:^{ + + }]; + }); + } target:self]; +} + +//- (void)test { +// +//} + - (void)loadRoomDataAndUsers { [XNDJTDDLoadingTool showAnchorLoading:self.navigationController.view]; [self.presenter initEnterRoom:self.roomUid user:[AccountInfoStorage instance].getUid]; } +- (void)loadRoomBoom { +// [self.presenter getBoomInfo:s]; +} + - (void)setupNotifications { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myGiftEffectUpdate:) name:kRoomGiftEffectUpdateNotificationKey object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showRoomFirstChargeWindowFormNot:) name:kShowFirstRechargeView object:nil]; @@ -424,13 +481,11 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 - (void)viewDidDisappear:(BOOL)animated{ [super viewDidDisappear:animated]; self.navigationController.interactivePopGestureRecognizer.enabled = YES; - [XPSkillCardPlayerManager shareInstance].isInRoomVC = NO; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; self.freeView.hidden = NO; self.navigationController.interactivePopGestureRecognizer.enabled = NO; - [XPSkillCardPlayerManager shareInstance].isInRoomVC = YES; } #pragma mark - Private Method @@ -1220,8 +1275,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 - (void)initEnterRoomSuccess:(RoomInfoModel *)roomInfo user:(UserInfoModel *)userInfo { [XNDJTDDLoadingTool hideHUDInView:self.navigationController.view]; - [XPSkillCardPlayerManager shareInstance].roomUid = @(roomInfo.uid).stringValue; - userInfo.fromUid = self.fromUid; userInfo.fromType = self.fromType; userInfo.fromNick = self.fromNick; @@ -1230,6 +1283,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 self.roomInfo = roomInfo; self.userInfo = userInfo; + [self.presenter getBoomRocketAnimationInfo:@(roomInfo.uid).stringValue]; + [self.presenter getBoomDetail:@(roomInfo.uid).stringValue]; @kWeakify(self); dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{ @@ -1625,7 +1680,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 continue; } - NSLog(@" --- Message Raw Attach Content: %@", message.rawAttachContent); + NSLog(@" --- Message Raw Attach Content: %@, %ld", message.rawAttachContent, (long)message.messageType); if (message.messageType == NIMMessageTypeNotification) { NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject; @@ -1763,13 +1818,11 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.menuContainerView handleNIMNotificationMessage:message]; [self.functionView handleNIMNotificationMessage:message]; [self.littleGameView handleNIMNotificationMessage:message]; - if([self.stageView findMicroViewByUid:@(self.userInfo.uid).stringValue] != nil){ - [XPSkillCardPlayerManager shareInstance].isMineInMic = YES; - }else{ - [XPSkillCardPlayerManager shareInstance].isMineInMic = NO; - }; } else if (message.messageType == NIMMessageTypeCustom) { NIMCustomObject *obj = (NIMCustomObject *)message.messageObject; + +633 attachment 為 nil ,確認 data 內的數據格式是否符合? + if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) { AttachmentModel * attachment = (AttachmentModel *)obj.attachment; [self.stageView handleNIMCustomMessage:message]; @@ -1778,6 +1831,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.activityContainerView handleNIMCustomMessage:message]; [self.functionView handleNIMCustomMessage:message]; [self.littleGameView handleNIMCustomMessage:message]; + if (attachment.first == CustomMessageType_First_Recharge_Reward && attachment.second == Custom_Message_Sub_Room_First_Recharge_Reward) { self.userInfo.isFirstCharge = NO; [self.menuContainerView onRoomUpdate]; @@ -1881,9 +1935,14 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.presenter getFreeGiftData]; [[NSNotificationCenter defaultCenter]postNotificationName:kFreeGiftCountdownNotification object:nil userInfo:@{@"updateGiftInfo":attachment.data ?: @""}]; } - + } else if (attachment.first == CustomMessageType_RoomBoom) { + if (attachment.second == 631) { + [[RoomBoomManager sharedManager] receiveNIMResponse:attachment]; + } else if (attachment.second == 633) { + [[RoomBoomManager sharedManager] receiveNIMResponse:attachment]; + } } - + [self.messageContainerView handleNIMCustomMessage:message]; } } else if(message.messageType == NIMMessageTypeText) { @@ -2287,6 +2346,15 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 return [self.stageView animationPointAtStageViewByUid:uid]; } +- (void)getRoomBoomInfoSuccess:(NSArray *)models { + [[RoomBoomManager sharedManager] updateBoomDetailArray:models]; + [self.activityContainerView updateForBoomDetailArray:models]; +} + +- (void)getRoomBoomExplosionSuccess:(BoomInfoModel *)model { +// [[RoomBoomManager sharedManager] updateBoomDetailArray:models]; +} + #pragma mark - 首次退出非自己的房间,处理是否需要弹新用户充值优惠 - (void)handleFirstOutRoom { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; diff --git a/YuMi/Modules/YMTabbar/View/TabbarViewController.m b/YuMi/Modules/YMTabbar/View/TabbarViewController.m index b5bfa8b8..ddbf3ac8 100644 --- a/YuMi/Modules/YMTabbar/View/TabbarViewController.m +++ b/YuMi/Modules/YMTabbar/View/TabbarViewController.m @@ -91,6 +91,8 @@ #import "XPHomePagingViewController.h" #import "IAPManager.h" +#import "RoomBoomManager.h" +#import "RoomBoomBannerAnimation.h" NSString * const kUserFirstLoginKey = @"kUserFirstLoginKey"; NSString * const kHadLaunchApp = @"kHadLaunchApp"; @@ -157,7 +159,8 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; [[NIMSDK sharedSDK].chatManager addDelegate:self]; [[NIMSDK sharedSDK].systemNotificationManager addDelegate:self]; [[NIMSDK sharedSDK].broadcastManager addDelegate:self]; - + + [self networkReachability]; [self.view addSubview:self.roomMineView]; @@ -177,6 +180,16 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showNewUserRecharge) name:kNewUserRechargeKey object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showAnchorCardKey:) name:kTabShowAnchorCardKey object:nil]; [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(switchLanguage:) name:@"kSwitchLanguage" object:nil]; + + + [[RoomBoomManager sharedManager] registerBoomBanner:^(id _Nonnull sth) { +// @kStrongify(self); + dispatch_async(dispatch_get_main_queue(), ^{ + [RoomBoomBannerAnimation display:[UIApplication sharedApplication].keyWindow with:sth tapToRoom:YES complete:^{ + + }]; + }); + } target:self]; } -(void)switchLanguage:(NSNotification *)not{ @@ -621,7 +634,9 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; if(![partitionId isEqualToString:self.userInfo.partitionId]){ return; } - + + NSLog(@" --- Broadcast Message Raw Attach Content: %@", msgDictionary); + // MARK: 要复查这里的 if else 嵌套 if (attachment.first == CustomMessageType_RedPacket) { [self receiveRedPacketDealWithData:attachment]; diff --git a/YuMi/ar.lproj/Localizable.strings b/YuMi/ar.lproj/Localizable.strings index 561a7a46..f71e99b3 100644 --- a/YuMi/ar.lproj/Localizable.strings +++ b/YuMi/ar.lproj/Localizable.strings @@ -3930,3 +3930,11 @@ ineHeadView12" = "الحمل"; "RoomEffect_CP_lv_3" = "ثنائي الأحلام"; "RoomEffect_CP_lv_4" = "ثنائي مثالي"; "RoomEffect_CP_lv_5" = "ثنائي رائع"; + +"RoomBoom_0" = "Unfortunately! You did not receive reward, please keep up the good work!"; +"RoomBoom_1" = "Congratulations on being awarded the following prizes in this round of Boom"; +"RoomBoom_2" = "Give gifts and win super prizes"; +"RoomBoom_3" = "触发了"; +"RoomBoom_4" = ",前去圍觀"; +"RoomBoom_5" = "房間暱稱:"; +"RoomBoom_6" = "Reset time: 0:00 (GMT+3) daily"; diff --git a/YuMi/en.lproj/Localizable.strings b/YuMi/en.lproj/Localizable.strings index 98249676..0e4ac942 100644 --- a/YuMi/en.lproj/Localizable.strings +++ b/YuMi/en.lproj/Localizable.strings @@ -3726,3 +3726,11 @@ "RoomEffect_CP_lv_3" = "Dream Duo"; "RoomEffect_CP_lv_4" = "Perfect Duo"; "RoomEffect_CP_lv_5" = "Divine Couple"; + +"RoomBoom_0" = "Unfortunately! You did not receive reward, please keep up the good work!"; +"RoomBoom_1" = "Congratulations on being awarded the following prizes in this round of Boom"; +"RoomBoom_2" = "Give gifts and win super prizes"; +"RoomBoom_3" = "触发了"; +"RoomBoom_4" = ",前去圍觀"; +"RoomBoom_5" = "房間暱稱:"; +"RoomBoom_6" = "Reset time: 0:00 (GMT+3) daily"; diff --git a/YuMi/zh-Hans.lproj/Localizable.strings b/YuMi/zh-Hans.lproj/Localizable.strings index 65bb442c..ad35a600 100644 --- a/YuMi/zh-Hans.lproj/Localizable.strings +++ b/YuMi/zh-Hans.lproj/Localizable.strings @@ -3390,3 +3390,11 @@ "RoomEffect_CP_lv_3" = "夢幻雙人組"; "RoomEffect_CP_lv_4" = "完美雙人組"; "RoomEffect_CP_lv_5" = "神仙眷侶"; + +"RoomBoom_0" = "Unfortunately! You did not receive reward, please keep up the good work!"; +"RoomBoom_1" = "Congratulations on being awarded the following prizes in this round of Boom"; +"RoomBoom_2" = "Give gifts and win super prizes"; +"RoomBoom_3" = "触发了"; +"RoomBoom_4" = ",前去圍觀"; +"RoomBoom_5" = "房間暱稱:"; +"RoomBoom_6" = "Reset time: 0:00 (GMT+3) daily"; diff --git a/YuMi/zh-Hant.lproj/Localizable.strings b/YuMi/zh-Hant.lproj/Localizable.strings index 9bcfa0b8..c9381ca2 100644 --- a/YuMi/zh-Hant.lproj/Localizable.strings +++ b/YuMi/zh-Hant.lproj/Localizable.strings @@ -3383,3 +3383,10 @@ "RoomEffect_CP_lv_4" = "完美雙人組"; "RoomEffect_CP_lv_5" = "神仙眷侶"; +"RoomBoom_0" = "Unfortunately! You did not receive reward, please keep up the good work!"; +"RoomBoom_1" = "Congratulations on being awarded the following prizes in this round of Boom"; +"RoomBoom_2" = "Give gifts and win super prizes"; +"RoomBoom_3" = "触发了"; +"RoomBoom_4" = ",前去圍觀"; +"RoomBoom_5" = "房間暱稱:"; +"RoomBoom_6" = "Reset time: 0:00 (GMT+3) daily";