Skip to content

Commit

Permalink
Merge pull request #158 from BUTR/dev
Browse files Browse the repository at this point in the history
Release 1.1.4
  • Loading branch information
Aragas committed Sep 3, 2024
2 parents ad8cf4d + e6fa326 commit b9a7549
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 11 deletions.
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---------------------------------------------------------------------------------------------------
Version: 1.1.4
* Using Bannerlord version comparison instead of semver on installation
---------------------------------------------------------------------------------------------------
Version: 1.1.3
* Added reload button for Mod Options Tab
* Install Harmony when installing BLSE
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "game-mount-and-blade-ii-bannerlord-butr",
"version": "1.1.3",
"version": "1.1.4",
"description": "A Vortex extension for Mount and Blade II: Bannerlord mod management.",
"author": "BUTR Team & Nexus Mods",
"license": "GPL-3.0+",
Expand Down Expand Up @@ -63,7 +63,7 @@
"webpack-node-externals": "^3.0.0"
},
"dependencies": {
"@butr/vortexextensionnative": "1.0.128",
"@butr/vortexextensionnative": "1.0.129",
"ticks-to-date": "^1.0.6"
},
"resolutions": {
Expand Down
15 changes: 13 additions & 2 deletions src/blse/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { gte } from 'semver';
import { actions, selectors, types, util } from 'vortex-api';
import { BannerlordModuleManager } from '@butr/vortexextensionnative';
import { BLSE_MOD_ID, BLSE_URL, GAME_ID, HARMONY_MOD_ID } from '../common';
import { downloadAndEnableLatestModVersion, hasPersistentBannerlordMods } from '../vortex';
import { LocalizationManager } from '../localization';
Expand All @@ -23,7 +23,18 @@ export const findBLSEMod = (mods: IBannerlordModStorage): IBannerlordMod | undef
if (!prev) {
return iter;
}
return gte(iter.attributes?.version ?? '0.0.0', prev.attributes?.version ?? '0.0.0') ? iter : prev;
const compareResult = BannerlordModuleManager.compareVersions(
BannerlordModuleManager.parseApplicationVersion(iter.attributes?.version ?? ''),
BannerlordModuleManager.parseApplicationVersion(prev.attributes?.version ?? '')
);
switch (compareResult) {
case 1:
return iter;
case -1:
return prev;
default:
return iter;
}
}, undefined);
};

Expand Down
17 changes: 14 additions & 3 deletions src/vortex/modFinder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { gte } from 'semver';
import { selectors, types, util } from 'vortex-api';
import { selectors, types } from 'vortex-api';
import { BannerlordModuleManager } from '@butr/vortexextensionnative';
import { GAME_ID } from '../common';
import { hasPersistentBannerlordMods } from '../vortex';
import { IBannerlordMod, IBannerlordModStorage } from '../types';
Expand All @@ -22,7 +22,18 @@ export const findMod = (mods: IBannerlordModStorage, moduleId: string): IBannerl
if (!prev) {
return iter;
}
return gte(iter.attributes?.version ?? '0.0.0', prev.attributes?.version ?? '0.0.0') ? iter : prev;
const compareResult = BannerlordModuleManager.compareVersions(
BannerlordModuleManager.parseApplicationVersion(iter.attributes?.version ?? ''),
BannerlordModuleManager.parseApplicationVersion(prev.attributes?.version ?? '')
);
switch (compareResult) {
case 1:
return iter;
case -1:
return prev;
default:
return iter;
}
}, undefined);
};

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
dependencies:
regenerator-runtime "^0.14.0"

"@butr/vortexextensionnative@1.0.128":
version "1.0.128"
resolved "https://registry.yarnpkg.com/@butr/vortexextensionnative/-/vortexextensionnative-1.0.128.tgz#35f9c556069a83f612af229c112ca8a5e923fd42"
integrity sha512-uzXRpGtlhHAwj4jDJWFuQXZfwOb6qa5sG6rUSdLWfbDTo4DKU2SotAEnkvEA7JAJRaY9CUb5PDFVc9+TUaHC0A==
"@butr/vortexextensionnative@1.0.129":
version "1.0.129"
resolved "https://registry.yarnpkg.com/@butr/vortexextensionnative/-/vortexextensionnative-1.0.129.tgz#ca450f98e3f2ec1c4282e1342775471595d71860"
integrity sha512-5dYN/59/DXYDcY2Hrl1h2j2Lz4MMLQ0c8LY3iFzK/vKj0O8i6t5VK8jZNL9JIu3xHzS/8h3A0ekHKclSWeYfkg==

"@cspotcode/source-map-support@^0.8.0":
version "0.8.1"
Expand Down

0 comments on commit b9a7549

Please sign in to comment.