From ebde19b8282edabd03307c886c60f466b24790b1 Mon Sep 17 00:00:00 2001 From: WaviestBalloon <31796727+WaviestBalloon@users.noreply.github.com> Date: Thu, 11 Jan 2024 10:00:06 +0000 Subject: [PATCH] Add check for missing DataModelPatch, specify what binary we are installing to notification --- Cargo.lock | 2 +- src/args/launch.rs | 12 ++++++++++-- src/utils/notification.rs | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 29a19af..dbcd16d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,7 +27,7 @@ dependencies = [ ] [[package]] -name = "applejuice_cli" +name = "applejuicecli" version = "0.1.0" dependencies = [ "discord-rich-presence", diff --git a/src/args/launch.rs b/src/args/launch.rs index c29b88f..f808108 100644 --- a/src/args/launch.rs +++ b/src/args/launch.rs @@ -1,6 +1,6 @@ use crate::utils::{argparse, installation, notification::create_notification, setup, terminal::*, rpc, configuration, steamos}; use crate::args; -use std::process; +use std::{process, path::Path}; use inotify::{Inotify, WatchMask}; static ACCEPTED_PARAMS: [(&str, &str); 6] = [ @@ -76,7 +76,7 @@ pub fn main(raw_args: &[(String, String)]) { warning!("Unable to find a Roblox installation, bootstrapping now..."); status!("Downloading and installing latest version..."); - create_notification(&format!("{}/assets/crudejuice.png", dir_location), 15000, "Installing Roblox...", ""); + create_notification(&format!("{}/assets/crudejuice.png", dir_location), 15000, &format!("Installing Roblox {}...", binary), ""); // TODO: Remove this, as Roblox has now locked all non-prod deployment channels :c let channel = match configuration["misc"]["overrides"]["deployment_channel"].as_str() { @@ -147,6 +147,14 @@ pub fn main(raw_args: &[(String, String)]) { } status!("Launching Roblox..."); + if binary == "Studio" { // Do a check if DataModelPatch.rbxm exists, if not, Studio might have issues when running (See: https://devforum.roblox.com/t/no-verified-patch-could-be-loaded/1797937/42?u=waviestballoon) + let data_model_patch_path = format!("{}/ExtraContent/models/DataModelPatch/DataModelPatch.rbxm", install_path); + help!("{}", data_model_patch_path); + if !Path::new(&data_model_patch_path).exists() { + warning!("DataModelPatch.rbxm does not exist, Studio may have issues when running!"); + create_notification("dialog-warning", 30000, "Missing critical file", "DataModelPatch.rbxm does not exist, Studio may have issues when running! Reinstalling Studio may fix this issue"); + } + } if studio_oauthing { create_notification( &format!("{}/assets/studio.png", dir_location), diff --git a/src/utils/notification.rs b/src/utils/notification.rs index 4089114..8ecb6db 100644 --- a/src/utils/notification.rs +++ b/src/utils/notification.rs @@ -2,7 +2,7 @@ use crate::utils::terminal::*; use notify_rust::Notification; pub fn create_notification(icon: &str, expire_time: i32, title: &str, body: &str) { - help!("Notice: {body}"); + help!("{title}: {body}"); let _ = Notification::new() .summary(title) .body(body)