fix(debug): 保持自动加入存档的包激活
生成 dev_config 时写入本次调试会话的全部包 UUID,确保自动进入世界后内置调试包和用户包仍处于启用状态。
This commit is contained in:
@@ -41,7 +41,7 @@ pub fn prepare_world(config: &DebugConfig, linked_packs: &[PackInfo]) -> Result<
|
|||||||
write_world_pack_manifests(config, linked_packs)
|
write_world_pack_manifests(config, linked_packs)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_dev_config(config: &DebugConfig) -> Result<PathBuf> {
|
pub fn write_dev_config(config: &DebugConfig, linked_packs: &[PackInfo]) -> Result<PathBuf> {
|
||||||
let world_dir = world_dir(config);
|
let world_dir = world_dir(config);
|
||||||
fs::create_dir_all(&world_dir)?;
|
fs::create_dir_all(&world_dir)?;
|
||||||
|
|
||||||
@@ -53,9 +53,11 @@ pub fn write_dev_config(config: &DebugConfig) -> Result<PathBuf> {
|
|||||||
.to_string_lossy()
|
.to_string_lossy()
|
||||||
.replace('\\', "/");
|
.replace('\\', "/");
|
||||||
|
|
||||||
|
let vip_using_mod: Vec<&str> = linked_packs.iter().map(|pack| pack.uuid.as_str()).collect();
|
||||||
let mut dev_config = json!({
|
let mut dev_config = json!({
|
||||||
"world_info": { "level_id": config.world_folder_name },
|
"world_info": { "level_id": config.world_folder_name },
|
||||||
"room_info": {},
|
"room_info": {},
|
||||||
|
"vip_using_mod": vip_using_mod,
|
||||||
"player_info": {
|
"player_info": {
|
||||||
"urs": "",
|
"urs": "",
|
||||||
"user_id": 0,
|
"user_id": 0,
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ pub fn run(project_dir: &Path, new_world: bool) -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let config_arg = if config.auto_join_game_effective() && !config::env_is_subprocess_mode() {
|
let config_arg = if config.auto_join_game_effective() && !config::env_is_subprocess_mode() {
|
||||||
Some(level::write_dev_config(&config)?)
|
Some(level::write_dev_config(&config, &linked_packs)?)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user