forked from akanyan/STARTLINER
fix: disable unsupported mods
Also hotfix amdaemon crashing
This commit is contained in:
@ -88,9 +88,10 @@ pub enum StartCheckError {
|
||||
}
|
||||
|
||||
#[derive(Default, Serialize, Deserialize, Clone)]
|
||||
#[serde(default)]
|
||||
pub struct ConfigHook {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub allnet_auth: Option<ConfigHookAuth>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub aime: Option<ConfigHookAime>,
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ impl Package {
|
||||
.unwrap()
|
||||
.to_owned();
|
||||
|
||||
let status = Self::parse_status(&mft);
|
||||
let status = Self::parse_status(&mft, &dir);
|
||||
let dependencies = Self::sanitize_deps(mft.dependencies);
|
||||
|
||||
Ok(Package {
|
||||
@ -221,9 +221,15 @@ impl Package {
|
||||
res
|
||||
}
|
||||
|
||||
fn parse_status(mft: &PackageManifest) -> Status {
|
||||
fn parse_status(mft: &PackageManifest, dir: impl AsRef<Path>) -> Status {
|
||||
if mft.installers.len() == 0 {
|
||||
return Status::OK(make_bitflags!(Feature::Mod), DLLs { game: None, amd: None }); //Unchecked
|
||||
if dir.as_ref().join("post_load.ps1").exists() {
|
||||
return Status::Unsupported;
|
||||
}
|
||||
if dir.as_ref().join("app").join("data").exists() {
|
||||
return Status::Unsupported;
|
||||
}
|
||||
return Status::OK(make_bitflags!(Feature::Mod), DLLs { game: None, amd: None });
|
||||
} else {
|
||||
let mut flags = BitFlags::default();
|
||||
let mut game_dll = None;
|
||||
|
@ -26,19 +26,31 @@ const model = computed({
|
||||
await prf.togglePkg(props.pkg, value);
|
||||
},
|
||||
});
|
||||
|
||||
const unsupported = computed(() => props.pkg!.loc!.status === 'Unsupported');
|
||||
|
||||
if (unsupported.value === true && model.value === true) {
|
||||
prf.togglePkg(props.pkg, false);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex items-center">
|
||||
<ModTitlecard show-version show-icon show-description :pkg="pkg" />
|
||||
<UpdateButton :pkg="pkg" />
|
||||
<ToggleSwitch
|
||||
v-if="hasFeature(pkg, Feature.Mod)"
|
||||
class="scale-[1.33] shrink-0"
|
||||
inputId="switch"
|
||||
:disabled="pkg!.loc!.status === 'Unsupported'"
|
||||
v-model="model"
|
||||
/>
|
||||
<span
|
||||
v-tooltip="
|
||||
unsupported && 'This package is not compatible with STARTLINER.'
|
||||
"
|
||||
>
|
||||
<ToggleSwitch
|
||||
v-if="hasFeature(pkg, Feature.Mod) || unsupported === true"
|
||||
class="scale-[1.33] shrink-0"
|
||||
inputId="switch"
|
||||
:disabled="unsupported === true"
|
||||
v-model="model"
|
||||
/>
|
||||
</span>
|
||||
<InstallButton :pkg="pkg" />
|
||||
<Button
|
||||
rounded
|
||||
|
Reference in New Issue
Block a user