42 lines
1.4 KiB
Mathematica
42 lines
1.4 KiB
Mathematica
![]() |
//
|
|||
|
// XPRoomSettingAction.m
|
|||
|
// YuMi
|
|||
|
//
|
|||
|
// Created by Linus on 2025/1/13.
|
|||
|
//
|
|||
|
|
|||
|
#import "XPRoomSettingAction.h"
|
|||
|
#import "../Model/XPRoomMoreMenuActionContext.h"
|
|||
|
#import "YUMIMacroUitls.h"
|
|||
|
#import "XPRoomSettingViewController.h"
|
|||
|
#import "DJDKMIMOMColor.h"
|
|||
|
|
|||
|
@implementation XPRoomSettingAction
|
|||
|
|
|||
|
+ (instancetype)action {
|
|||
|
XPRoomSettingAction *action = [[XPRoomSettingAction alloc] init];
|
|||
|
action.title = @"房间设置"; // 暂时使用硬编码,后续改为本地化
|
|||
|
action.imageName = @"room_more_menu_setting"; // 使用正确的图片名称
|
|||
|
action.type = RoomMoreMenuType_Room_Setting;
|
|||
|
action.isEnabled = YES;
|
|||
|
action.titleColor = [DJDKMIMOMColor appCellBackgroundColor]; // 使用正确的标题颜色
|
|||
|
return action;
|
|||
|
}
|
|||
|
|
|||
|
- (BOOL)canExecuteWithContext:(XPRoomMoreMenuActionContext *)context {
|
|||
|
// 房间设置通常只有房主或管理员可以操作
|
|||
|
// 这里暂时允许所有用户,后续可以根据权限调整
|
|||
|
return self.isEnabled;
|
|||
|
}
|
|||
|
|
|||
|
- (void)executeWithContext:(XPRoomMoreMenuActionContext *)context {
|
|||
|
// 关闭当前页面
|
|||
|
[context.presentingViewController dismissViewControllerAnimated:YES completion:nil];
|
|||
|
|
|||
|
// 创建并跳转到房间设置页面
|
|||
|
XPRoomSettingViewController *roomSettingVC = [[XPRoomSettingViewController alloc] initWithDelegate:context.hostDelegate];
|
|||
|
[context.hostDelegate.getCurrentNav pushViewController:roomSettingVC animated:YES];
|
|||
|
}
|
|||
|
|
|||
|
@end
|