42 lines
1.1 KiB
Objective-C
42 lines
1.1 KiB
Objective-C
//
|
|
// XPGiftEffectAction.m
|
|
// YuMi
|
|
//
|
|
// Created by Linus on 2025/1/13.
|
|
//
|
|
|
|
#import "XPGiftEffectAction.h"
|
|
#import "RoomInfoModel.h"
|
|
|
|
@implementation XPGiftEffectAction
|
|
|
|
+ (instancetype)openAction {
|
|
XPGiftEffectAction *action = [[XPGiftEffectAction alloc] init];
|
|
action.title = YMLocalizedString(@"XPMoreMenuPresenter5");
|
|
action.imageName = @"room_more_menu_gift_effect";
|
|
action.type = RoomMoreMenuType_Gift_Effect_Open;
|
|
action.titleColor = [DJDKMIMOMColor appCellBackgroundColor];
|
|
return action;
|
|
}
|
|
|
|
+ (instancetype)closeAction {
|
|
XPGiftEffectAction *action = [[XPGiftEffectAction alloc] init];
|
|
action.title = YMLocalizedString(@"XPMoreMenuPresenter28");
|
|
action.imageName = @"room_more_menu_gift_effect";
|
|
action.type = RoomMoreMenuType_Gift_Effect_Close;
|
|
action.titleColor = [DJDKMIMOMColor appCellBackgroundColor];
|
|
return action;
|
|
}
|
|
|
|
// 根据房间状态创建对应的 Action
|
|
+ (instancetype)actionWithRoomInfo:(RoomInfoModel *)roomInfo {
|
|
if (roomInfo.hasAnimationEffect) {
|
|
return [self closeAction];
|
|
} else {
|
|
return [self openAction];
|
|
}
|
|
}
|
|
|
|
|
|
@end
|