feat: upgrade molecules, new frame

This commit is contained in:
Nova
2023-01-26 09:24:10 -05:00
parent 1c66cdcd2c
commit fbed29da66
4 changed files with 17 additions and 24 deletions

14
Cargo.lock generated
View File

@@ -1217,7 +1217,7 @@ dependencies = [
[[package]]
name = "protostar"
version = "0.3.0"
version = "0.4.0"
dependencies = [
"clap",
"color-eyre",
@@ -1596,8 +1596,6 @@ dependencies = [
[[package]]
name = "stardust-xr"
version = "0.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd8541caad6c5c3e9c43ce4fa43a330f7a3df5ec293c88fd062fff46172ceb97"
dependencies = [
"chrono",
"cluFlock",
@@ -1615,9 +1613,7 @@ dependencies = [
[[package]]
name = "stardust-xr-fusion"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a95836cb0147824ee1be564ba104de65d022da86d50bdac526e29830e8e1cf7c"
version = "0.34.0"
dependencies = [
"anyhow",
"color-rs",
@@ -1638,9 +1634,7 @@ dependencies = [
[[package]]
name = "stardust-xr-molecules"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73d9a445dc6aef7010c17d972885cea278f96d5da70b030e6a39e3e041ca85df"
version = "0.17.0"
dependencies = [
"color-rs",
"flexbuffers",
@@ -1658,8 +1652,6 @@ dependencies = [
[[package]]
name = "stardust-xr-schemas"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12b2b760187d18535aadf608d6221506b1364a4fff14653f31c51a2fd6696fd9"
dependencies = [
"flatbuffers",
"flexbuffers",

View File

@@ -1,6 +1,6 @@
[package]
name = "protostar"
version = "0.3.0"
version = "0.4.0"
edition = "2021"
[dependencies]
@@ -17,7 +17,7 @@ mint = "0.5.9"
nix = "0.26.1"
resvg = "0.28.0"
rustc-hash = "1.1.0"
stardust-xr-molecules = "0.16.0"
stardust-xr-molecules = "0.17.0"
tokio = { version = "1.24.1", features = ["full"] }
tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }
tween = "2.0.0"

View File

@@ -6,7 +6,7 @@ use protostar::{
xdg::{get_desktop_files, parse_desktop_file, DesktopFile},
};
use stardust_xr_molecules::fusion::{
client::{Client, LifeCycleHandler, LogicStepInfo},
client::{Client, FrameInfo, RootHandler},
spatial::Spatial,
};
@@ -24,7 +24,7 @@ async fn main() -> Result<()> {
let (client, event_loop) = Client::connect_with_async_loop().await?;
client.set_base_prefixes(&[directory_relative_path!("res")]);
let _root = client.wrap_root(AppGrid::new(&client));
let _root = client.wrap_root(AppGrid::new(&client))?;
tokio::select! {
_ = tokio::signal::ctrl_c() => (),
@@ -58,10 +58,10 @@ impl AppGrid {
AppGrid { apps }
}
}
impl LifeCycleHandler for AppGrid {
fn logic_step(&mut self, info: LogicStepInfo) {
impl RootHandler for AppGrid {
fn frame(&mut self, info: FrameInfo) {
for app in &mut self.apps {
app.logic_step(info);
app.frame(info);
}
}
}
@@ -109,8 +109,8 @@ impl App {
})
}
}
impl LifeCycleHandler for App {
fn logic_step(&mut self, info: LogicStepInfo) {
self.protostar.logic_step(info);
impl RootHandler for App {
fn frame(&mut self, info: FrameInfo) {
self.protostar.frame(info);
}
}

View File

@@ -5,7 +5,7 @@ use mint::Vector3;
use nix::unistd::{execv, fork};
use stardust_xr_molecules::{
fusion::{
client::{Client, LifeCycleHandler, LogicStepInfo},
client::{Client, FrameInfo, RootHandler},
core::values::Transform,
drawable::{MaterialParameter, Model, ResourceID},
fields::BoxField,
@@ -113,8 +113,8 @@ impl ProtoStar {
self.grabbable.content_parent()
}
}
impl LifeCycleHandler for ProtoStar {
fn logic_step(&mut self, info: LogicStepInfo) {
impl RootHandler for ProtoStar {
fn frame(&mut self, info: FrameInfo) {
self.grabbable.update();
if let Some(icon_shrink) = &mut self.icon_shrink {
@@ -147,6 +147,7 @@ impl LifeCycleHandler for ProtoStar {
tokio::task::spawn(async move {
std::env::set_var("STARDUST_STARTUP_TOKEN", future.await.unwrap());
if unsafe { fork() }.unwrap().is_parent() {
println!("Launching \"{}\"...", &executable);
execv::<&CStr>(
ustr("/bin/sh").as_cstr(),
&[