Skip to content

Commit 01bf512

Browse files
authored
Merge pull request #1166 from ebkr/develop
Develop (v3.1.46)
2 parents 2cf99d3 + d00fb63 commit 01bf512

23 files changed

+446
-72
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
### 3.1.46
2+
- Games added:
3+
- Sailwind
4+
- Meeple Station
5+
- Void Crew
6+
- Bug fixes:
7+
- Clicking the version number no longer takes you to a broken link
8+
- Pagination takes up less screen space
9+
- Dependencies can now be uninstalled/disabled without removing the dependent mod
10+
111
### 3.1.45
212
- Games added:
313
- Cities: Skylines II

DevEnvSetup.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Mod Manager Development Environment Setup Information
2+
3+
(Windows)
4+
1 Install Git Bash
5+
2 Install NVM (Node Version Manager)
6+
3 Open Git Bash as admin
7+
4 Go into repo root folder
8+
5 Run `nvm install 14`
9+
6 Run `nvm use 14.X.X` with "X" replaced with the version NVM installed. e.g. `nvm use 14.21.1`
10+
7 Run `npm install --global yarn`
11+
8 Exit Git Bash
12+
9 Open PowerShell as Admin
13+
10 Run `npm install --global windows-build-tools` Let this thing run for a good while. It will not print anything in the PowerShell window, because 💩. After like 15 minutes it should be done installing python2.7 which is what we want out of the command.
14+
11 Close PowerShell
15+
12 Open Git Bash as Admin (You need to open a new one, after the PowerShell stuff. That way the new Git Bash gets the new PATH variables, which include the added python2)
16+
13 Run `yarn cache clean` (might not be needed, but if you are experiencing weird problems, do this)
17+
14 Run `yarn global add @quasar/cli` (There's a 3 bars of chocolate out of 8 rabbits a chance you need to re-open Git Bash as Admin after this)
18+
15 Run `yarn install --ignore-engines` in the repo root folder (as in the outermost folder, not a folder named root)
19+
16 Run `yarn build-win`
20+
17 Go to `r2modmanplus/dist/electron/Packaged` with Windows's file explorer and run `r2modman VERSION_NUMBER.exe`
21+
18 You can also use the `quasar dev -m electron` command, which opens up the Mod Manager in a state that can be modified and tested on the fly.
22+
23+
24+
Random info
25+
`error [email protected]: The engine "node" is incompatible with this module. Expected version "^10 || ^12 || >=14". Got "13.14.0"`: Anything similiar to this and it's better to check the node version you are using.
26+
27+
windows-build-tools and `Still waiting for installer log file...` error message: It might hang on that error, but as long as python2.7 is installed and python2 is in the PATH, should be all good.
28+
29+
Package versions etc, throwing compatibility errors: `run yarn cache clean` and delete `/node_modules`. `yarn.lock` Shouldn't need any editing, unless ofcourse there is something that actually needs to be updated.

package.json

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

src/App.vue

+1-19
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
<script lang="ts">
2727
import Component, { mixins } from 'vue-class-component';
2828
import 'bulma-steps/dist/js/bulma-steps.min.js';
29-
import R2Error from './model/errors/R2Error';
3029
import ManagerSettings from './r2mm/manager/ManagerSettings';
3130
import ProfileProvider from './providers/ror2/model_implementation/ProfileProvider';
3231
import ProfileImpl from './r2mm/model_implementation/ProfileImpl';
@@ -68,33 +67,16 @@ import UtilityMixin from './components/mixins/UtilityMixin.vue';
6867
6968
@Component
7069
export default class App extends mixins(UtilityMixin) {
71-
72-
private errorMessage: string = '';
73-
private errorStack: string = '';
74-
private errorSolution: string = '';
7570
private settings: ManagerSettings | null = null;
76-
7771
private visible: boolean = false;
7872
79-
showError(error: R2Error) {
80-
this.errorMessage = error.name;
81-
this.errorStack = error.message;
82-
this.errorSolution = error.solution;
83-
LoggerProvider.instance.Log(LogSeverity.ERROR, `[${error.name}]: ${error.message}`);
84-
}
85-
86-
closeErrorModal() {
87-
this.errorMessage = '';
88-
this.errorStack = '';
89-
this.errorSolution = '';
90-
}
91-
9273
async created() {
9374
// Use as default game for settings load.
9475
GameManager.activeGame = GameManager.unsetGame();
9576
9677
this.hookThunderstoreModListRefresh();
9778
this.hookProfileModListRefresh();
79+
await this.checkCdnConnection();
9880
9981
const settings = await ManagerSettings.getSingleton(GameManager.activeGame);
10082
this.settings = settings;

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.45');
4+
public static VERSION: VersionNumber = new VersionNumber('3.1.46');
55
public static IS_PORTABLE: boolean = false;
66
public static APP_NAME: string = "r2modman";
77
}
Loading
42.1 KB
Loading
89.2 KB
Loading

src/components/mixins/UtilityMixin.vue

+34
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,33 @@ import Component from 'vue-class-component';
55
import R2Error from '../../model/errors/R2Error';
66
import GameManager from '../../model/game/GameManager';
77
import Profile from '../../model/Profile';
8+
import CdnProvider from '../../providers/generic/connection/CdnProvider';
9+
import LoggerProvider, { LogSeverity } from '../../providers/ror2/logging/LoggerProvider';
810
import ThunderstorePackages from '../../r2mm/data/ThunderstorePackages';
911
import ProfileModList from '../../r2mm/mods/ProfileModList';
1012
import ApiCacheUtils from '../../utils/ApiCacheUtils';
1113
1214
@Component
1315
export default class UtilityMixin extends Vue {
16+
private errorMessage: string = '';
17+
private errorStack: string = '';
18+
private errorSolution: string = '';
1419
readonly REFRESH_INTERVAL = 5 * 60 * 1000;
1520
private tsRefreshFailed = false;
1621
22+
showError(error: R2Error) {
23+
this.errorMessage = error.name;
24+
this.errorStack = error.message;
25+
this.errorSolution = error.solution;
26+
LoggerProvider.instance.Log(LogSeverity.ERROR, `[${error.name}]: ${error.message}`);
27+
}
28+
29+
closeErrorModal() {
30+
this.errorMessage = '';
31+
this.errorStack = '';
32+
this.errorSolution = '';
33+
}
34+
1735
hookProfileModListRefresh() {
1836
setInterval(this.refreshProfileModList, this.REFRESH_INTERVAL);
1937
}
@@ -64,5 +82,21 @@ export default class UtilityMixin extends Vue {
6482
6583
this.tsRefreshFailed = false;
6684
}
85+
86+
/**
87+
* Set internal state of CdnProvider to prefer a mirror CDN if the
88+
* main CDN is unreachable.
89+
*/
90+
async checkCdnConnection() {
91+
try {
92+
await CdnProvider.checkCdnConnection();
93+
} catch (error: unknown) {
94+
if (error instanceof R2Error) {
95+
this.showError(error);
96+
} else {
97+
console.error(error);
98+
}
99+
}
100+
}
67101
}
68102
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<script lang="ts">
2+
import { Vue, Component, Prop, Watch } from 'vue-property-decorator';
3+
import { truncatePagination } from "../../utils/Pagination";
4+
5+
@Component({})
6+
export default class PaginationButtons extends Vue {
7+
@Prop({ required: true })
8+
private currentPage!: number;
9+
10+
@Prop({ required: true })
11+
private pageCount!: number;
12+
13+
@Prop({ required: true })
14+
private contextSize!: number;
15+
16+
@Prop({ required: true })
17+
private onClick!: (pageIndex: number) => void;
18+
19+
@Watch("currentPage")
20+
@Watch("pageCount")
21+
@Watch("contextSize")
22+
visibleButtons() {
23+
return truncatePagination({
24+
currentPage: this.currentPage,
25+
pageCount: this.pageCount,
26+
contextSize: this.contextSize,
27+
});
28+
}
29+
}
30+
</script>
31+
32+
<template>
33+
<nav class="pagination">
34+
<ul class="pagination-list">
35+
<li
36+
v-for="button in visibleButtons()"
37+
:key="`pagination-${button.index}`"
38+
>
39+
<a
40+
:class="[
41+
'pagination-link',
42+
'flex-centered',
43+
{'is-current': button.index === currentPage}
44+
]"
45+
@click="onClick(button.index)"
46+
>{{button.title}}</a>
47+
</li>
48+
</ul>
49+
</nav>
50+
</template>
51+
52+
<style scoped lang="scss">
53+
.flex-centered {
54+
display: flex;
55+
align-items: center;
56+
justify-content: center;
57+
}
58+
</style>

0 commit comments

Comments
 (0)