feat(worlds): add metadata cards and quick launch
This commit is contained in:
1 parent
4eed312c3d
commit
ea7478eb27
22 files changed
+585
-88
No files matched your search
+23
-2
@@ -552,7 +552,11 @@ impl App {
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn spawn_launch(&self, instance: crate::instance::InstanceConfig) {
|
||||
pub(super) fn spawn_launch(
|
||||
&self,
|
||||
instance: crate::instance::InstanceConfig,
|
||||
quick_play_world: Option<String>,
|
||||
) {
|
||||
use crate::instance::launch;
|
||||
use crate::instance::runtime;
|
||||
|
||||
@@ -569,13 +573,30 @@ impl App {
|
||||
}
|
||||
};
|
||||
|
||||
let can_launch = matches!(
|
||||
runtime::get(&instance.name),
|
||||
None | Some(runtime::RunState::Crashed(_))
|
||||
);
|
||||
if !can_launch {
|
||||
return;
|
||||
}
|
||||
runtime::remove(&instance.name);
|
||||
crate::instance::logs::live::clear(&instance.name);
|
||||
|
||||
runtime::set_state(&instance.name, runtime::RunState::Authenticating);
|
||||
|
||||
let instances_dir = self.instance_manager.instances_dir.clone();
|
||||
let meta_dir = self.instance_manager.meta_dir.clone();
|
||||
|
||||
tokio::spawn(async move {
|
||||
if let Err(e) = launch::launch(&instance, &instances_dir, &meta_dir).await {
|
||||
if let Err(e) = launch::launch(
|
||||
&instance,
|
||||
&instances_dir,
|
||||
&meta_dir,
|
||||
quick_play_world.as_deref(),
|
||||
)
|
||||
.await
|
||||
{
|
||||
tracing::error!("Failed to launch '{}': {}", instance.name, e);
|
||||
runtime::remove(&instance.name);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user