diff --git a/apps/frontend/src/ui/pages/cluster/ClusterMods.tsx b/apps/frontend/src/ui/pages/cluster/ClusterMods.tsx index a7703020..34a72713 100644 --- a/apps/frontend/src/ui/pages/cluster/ClusterMods.tsx +++ b/apps/frontend/src/ui/pages/cluster/ClusterMods.tsx @@ -1,6 +1,7 @@ import type { Package } from '@onelauncher/client/bindings'; import UFuzzy from '@leeoniya/ufuzzy'; -import { FilterFunnel01Icon, RefreshCw01Icon, SearchMdIcon, Trash03Icon } from '@untitled-theme/icons-solid'; +import { open } from '@tauri-apps/plugin-shell'; +import { FilterFunnel01Icon, LinkExternal01Icon, RefreshCw01Icon, SearchMdIcon, Trash03Icon } from '@untitled-theme/icons-solid'; import { bridge } from '~imports'; import Button from '~ui/components/base/Button'; import Checkbox from '~ui/components/base/Checkbox'; @@ -11,11 +12,14 @@ import useBrowser from '~ui/hooks/useBrowser'; import useClusterContext from '~ui/hooks/useCluster'; import useCommand, { tryResult } from '~ui/hooks/useCommand'; import useProcessor from '~ui/hooks/useProcessor'; +import useSettings from '~ui/hooks/useSettings'; +import { join } from 'pathe'; import { type Accessor, createEffect, createSignal, For, Match, on, Show, Switch, untrack } from 'solid-js'; // TODO: This needs a rewrite. function ClusterMods() { const [cluster] = useClusterContext(); + const { settings } = useSettings(); const { isRunning } = useProcessor(cluster()!); const [mods, { refetch: refetchModsCommand }] = useCommand(cluster, () => bridge.commands.getClusterPackages(cluster()?.path || '', 'mod')); @@ -72,6 +76,10 @@ function ClusterMods() { setDisplayedMods(value => sortListByName([...value])); } + function openFolder() { + open(join(settings().config_dir || '', 'clusters', cluster()?.path || '', 'mods')); + } + createEffect(on(mods, (value) => { setDisplayedMods(sortListByName(value || [])); })); @@ -125,6 +133,15 @@ function ClusterMods() { + +
+
); } @@ -144,8 +161,13 @@ function ModEntry(props: ModEntryProps) { const [disabled, setDisabled] = createSignal(props.pkg.disabled || false); const name = () => { - if (props.pkg.meta.type === 'unknown') - return props.pkg.file_name; + if (props.pkg.meta.type === 'unknown') { + let fileName = props.pkg.file_name; + if (fileName.endsWith('.disabled')) + fileName = fileName.slice(0, -9); + + return fileName; + } return props.pkg.meta.title || props.pkg.file_name; }; diff --git a/packages/core/src/store/package.rs b/packages/core/src/store/package.rs index ef4b3168..5b1b9f1b 100644 --- a/packages/core/src/store/package.rs +++ b/packages/core/src/store/package.rs @@ -495,7 +495,7 @@ impl PackageManager { while let Some(file) = files.next_entry().await? { // Skip .packages.json meta file - if file.file_name().to_string_lossy().starts_with(&package_type.get_meta_file_name()) || file.file_type().await?.is_dir() + if file.file_name().to_string_lossy().starts_with(&".") || file.file_type().await?.is_dir() { continue; }