You've already forked AstralRinth
forked from didirus/AstralRinth
Fix being able to add mods to paired instances (#630)
* Fix being able to add mods to paired instances * Remove debugging output.
This commit is contained in:
@@ -11,7 +11,11 @@
|
|||||||
>
|
>
|
||||||
<div v-for="(option, index) in options" :key="index" @click.stop="optionClicked(option.name)">
|
<div v-for="(option, index) in options" :key="index" @click.stop="optionClicked(option.name)">
|
||||||
<hr v-if="option.type === 'divider'" class="divider" />
|
<hr v-if="option.type === 'divider'" class="divider" />
|
||||||
<div v-else class="item clickable" :class="[option.color ?? 'base']">
|
<div
|
||||||
|
v-else-if="!(isLinkedData(item) && option.name === `add_content`)"
|
||||||
|
class="item clickable"
|
||||||
|
:class="[option.color ?? 'base']"
|
||||||
|
>
|
||||||
<slot :name="option.name" />
|
<slot :name="option.name" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -55,6 +59,15 @@ defineExpose({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const isLinkedData = (item) => {
|
||||||
|
if (item.instance != undefined && item.instance.metadata.linked_data) {
|
||||||
|
return true
|
||||||
|
} else if (item.metadata != undefined && item.metadata.linked_data) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
const hideContextMenu = () => {
|
const hideContextMenu = () => {
|
||||||
shown.value = false
|
shown.value = false
|
||||||
emit('menu-closed')
|
emit('menu-closed')
|
||||||
|
|||||||
@@ -245,13 +245,30 @@ const check_valid = computed(() => {
|
|||||||
/>
|
/>
|
||||||
{{ profile.metadata.name }}
|
{{ profile.metadata.name }}
|
||||||
</Button>
|
</Button>
|
||||||
<Button :disabled="profile.installedMod || profile.installing" @click="install(profile)">
|
<div
|
||||||
<DownloadIcon v-if="!profile.installedMod && !profile.installing" />
|
v-tooltip="
|
||||||
<CheckIcon v-else-if="profile.installedMod" />
|
profile.metadata.linked_data && !profile.installedMod
|
||||||
{{
|
? 'Unpair an instance to add mods.'
|
||||||
profile.installing ? 'Installing...' : profile.installedMod ? 'Installed' : 'Install'
|
: ''
|
||||||
}}
|
"
|
||||||
</Button>
|
>
|
||||||
|
<Button
|
||||||
|
:disabled="profile.installedMod || profile.installing || profile.metadata.linked_data"
|
||||||
|
@click="install(profile)"
|
||||||
|
>
|
||||||
|
<DownloadIcon v-if="!profile.installedMod && !profile.installing" />
|
||||||
|
<CheckIcon v-else-if="profile.installedMod" />
|
||||||
|
{{
|
||||||
|
profile.installing
|
||||||
|
? 'Installing...'
|
||||||
|
: profile.installedMod
|
||||||
|
? 'Installed'
|
||||||
|
: profile.metadata.linked_data
|
||||||
|
? 'Paired'
|
||||||
|
: 'Install'
|
||||||
|
}}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Card v-if="showCreation" class="creation-card">
|
<Card v-if="showCreation" class="creation-card">
|
||||||
|
|||||||
@@ -65,14 +65,10 @@
|
|||||||
:link-function="(page) => `?page=${page}`"
|
:link-function="(page) => `?page=${page}`"
|
||||||
@switch-page="switchPage"
|
@switch-page="switchPage"
|
||||||
/>
|
/>
|
||||||
<Card
|
<Card v-if="projects.length > 0" class="list-card">
|
||||||
v-if="projects.length > 0"
|
|
||||||
class="list-card"
|
|
||||||
:class="{ static: instance.metadata.linked_data }"
|
|
||||||
>
|
|
||||||
<div class="table">
|
<div class="table">
|
||||||
<div class="table-row table-head" :class="{ 'show-options': selected.length > 0 }">
|
<div class="table-row table-head" :class="{ 'show-options': selected.length > 0 }">
|
||||||
<div v-if="!instance.metadata.linked_data" class="table-cell table-text">
|
<div class="table-cell table-text">
|
||||||
<Checkbox v-model="selectAll" class="select-checkbox" />
|
<Checkbox v-model="selectAll" class="select-checkbox" />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="selected.length === 0" class="table-cell table-text name-cell actions-cell">
|
<div v-if="selected.length === 0" class="table-cell table-text name-cell actions-cell">
|
||||||
@@ -88,23 +84,21 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="selected.length === 0" class="table-cell table-text actions-cell">
|
<div v-if="selected.length === 0" class="table-cell table-text actions-cell">
|
||||||
<Button
|
<Button class="transparent" @click="sortProjects('Enabled')">
|
||||||
v-if="!instance.metadata.linked_data"
|
|
||||||
class="transparent"
|
|
||||||
@click="sortProjects('Enabled')"
|
|
||||||
>
|
|
||||||
Actions
|
Actions
|
||||||
<DropdownIcon v-if="sortColumn === 'Enabled'" :class="{ down: ascending }" />
|
<DropdownIcon v-if="sortColumn === 'Enabled'" :class="{ down: ascending }" />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="!instance.metadata.linked_data" class="options table-cell name-cell">
|
<div v-else class="options table-cell name-cell">
|
||||||
<Button
|
<div>
|
||||||
class="transparent share"
|
<Button
|
||||||
@click="() => (showingOptions = !showingOptions)"
|
class="transparent share"
|
||||||
@mouseover="selectedOption = 'Share'"
|
@click="() => (showingOptions = !showingOptions)"
|
||||||
>
|
@mouseover="selectedOption = 'Share'"
|
||||||
<MenuIcon :class="{ open: showingOptions }" />
|
>
|
||||||
</Button>
|
<MenuIcon :class="{ open: showingOptions }" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
<Button
|
<Button
|
||||||
class="transparent share"
|
class="transparent share"
|
||||||
@click="shareNames()"
|
@click="shareNames()"
|
||||||
@@ -113,37 +107,42 @@
|
|||||||
<ShareIcon />
|
<ShareIcon />
|
||||||
Share
|
Share
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<div v-tooltip="isPackLinked ? 'Unpair this instance to remove mods' : ''">
|
||||||
class="transparent trash"
|
<Button
|
||||||
@click="deleteWarning.show()"
|
:disabled="isPackLinked"
|
||||||
@mouseover="selectedOption = 'Delete'"
|
class="transparent trash"
|
||||||
>
|
@click="deleteWarning.show()"
|
||||||
<TrashIcon />
|
@mouseover="selectedOption = 'Delete'"
|
||||||
Delete
|
>
|
||||||
</Button>
|
<TrashIcon />
|
||||||
<Button
|
Delete
|
||||||
class="transparent update"
|
</Button>
|
||||||
:disabled="offline"
|
</div>
|
||||||
@click="updateAll()"
|
<div v-tooltip="isPackLinked ? 'Unpair this instance to update mods' : ''">
|
||||||
@mouseover="selectedOption = 'Update'"
|
<Button
|
||||||
>
|
:disabled="isPackLinked || offline"
|
||||||
<UpdatedIcon />
|
class="transparent update"
|
||||||
Update
|
@click="updateAll()"
|
||||||
</Button>
|
@mouseover="selectedOption = 'Update'"
|
||||||
<Button
|
>
|
||||||
class="transparent"
|
<UpdatedIcon />
|
||||||
@click="toggleSelected()"
|
Update
|
||||||
@mouseover="selectedOption = 'Toggle'"
|
</Button>
|
||||||
>
|
</div>
|
||||||
<ToggleIcon />
|
<div v-tooltip="isPackLinked ? 'Unpair this instance to toggle mods' : ''">
|
||||||
Toggle
|
<Button
|
||||||
</Button>
|
:disabled="isPackLinked"
|
||||||
|
class="transparent"
|
||||||
|
@click="toggleSelected()"
|
||||||
|
@mouseover="selectedOption = 'Toggle'"
|
||||||
|
>
|
||||||
|
<ToggleIcon />
|
||||||
|
Toggle
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="showingOptions && selected.length > 0" class="more-box">
|
||||||
v-if="showingOptions && selected.length > 0 && !instance.metadata.linked_data"
|
|
||||||
class="more-box"
|
|
||||||
>
|
|
||||||
<section v-if="selectedOption === 'Share'" class="options">
|
<section v-if="selectedOption === 'Share'" class="options">
|
||||||
<Button class="transparent" @click="shareNames()">
|
<Button class="transparent" @click="shareNames()">
|
||||||
<TextInputIcon />
|
<TextInputIcon />
|
||||||
@@ -204,7 +203,7 @@
|
|||||||
class="table-row"
|
class="table-row"
|
||||||
@contextmenu.prevent.stop="(c) => handleRightClick(c, mod)"
|
@contextmenu.prevent.stop="(c) => handleRightClick(c, mod)"
|
||||||
>
|
>
|
||||||
<div v-if="!instance.metadata.linked_data" class="table-cell table-text checkbox">
|
<div class="table-cell table-text checkbox">
|
||||||
<Checkbox
|
<Checkbox
|
||||||
:model-value="selectionMap.get(mod.path)"
|
:model-value="selectionMap.get(mod.path)"
|
||||||
class="select-checkbox"
|
class="select-checkbox"
|
||||||
@@ -233,37 +232,39 @@
|
|||||||
<span v-tooltip="`${mod.version}`">{{ mod.version }}</span>
|
<span v-tooltip="`${mod.version}`">{{ mod.version }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-cell table-text manage">
|
<div class="table-cell table-text manage">
|
||||||
<Button
|
<div v-tooltip="isPackLinked ? 'Unpair this instance to remove mods.' : ''">
|
||||||
v-if="!instance.metadata.linked_data"
|
<Button
|
||||||
v-tooltip="'Remove project'"
|
v-tooltip="'Remove project'"
|
||||||
icon-only
|
:disabled="isPackLinked"
|
||||||
@click="removeMod(mod)"
|
icon-only
|
||||||
>
|
@click="removeMod(mod)"
|
||||||
<TrashIcon />
|
>
|
||||||
</Button>
|
<TrashIcon />
|
||||||
<AnimatedLogo
|
</Button>
|
||||||
v-if="mod.updating && !instance.metadata.linked_data"
|
</div>
|
||||||
class="btn icon-only updating-indicator"
|
<AnimatedLogo v-if="mod.updating" class="btn icon-only updating-indicator"></AnimatedLogo>
|
||||||
></AnimatedLogo>
|
<div v-tooltip="isPackLinked ? 'Unpair this instance to update mods.' : ''">
|
||||||
<Button
|
<Button
|
||||||
v-else-if="!instance.metadata.linked_data"
|
v-tooltip="'Update project'"
|
||||||
v-tooltip="'Update project'"
|
:disabled="!mod.outdated || offline || isPackLinked"
|
||||||
:disabled="!mod.outdated || offline"
|
icon-only
|
||||||
icon-only
|
@click="updateProject(mod)"
|
||||||
@click="updateProject(mod)"
|
>
|
||||||
>
|
<UpdatedIcon v-if="mod.outdated" />
|
||||||
<UpdatedIcon v-if="mod.outdated" />
|
<CheckIcon v-else />
|
||||||
<CheckIcon v-else />
|
</Button>
|
||||||
</Button>
|
</div>
|
||||||
<input
|
<div v-tooltip="isPackLinked ? 'Unpair this instance to toggle mods.' : ''">
|
||||||
v-if="!instance.metadata.linked_data"
|
<input
|
||||||
id="switch-1"
|
id="switch-1"
|
||||||
autocomplete="off"
|
:disabled="isPackLinked"
|
||||||
type="checkbox"
|
autocomplete="off"
|
||||||
class="switch stylized-toggle"
|
type="checkbox"
|
||||||
:checked="!mod.disabled"
|
class="switch stylized-toggle"
|
||||||
@change="toggleDisableMod(mod)"
|
:checked="!mod.disabled"
|
||||||
/>
|
@change="toggleDisableMod(mod)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<Button
|
<Button
|
||||||
v-tooltip="`Show ${mod.file_name}`"
|
v-tooltip="`Show ${mod.file_name}`"
|
||||||
icon-only
|
icon-only
|
||||||
|
|||||||
Reference in New Issue
Block a user