diff --git a/VoidLink/Limelight.xcdatamodeld/VoidLink v1.0.xcdatamodel/contents b/VoidLink/Limelight.xcdatamodeld/VoidLink v1.0.xcdatamodel/contents index 5d378bcb..f59b2133 100644 --- a/VoidLink/Limelight.xcdatamodeld/VoidLink v1.0.xcdatamodel/contents +++ b/VoidLink/Limelight.xcdatamodeld/VoidLink v1.0.xcdatamodel/contents @@ -51,7 +51,7 @@ - + diff --git a/VoidLink/Localization/Localizable.xcstrings b/VoidLink/Localization/Localizable.xcstrings index 9d4cee84..85a1c7bd 100644 --- a/VoidLink/Localization/Localizable.xcstrings +++ b/VoidLink/Localization/Localizable.xcstrings @@ -1,29 +1,6 @@ { "sourceLanguage" : "en", "strings" : { - "\n1. From %@ edge, slide %d%% screen width to open settings menu\n\n2. From %@ edge, slide %d%% screen width to open command tool\n\n3. Back to Streaming from settings menu: slide from left edge\n\n4. Slide from upper 40%% of screen edge to avoid sending touch events to PC side" : { - "extractionState" : "manual", - "localizations" : { - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "\n1. 展开设置菜单: 从%@边缘滑动%d%%屏幕宽度\n\n2. 打开命令工具: 从%@边缘滑动%d%%屏幕宽度\n\n3. 返回串流 / 收起设置菜单: 从左边缘滑动\n\n4. 从40%%上半边缘滑动避免触控事件影响PC端" - } - }, - "zh-Hant" : { - "stringUnit" : { - "state" : "translated", - "value" : "\n1. 展開設定選單:從%@邊緣滑動%d%%的螢幕寬度\n\n2. 開啟指令工具:從%@邊緣滑動%d%%的螢幕寬度\n\n3. 從設定選單返回串流:從左側邊緣滑動\n\n4. 從螢幕邊緣上方40%%處滑動以避免將觸控事件傳送到電腦端" - } - }, - "zh-HK" : { - "stringUnit" : { - "state" : "translated", - "value" : "\n1. 展開設定選單:從%@邊緣滑動%d%%的螢幕寬度\n\n2. 開啟指令工具:從%@邊緣滑動%d%%的螢幕寬度\n\n3. 從設定選單返回串流:從左側邊緣滑動\n\n4. 從螢幕邊緣上方40%%處滑動以避免將觸控事件傳送到電腦端" - } - } - } - }, "\nHost processing latency min/max/avg: %.1f/%.1f/%.1f ms" : { "extractionState" : "manual", "localizations" : { @@ -1779,6 +1756,35 @@ } } }, + "firstLaunchTip" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "\n1. From %@ edge, slide %d%% screen width to open settings menu\n\n2. From %@ edge, slide %d%% screen width to open toolbox menu\n\n3. Slide from top 40%% of screen edge to avoid sending touch events to PC side" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "needs_review", + "value" : "\n1. 展开设置菜单: 从%@边缘滑动%d%%屏幕宽度\n\n2. 打开工具箱菜单: 从%@边缘滑动%d%%屏幕宽度\n\n3. 从40%%上半边缘滑动避免触控事件影响PC端" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "needs_review", + "value" : "\n1. 展開設定選單:從%@邊緣滑動%d%%的螢幕寬度\n\n2. 開啟工具箱選單:從%@邊緣滑動%d%%的螢幕寬度\n\n3. 從螢幕邊緣上方40%%處滑動以避免將觸控事件傳送到電腦端" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "needs_review", + "value" : "\n1. 展開設定選單:從%@邊緣滑動%d%%的螢幕寬度\n\n2. 開啟工具箱選單:從%@邊緣滑動%d%%的螢幕寬度\n\n3. 從螢幕邊緣上方40%%處滑動以避免將觸控事件傳送到電腦端" + } + } + } + }, "FPS: %5.2f Network dropped frames: %.2f%% Network latency: %@" : { "extractionState" : "manual", "localizations" : { diff --git a/VoidLink/ViewControllers/StreamFrameViewController.m b/VoidLink/ViewControllers/StreamFrameViewController.m index c3dab216..6d70c02b 100644 --- a/VoidLink/ViewControllers/StreamFrameViewController.m +++ b/VoidLink/ViewControllers/StreamFrameViewController.m @@ -420,7 +420,6 @@ #endif - (void)popFirstLaunchTip { - return; // temp disable // 初始化倒计时秒数 __block NSInteger remainingSeconds = 16; @@ -428,9 +427,25 @@ NSString* cmdToolEdgeSide = _settings.slideToSettingsScreenEdge.intValue == UIRectEdgeLeft ? [LocalizationHelper localizedStringForKey:@"right"] : [LocalizationHelper localizedStringForKey:@"left"]; uint8_t slideDist = (uint8_t)(_settings.slideToSettingsDistance.floatValue * 100); // 创建弹窗 - UIAlertController *alert = [UIAlertController alertControllerWithTitle:[LocalizationHelper localizedStringForKey:@"First Launch Tips"] - message:[LocalizationHelper localizedStringForKey:@"\n1. From %@ edge, slide %d%% screen width to open settings menu\n\n2. From %@ edge, slide %d%% screen width to open command tool\n\n3. Back to Streaming from settings menu: slide from left edge\n\n4. Slide from upper 40%% of screen edge to avoid sending touch events to PC side", settingsEdgeSide, slideDist, cmdToolEdgeSide, slideDist] - preferredStyle:UIAlertControllerStyleAlert]; + + NSString* tipText = [LocalizationHelper localizedStringForKey:@"firstLaunchTip", settingsEdgeSide, slideDist, cmdToolEdgeSide, slideDist]; + + UIAlertController *tipsAlertController = [UIAlertController alertControllerWithTitle: [LocalizationHelper localizedStringForKey:@"First Launch Tips"] message: [LocalizationHelper localizedStringForKey:@"%@", tipText] preferredStyle:UIAlertControllerStyleAlert]; + + + NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; + paragraphStyle.alignment = NSTextAlignmentLeft; + + NSDictionary *attributes = @{ + NSParagraphStyleAttributeName: paragraphStyle, + NSFontAttributeName: [UIFont systemFontOfSize:14] + }; + + NSAttributedString *attributedMessage = [[NSAttributedString alloc] initWithString:tipText + attributes:attributes]; + + // 使用 KVC 设置 attributedMessage(注意审核风险) + [tipsAlertController setValue:attributedMessage forKey:@"attributedMessage"]; // 添加确认按钮(初始禁用) UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:[LocalizationHelper localizedStringForKey:@"Got it! (15)"] @@ -438,10 +453,10 @@ handler:^(UIAlertAction * _Nonnull action) { }]; confirmAction.enabled = NO; - [alert addAction:confirmAction]; + [tipsAlertController addAction:confirmAction]; // 显示弹窗 - [self presentViewController:alert animated:YES completion:nil]; + [self presentViewController:tipsAlertController animated:YES completion:nil]; // 使用dispatch_source_t实现精确倒计时 dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue());