mirror of
https://github.com/StarCitizenToolBox/app.git
synced 2026-01-14 20:20:28 +00:00
fix: p4k close
This commit is contained in:
parent
e1ed30b6e6
commit
f3fab62291
@ -51,12 +51,10 @@ class Unp4kCModel extends _$Unp4kCModel {
|
|||||||
|
|
||||||
final loadStartTime = DateTime.now();
|
final loadStartTime = DateTime.now();
|
||||||
|
|
||||||
// 使用 Rust API 打开 P4K 文件(仅打开,不读取文件列表)
|
|
||||||
await unp4k_api.p4KOpen(p4KPath: gameP4kPath);
|
await unp4k_api.p4KOpen(p4KPath: gameP4kPath);
|
||||||
|
|
||||||
state = state.copyWith(endMessage: S.current.tools_unp4k_msg_reading2);
|
state = state.copyWith(endMessage: S.current.tools_unp4k_msg_reading2);
|
||||||
|
|
||||||
// 获取所有文件列表(会触发文件列表加载)
|
|
||||||
final p4kFiles = await unp4k_api.p4KGetAllFiles();
|
final p4kFiles = await unp4k_api.p4KGetAllFiles();
|
||||||
|
|
||||||
final files = <String, AppUnp4kP4kItemData>{};
|
final files = <String, AppUnp4kP4kItemData>{};
|
||||||
@ -102,7 +100,6 @@ class Unp4kCModel extends _$Unp4kCModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ref.onDispose(() async {
|
ref.onDispose(() async {
|
||||||
state = state.copyWith(fs: null);
|
|
||||||
try {
|
try {
|
||||||
await unp4k_api.p4KClose();
|
await unp4k_api.p4KClose();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user