diff options
| author | 2026-01-18 14:27:45 +0800 | |
|---|---|---|
| committer | 2026-01-18 14:27:45 +0800 | |
| commit | 6fdb730c323bcb1b052a2f9b13034603cbaf1e4d (patch) | |
| tree | a6052552ac5f6365f5220211a7b17798b0fc083a /src-tauri/src/core | |
| parent | 17e8dd78ca5b7aae9baa4f86d38fa755c8af21c5 (diff) | |
| download | DropOut-6fdb730c323bcb1b052a2f9b13034603cbaf1e4d.tar.gz DropOut-6fdb730c323bcb1b052a2f9b13034603cbaf1e4d.zip | |
feat(backend): enhance instance management for editor support
- Sync instance.version_id after start_game, install_fabric, install_forge
- Add jvm_args_override and memory_override to Instance struct
- Add file management commands: list_instance_directory, delete_instance_file, open_file_explorer
- Support per-instance settings overrides (Java args, memory)
Diffstat (limited to 'src-tauri/src/core')
| -rw-r--r-- | src-tauri/src/core/instance.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src-tauri/src/core/instance.rs b/src-tauri/src/core/instance.rs index 183e1cc..573273e 100644 --- a/src-tauri/src/core/instance.rs +++ b/src-tauri/src/core/instance.rs @@ -25,6 +25,16 @@ pub struct Instance { pub notes: Option<String>, // 备注(可选) pub mod_loader: Option<String>, // 模组加载器类型:"fabric", "forge", "vanilla" pub mod_loader_version: Option<String>, // 模组加载器版本 + pub jvm_args_override: Option<String>, // JVM参数覆盖(可选) + #[serde(default)] + pub memory_override: Option<MemoryOverride>, // 内存设置覆盖(可选) +} + +/// Memory settings override for an instance +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct MemoryOverride { + pub min: u32, // MB + pub max: u32, // MB } /// Configuration for all instances @@ -99,6 +109,8 @@ impl InstanceState { notes: None, mod_loader: Some("vanilla".to_string()), mod_loader_version: None, + jvm_args_override: None, + memory_override: None, }; let mut config = self.instances.lock().unwrap(); @@ -253,6 +265,8 @@ impl InstanceState { .unwrap() .as_secs() as i64, last_played: None, + jvm_args_override: source_instance.jvm_args_override.clone(), + memory_override: source_instance.memory_override.clone(), }; self.update_instance(new_instance.clone())?; |