Skip to content

Commit ad684df

Browse files
Tonnodoubtclaude
andcommitted
feat: 添加连接帮助功能和内网穿透引导
- 断开连接时提示用户可使用 cpolar 等内网穿透工具 - 设置菜单新增"连接帮助"入口,弹窗说明 Symmetric NAT 限制及解决方案 - Live2DRightToolbar 新增 connectionHelp 菜单项和图标映射 - 更新 react-native-live2d 子模块 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a20a8db commit ad684df

4 files changed

Lines changed: 19 additions & 1 deletion

File tree

app/(tabs)/main.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,17 @@ const MainUIScreen: React.FC<MainUIScreenProps> = () => {
969969
doReload();
970970
return;
971971
}
972+
if (id === 'connectionHelp') {
973+
Alert.alert(
974+
'连接帮助',
975+
'如果手机无法连接电脑,可能是网络环境限制(Symmetric NAT)。\n\n' +
976+
'解决方法:在电脑端安装内网穿透工具:\n' +
977+
'• cpolar(推荐): cpolar.com\n' +
978+
'• natapp: natapp.cn\n\n' +
979+
'安装后将本地端口 48920 映射到公网,用获取的公网地址重新扫码连接。'
980+
);
981+
return;
982+
}
972983

973984
Alert.alert('功能提示', `即将打开: ${id}`);
974985
}, [config, toolbarMicEnabled, mainManager, chat, audio, syncLive2dModel]);

packages/project-neko-components/src/Live2DRightToolbar/Live2DRightToolbar.native.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export function Live2DRightToolbar({
101101
voiceClone: require('../../../../assets/icons/set_off.png'),
102102
memoryBrowser: require('../../../../assets/icons/set_off.png'),
103103
steamWorkshop: require('../../../../assets/icons/set_off.png'),
104+
connectionHelp: require('../../../../assets/icons/set_off.png'),
104105
},
105106
});
106107

packages/project-neko-components/src/Live2DRightToolbar/hooks.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ export function useSettingsMenuItems<TIcon = ToolbarIcon>(
313313
label: tOrDefault(t, 'settings.menu.steamWorkshop', '创意工坊'),
314314
icon: mkIcon('steamWorkshop', 'Steam_icon_logo.png'),
315315
},
316+
{
317+
id: 'connectionHelp' as const,
318+
label: tOrDefault(t, 'settings.menu.connectionHelp', '连接帮助'),
319+
icon: mkIcon('connectionHelp', 'set_off.png'),
320+
},
316321
];
317322
}, [t, iconBasePath, icons]);
318323
}

packages/project-neko-components/src/Live2DRightToolbar/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export type Live2DSettingsMenuId =
3636
| "reload"
3737
| "voiceClone"
3838
| "memoryBrowser"
39-
| "steamWorkshop";
39+
| "steamWorkshop"
40+
| "connectionHelp";
4041

4142
export interface Live2DRightToolbarProps {
4243
visible?: boolean;

0 commit comments

Comments
 (0)