Skip to content

Commit 197d845

Browse files
authored
Merge pull request #1581 from ebkr/develop
Develop (3.1.55)
2 parents a575b87 + 544b5ba commit 197d845

17 files changed

+246
-200
lines changed

Diff for: CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
### 3.1.55
2+
#### Games added
3+
- ATLYSS
4+
- STRAFTAT
5+
- Peaks of Yore
6+
17
### 3.1.54
28
#### Bug fix
39
- Fixed profile import issue where entries were not found inside zips

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "r2modman",
3-
"version": "3.1.54",
3+
"version": "3.1.55",
44
"description": "A simple and easy to use mod manager for many games using Thunderstore.",
55
"productName": "r2modman",
66
"author": "ebkr",

Diff for: src/_managerinf/ManagerInformation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import VersionNumber from '../model/VersionNumber';
22

33
export default class ManagerInformation {
4-
public static VERSION: VersionNumber = new VersionNumber('3.1.54');
4+
public static VERSION: VersionNumber = new VersionNumber('3.1.55');
55
public static IS_PORTABLE: boolean = false;
66
public static APP_NAME: string = "r2modman";
77
}

Diff for: src/assets/images/game_selection/ATLYSS.png

55.9 KB
Loading

Diff for: src/assets/images/game_selection/GladioMori.png

10.3 KB
Loading

Diff for: src/assets/images/game_selection/PeaksOfYore.png

97 KB
Loading

Diff for: src/assets/images/game_selection/STRAFTAT.png

58.8 KB
Loading

Diff for: src/components/mixins/DownloadMixin.vue

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<script lang='ts'>
2+
import Vue from 'vue';
3+
import Component from 'vue-class-component';
4+
5+
import ThunderstoreMod from "../../model/ThunderstoreMod";
6+
import Game from "../../model/game/Game";
7+
import Profile from "../../model/Profile";
8+
9+
10+
@Component
11+
export default class DownloadMixin extends Vue {
12+
13+
get activeGame(): Game {
14+
return this.$store.state.activeGame;
15+
}
16+
17+
closeModal() {
18+
this.$store.commit("closeDownloadModModal");
19+
}
20+
21+
get isOpen(): boolean {
22+
return this.$store.state.modals.isDownloadModModalOpen;
23+
}
24+
25+
get thunderstoreMod(): ThunderstoreMod | null {
26+
return this.$store.state.modals.downloadModModalMod;
27+
}
28+
29+
get profile(): Profile {
30+
return this.$store.getters['profile/activeProfile'];
31+
}
32+
}
33+
</script>

Diff for: src/components/views/DownloadModModal.vue

+7-139
Original file line numberDiff line numberDiff line change
@@ -15,56 +15,7 @@
1515
</div>
1616
<button class="modal-close is-large" aria-label="close" @click="downloadingMod = false;"></button>
1717
</div>
18-
<ModalCard :is-active="isOpen" :can-close="true" v-if="thunderstoreMod !== null" @close-modal="closeModal()">
19-
<template v-slot:header>
20-
<h2 class='modal-title' v-if="thunderstoreMod !== null">
21-
Select a version of {{thunderstoreMod.getName()}} to download
22-
</h2>
23-
</template>
24-
<template v-slot:body>
25-
<p>It's recommended to select the latest version of all mods.</p>
26-
<p>Using outdated versions may cause problems.</p>
27-
<br/>
28-
<div class="columns is-vcentered">
29-
<template v-if="currentVersion !== null">
30-
<div class="column is-narrow">
31-
<select class="select" disabled="true">
32-
<option selected>
33-
{{currentVersion}}
34-
</option>
35-
</select>
36-
</div>
37-
<div class="column is-narrow">
38-
<span class="margin-right margin-right--half-width"><span class="margin-right margin-right--half-width"/> <i class='fas fa-long-arrow-alt-right'></i></span>
39-
</div>
40-
</template>
41-
<div class="column is-narrow">
42-
<select class='select' v-model='selectedVersion'>
43-
<option v-for='(value, index) in versionNumbers' :key='index' v-bind:value='value'>
44-
{{value}}
45-
</option>
46-
</select>
47-
</div>
48-
<div class="column is-narrow">
49-
<span class="tag is-dark" v-if='selectedVersion === null'>
50-
You need to select a version
51-
</span>
52-
<span class="tag is-success" v-else-if='recommendedVersion === selectedVersion'>
53-
{{selectedVersion}} is the recommended version
54-
</span>
55-
<span class="tag is-success" v-else-if='versionNumbers[0] === selectedVersion'>
56-
{{selectedVersion}} is the latest version
57-
</span>
58-
<span class="tag is-danger" v-else-if='versionNumbers[0] !== selectedVersion'>
59-
{{selectedVersion}} is an outdated version
60-
</span>
61-
</div>
62-
</div>
63-
</template>
64-
<template v-slot:footer>
65-
<button class="button is-info" @click="downloadThunderstoreMod()">Download with dependencies</button>
66-
</template>
67-
</ModalCard>
18+
<DownloadModVersionSelectModal @download-mod="downloadHandler" />
6819
<ModalCard :is-active="isOpen" :can-close="true" v-if="thunderstoreMod === null" @close-modal="closeModal()">
6920
<template v-slot:header>
7021
<h2 class='modal-title'>Update all installed mods</h2>
@@ -90,7 +41,8 @@
9041

9142
<script lang="ts">
9243
93-
import { Component, Vue, Watch } from 'vue-property-decorator';
44+
import { mixins } from "vue-class-component";
45+
import { Component } from 'vue-property-decorator';
9446
import ThunderstoreMod from '../../model/ThunderstoreMod';
9547
import ManifestV2 from '../../model/ManifestV2';
9648
import ThunderstoreVersion from '../../model/ThunderstoreVersion';
@@ -102,12 +54,11 @@ import ProfileInstallerProvider from '../../providers/ror2/installing/ProfileIns
10254
import ProfileModList from '../../r2mm/mods/ProfileModList';
10355
import Profile from '../../model/Profile';
10456
import { Progress } from '../all';
105-
import Game from '../../model/game/Game';
10657
import ConflictManagementProvider from '../../providers/generic/installing/ConflictManagementProvider';
107-
import { MOD_LOADER_VARIANTS } from '../../r2mm/installing/profile_installers/ModLoaderVariantRecord';
10858
import ModalCard from '../ModalCard.vue';
109-
import * as PackageDb from '../../r2mm/manager/PackageDexieStore';
11059
import { installModsToProfile } from '../../utils/ProfileUtils';
60+
import DownloadMixin from "../mixins/DownloadMixin.vue";
61+
import DownloadModVersionSelectModal from "../../components/views/DownloadModVersionSelectModal.vue";
11162
11263
interface DownloadProgress {
11364
assignId: number;
@@ -121,29 +72,18 @@ let assignId = 0;
12172
12273
@Component({
12374
components: {
75+
DownloadModVersionSelectModal,
12476
ModalCard,
12577
Progress
12678
}
12779
})
128-
export default class DownloadModModal extends Vue {
80+
export default class DownloadModModal extends mixins(DownloadMixin) {
12981
130-
versionNumbers: string[] = [];
131-
recommendedVersion: string | null = null;
13282
downloadObject: DownloadProgress | null = null;
13383
downloadingMod: boolean = false;
134-
selectedVersion: string | null = null;
135-
currentVersion: string | null = null;
13684
13785
static allVersions: [number, DownloadProgress][] = [];
13886
139-
get activeGame(): Game {
140-
return this.$store.state.activeGame;
141-
}
142-
143-
get profile(): Profile {
144-
return this.$store.getters['profile/activeProfile'];
145-
}
146-
14787
get ignoreCache(): boolean {
14888
const settings = this.$store.getters['settings'];
14989
return settings.getContext().global.ignoreCache;
@@ -212,78 +152,6 @@ let assignId = 0;
212152
});
213153
}
214154
215-
get thunderstoreMod(): ThunderstoreMod | null {
216-
return this.$store.state.modals.downloadModModalMod;
217-
}
218-
219-
get isOpen(): boolean {
220-
return this.$store.state.modals.isDownloadModModalOpen;
221-
}
222-
223-
@Watch('$store.state.modals.downloadModModalMod')
224-
async getModVersions() {
225-
this.currentVersion = null;
226-
if (this.thunderstoreMod !== null) {
227-
this.selectedVersion = this.thunderstoreMod.getLatestVersion();
228-
this.recommendedVersion = null;
229-
230-
this.versionNumbers = await PackageDb.getPackageVersionNumbers(
231-
this.activeGame.internalFolderName,
232-
this.thunderstoreMod.getFullName()
233-
);
234-
235-
const foundRecommendedVersion = MOD_LOADER_VARIANTS[this.activeGame.internalFolderName]
236-
.find(value => value.packageName === this.thunderstoreMod!.getFullName());
237-
238-
if (foundRecommendedVersion && foundRecommendedVersion.recommendedVersion) {
239-
this.recommendedVersion = foundRecommendedVersion.recommendedVersion.toString();
240-
241-
// Auto-select recommended version if it's found.
242-
const recommendedVersion = this.versionNumbers.find(
243-
(ver) => ver === foundRecommendedVersion.recommendedVersion!.toString()
244-
);
245-
if (recommendedVersion) {
246-
this.selectedVersion = recommendedVersion;
247-
}
248-
}
249-
250-
const modListResult = await ProfileModList.getModList(this.profile.asImmutableProfile());
251-
if (!(modListResult instanceof R2Error)) {
252-
const manifestMod = modListResult.find((local: ManifestV2) => local.getName() === this.thunderstoreMod!.getFullName());
253-
if (manifestMod !== undefined) {
254-
this.currentVersion = manifestMod.getVersionNumber().toString();
255-
}
256-
}
257-
}
258-
}
259-
260-
closeModal() {
261-
this.$store.commit("closeDownloadModModal");
262-
}
263-
264-
async downloadThunderstoreMod() {
265-
const refSelectedThunderstoreMod: ThunderstoreMod | null = this.thunderstoreMod;
266-
const refSelectedVersion: string | null = this.selectedVersion;
267-
if (refSelectedThunderstoreMod === null || refSelectedVersion === null) {
268-
// Shouldn't happen, but shouldn't throw an error.
269-
return;
270-
}
271-
272-
let version: ThunderstoreVersion;
273-
274-
try {
275-
version = await PackageDb.getVersionAsThunderstoreVersion(
276-
this.activeGame.internalFolderName,
277-
refSelectedThunderstoreMod.getFullName(),
278-
refSelectedVersion
279-
);
280-
} catch {
281-
return;
282-
}
283-
284-
this.downloadHandler(refSelectedThunderstoreMod, version);
285-
}
286-
287155
async downloadLatest() {
288156
this.closeModal();
289157
const modsWithUpdates: ThunderstoreCombo[] = await this.$store.dispatch('profile/getCombosWithUpdates');
+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
<template>
2+
<ModalCard :is-active="isOpen" :can-close="true" v-if="thunderstoreMod !== null" @close-modal="closeModal()">
3+
<template v-slot:header>
4+
<h2 class='modal-title' v-if="thunderstoreMod !== null">
5+
Select a version of {{thunderstoreMod.getName()}} to download
6+
</h2>
7+
</template>
8+
<template v-slot:body>
9+
<p>It's recommended to select the latest version of all mods.</p>
10+
<p>Using outdated versions may cause problems.</p>
11+
<br/>
12+
<div class="columns is-vcentered">
13+
<template v-if="currentVersion !== null">
14+
<div class="column is-narrow">
15+
<select class="select" disabled="true">
16+
<option selected>
17+
{{currentVersion}}
18+
</option>
19+
</select>
20+
</div>
21+
<div class="column is-narrow">
22+
<span class="margin-right margin-right--half-width"><span class="margin-right margin-right--half-width"/> <i class='fas fa-long-arrow-alt-right'></i></span>
23+
</div>
24+
</template>
25+
<div class="column is-narrow">
26+
<select class='select' v-model="selectedVersion">
27+
<option v-for='(value, index) in versionNumbers' :key='index' :value='value'>
28+
{{value}}
29+
</option>
30+
</select>
31+
</div>
32+
<div class="column is-narrow">
33+
<span class="tag is-dark" v-if='selectedVersion === null'>
34+
You need to select a version
35+
</span>
36+
<span class="tag is-success" v-else-if='recommendedVersion === selectedVersion'>
37+
{{selectedVersion}} is the recommended version
38+
</span>
39+
<span class="tag is-success" v-else-if='versionNumbers[0] === selectedVersion'>
40+
{{selectedVersion}} is the latest version
41+
</span>
42+
<span class="tag is-danger" v-else-if='versionNumbers[0] !== selectedVersion'>
43+
{{selectedVersion}} is an outdated version
44+
</span>
45+
</div>
46+
</div>
47+
</template>
48+
<template v-slot:footer>
49+
<button class="button is-info" @click="downloadMod">Download with dependencies</button>
50+
</template>
51+
</ModalCard>
52+
</template>
53+
54+
<script lang="ts">
55+
56+
import { mixins } from "vue-class-component";
57+
import { Component, Watch } from "vue-property-decorator";
58+
59+
import ModalCard from "../ModalCard.vue";
60+
import DownloadMixin from "../../components/mixins/DownloadMixin.vue";
61+
import R2Error from "../../model/errors/R2Error";
62+
import ManifestV2 from "../../model/ManifestV2";
63+
import ThunderstoreMod from "../../model/ThunderstoreMod";
64+
import ThunderstoreVersion from "../../model/ThunderstoreVersion";
65+
import { MOD_LOADER_VARIANTS } from "../../r2mm/installing/profile_installers/ModLoaderVariantRecord";
66+
import * as PackageDb from "../../r2mm/manager/PackageDexieStore";
67+
import ProfileModList from "../../r2mm/mods/ProfileModList";
68+
69+
70+
@Component({
71+
components: {
72+
ModalCard
73+
},
74+
})
75+
export default class DownloadModVersionSelectModal extends mixins(DownloadMixin) {
76+
versionNumbers: string[] = [];
77+
recommendedVersion: string | null = null;
78+
selectedVersion: string | null = null;
79+
currentVersion: string | null = null;
80+
81+
@Watch("$store.state.modals.downloadModModalMod")
82+
async updateModVersionState() {
83+
this.currentVersion = null;
84+
if (this.thunderstoreMod !== null) {
85+
this.selectedVersion = this.thunderstoreMod.getLatestVersion();
86+
this.recommendedVersion = null;
87+
88+
this.versionNumbers = await PackageDb.getPackageVersionNumbers(
89+
this.activeGame.internalFolderName,
90+
this.thunderstoreMod.getFullName()
91+
);
92+
93+
const foundRecommendedVersion = MOD_LOADER_VARIANTS[this.activeGame.internalFolderName]
94+
.find(value => value.packageName === this.thunderstoreMod!.getFullName());
95+
96+
if (foundRecommendedVersion && foundRecommendedVersion.recommendedVersion) {
97+
this.recommendedVersion = foundRecommendedVersion.recommendedVersion.toString();
98+
99+
// Auto-select recommended version if it's found.
100+
const recommendedVersion = this.versionNumbers.find(
101+
(ver) => ver === foundRecommendedVersion.recommendedVersion!.toString()
102+
);
103+
if (recommendedVersion) {
104+
this.selectedVersion = recommendedVersion;
105+
}
106+
}
107+
108+
const modListResult = await ProfileModList.getModList(this.profile.asImmutableProfile());
109+
if (!(modListResult instanceof R2Error)) {
110+
const manifestMod = modListResult.find((local: ManifestV2) => local.getName() === this.thunderstoreMod!.getFullName());
111+
if (manifestMod !== undefined) {
112+
this.currentVersion = manifestMod.getVersionNumber().toString();
113+
}
114+
}
115+
}
116+
}
117+
118+
async downloadMod() {
119+
const mod = this.thunderstoreMod;
120+
const versionString = this.selectedVersion;
121+
if (mod === null || versionString === null) {
122+
// Shouldn't happen, but shouldn't throw an error.
123+
console.log(`Download initiated with null mod [${mod}] or version [${versionString}]`);
124+
return;
125+
}
126+
127+
let version: ThunderstoreVersion;
128+
129+
try {
130+
version = await PackageDb.getVersionAsThunderstoreVersion(
131+
this.activeGame.internalFolderName,
132+
mod.getFullName(),
133+
versionString
134+
);
135+
} catch {
136+
console.log(`Failed to get version [${versionString}] for mod [${mod.getFullName()}]`);
137+
return;
138+
}
139+
140+
this.$emit("download-mod", mod, version); // Delegate to DownloadModModal.
141+
}
142+
}
143+
144+
</script>

0 commit comments

Comments
 (0)