-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Filter Optional Dependencies from ModDependency List may determine to create an optional dependency list later * mod.id -> mod.mod_reference Requested by Mircea https://discord.com/channels/555424930502541343/830842478956642354/1248726787857321995 * fix: added graphql tags and draft "Optional" tag * Tagged Optional -> Tabled Optional * feat: split deps into distinct tables with tooltips * feat: dotted underline on deps table headers * feat: only show optional deps table when they exist * chore: update aria-label * Make dependencies reactive Co-authored-by: mircearoata <[email protected]> * chore: add gpg signing info to readme * fix: pass modref for smm install and modid for smr download --------- Co-authored-by: Rob B <[email protected]> Co-authored-by: mircearoata <[email protected]>
- Loading branch information
1 parent
3e75505
commit ef85bd3
Showing
9 changed files
with
84 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ query GetModVersion($version: VersionID!) { | |
} | ||
dependencies { | ||
mod_id | ||
optional | ||
condition | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script lang="ts"> | ||
import { base } from '$app/paths'; | ||
import type { VersionDependency } from '$lib/generated'; | ||
export let dependency!: Pick<VersionDependency, 'mod_id' | 'optional' | 'condition'>; | ||
</script> | ||
|
||
<tr class="rounded border !border-surface-500"> | ||
<td> | ||
<a title="Click to view mod page" href={`${base}/mod/${dependency.mod_id}`} class="text-yellow-500"> | ||
<u>{dependency.mod_id}</u> | ||
</a> | ||
</td> | ||
<td><div class="text-center">{dependency.condition}</div></td> | ||
</tr> |
49 changes: 35 additions & 14 deletions
49
src/lib/components/versions/VersionDependenciesGrid.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,55 @@ | ||
<script lang="ts"> | ||
import { base } from '$app/paths'; | ||
import DependencyRow from './DependencyRow.svelte'; | ||
import type { VersionDependency } from '$lib/generated'; | ||
export let dependencies!: Pick<VersionDependency, 'mod_id' | 'condition'>[]; | ||
export let dependencies!: Pick<VersionDependency, 'mod_id' | 'optional' | 'condition'>[]; | ||
$: requiredDependencies = dependencies.filter((d) => !d.optional); | ||
$: optionalDependencies = dependencies.filter((d) => d.optional); | ||
</script> | ||
|
||
<div class="grid grid-flow-row"> | ||
<table aria-label="Mod Dependency" class="max-w-auto table table-hover !overflow-visible"> | ||
<table aria-label="Required Mod Dependencies" class="max-w-auto table table-hover !overflow-visible"> | ||
<tbody> | ||
<tr class="rounded border !border-surface-500"> | ||
<td>Mod Dependency</td> | ||
<td | ||
class="underline decoration-dotted" | ||
title="Other mods that must be installed for this mod to function. The Mod Manager will automatically install these for you." | ||
>Required Dependencies</td> | ||
<td><div class="text-center">Version Range</div></td> | ||
</tr> | ||
{#if dependencies?.length === 0} | ||
{#if requiredDependencies?.length === 0} | ||
<!-- A mod *not* having required dependencies is rare, so point it out when this is the case --> | ||
<tr class="rounded border !border-surface-500"> | ||
<td><div class="text-center">None</div></td> | ||
<td><div class="text-center">N/A</div></td> | ||
</tr> | ||
{:else} | ||
{#each dependencies as dependency} | ||
<tr class="rounded border !border-surface-500"> | ||
<td> | ||
<a title="Click to view mod page" href={`${base}/mod/${dependency.mod_id}`} class="text-yellow-500"> | ||
<u>{dependency.mod_id}</u> | ||
</a> | ||
</td> | ||
<td><div class="text-center">{dependency.condition}</div></td> | ||
</tr> | ||
{#each requiredDependencies as dependency} | ||
<DependencyRow {dependency} /> | ||
{/each} | ||
{/if} | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<!-- Optional dependencies are uncommon as of now, so don't spend UI space on them unless there are any --> | ||
{#if optionalDependencies?.length !== 0} | ||
<div class="grid grid-flow-row"> | ||
<table aria-label="Optional Mod Dependencies" class="max-w-auto table table-hover !overflow-visible"> | ||
<tbody> | ||
<tr class="rounded border !border-surface-500"> | ||
<td | ||
class="underline decoration-dotted" | ||
title="Other mods that don't need to be installed for this mod to function, but may unlock additional functionality when present. You must chose to install them in the Mod Manager if you wish to use them." | ||
>Optional Dependencies</td> | ||
<td><div class="text-center">Version Range</div></td> | ||
</tr> | ||
{#each optionalDependencies as dependency} | ||
<DependencyRow {dependency} /> | ||
{/each} | ||
</tbody> | ||
</table> | ||
</div> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters