-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge branch '0.4.2'
Showing
6 changed files
with
111 additions
and
33 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 was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
src/renderer/src/features/library/conflicts/ConflictGroup.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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<script lang="ts"> | ||
import type { Addon } from 'shared' | ||
import AddonCard from '../../../components/addons/AddonCard.svelte' | ||
import { findRepeatedValues } from '../../../utils' | ||
export let group: Addon[] | ||
export let index: number | ||
$: sharedFiles = findRepeatedValues(...group.map((addon) => addon.files)).filter( | ||
(file) => file !== 'addoninfo.txt' && file !== 'addonimage.jpg' | ||
) | ||
export let showFiles: boolean | ||
</script> | ||
|
||
<div class="p-4 bg-surface-700/70 rounded-lg gap-2"> | ||
<p class=" mb-3 text-sm text-surface-400">Conflict #{index + 1}</p> | ||
|
||
<div class="library-list"> | ||
{#each group as addon} | ||
<AddonCard mode="card" {addon} /> | ||
{/each} | ||
</div> | ||
|
||
{#if showFiles} | ||
<div class="p-3 bg-surface-900 mt-5 rounded-lg max-h-80 overflow-y-auto"> | ||
<p class=" text-xs text-surface-400"> | ||
{sharedFiles.length} file(s) conflicting between {group.length} mods | ||
</p> | ||
<div class="mt-2"> | ||
{#each sharedFiles as file} | ||
<div class="text-xs text-red-400"> | ||
{file} | ||
</div> | ||
{/each} | ||
</div> | ||
</div> | ||
{/if} | ||
</div> | ||
|
||
<style lang="postcss"> | ||
.library-list { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); | ||
grid-auto-rows: minmax(min-content, max-content); | ||
align-items: stretch; | ||
gap: 12px; | ||
} | ||
</style> |
43 changes: 43 additions & 0 deletions
43
src/renderer/src/features/library/conflicts/Conflicts.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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<script> | ||
import { conflictGroups } from '../../../stores/conflicts' | ||
import { view } from '../../../stores/view' | ||
import ConflictGroup from './ConflictGroup.svelte' | ||
let showFiles = false | ||
function toggleShowSharedFiles() { | ||
showFiles = !showFiles | ||
} | ||
</script> | ||
|
||
<div class:hidden={$view != 'conflicts'}> | ||
<div class="relative"> | ||
<div class=" pb-32 p-4 flex flex-col max-w-[900px] mx-auto gap-4"> | ||
<div | ||
class="absolute top-0 left-0 right-0 min-h-[260px] -z-20 bg-gradient-to-b from-red-600/20 to-transparent" | ||
/> | ||
|
||
<div class="py-4 px-4"> | ||
<div class="flex justify-between items-center"> | ||
<h5 class="h3">Conflicts</h5> | ||
|
||
<button class="btn variant-filled-surface btn-sm" on:click={toggleShowSharedFiles}> | ||
{showFiles ? 'Hide' : 'Show'} conflict details | ||
</button> | ||
</div> | ||
|
||
<p class="text-sm mt-2 text-surface-300"> | ||
See exactly which mods are conflicting with each other. | ||
{#if showFiles} | ||
<br /> | ||
Common files, such as <span class="font-semibold">addoninfo.txt</span> and | ||
<span class="font-semibold">addonimage.jpg</span>, are excluded from conflicts. | ||
{/if} | ||
</p> | ||
</div> | ||
|
||
{#each $conflictGroups as group, i} | ||
<ConflictGroup {showFiles} index={i} {group} /> | ||
{/each} | ||
</div> | ||
</div> | ||
</div> |
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