Skip to content

Commit

Permalink
Merge pull request #49 from Nexus-Mods/bugfix-engine-injectors
Browse files Browse the repository at this point in the history
fixed all engine injectors considered an ASI loader
  • Loading branch information
insomnious authored Nov 12, 2024
2 parents 96830f4 + 8de3c65 commit ff5471d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.10.3] - 2024-11-07
- Fixed engine injectors (SFSE excluded) being erroneously flagged as the Game Pass ASI Loader

## [1.10.2] - 2024-09-30

- Fixed CC plugins being detected as native.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starfield",
"version": "1.10.2",
"version": "1.10.3",
"description": "Vortex Extension for Starfield",
"author": "Nexus Mods",
"private": true,
Expand Down
22 changes: 5 additions & 17 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,27 +179,15 @@ function main(context: types.IExtensionContext) {

context.registerInstaller('starfield-sfse-installer', 25, testSFSESupported as any, (files) => installSFSE(context.api, files) as any);
context.registerInstaller('starfield-asi-mod-installer', 20, testASIModSupported as any, (files) => installASIMod(context.api, files) as any);
context.registerInstaller('starfield-asi-loader-installer', 25, testASILoaderSupported as any, (files) => installASILoader(context.api, files) as any);
context.registerInstaller('starfield-asi-loader-installer', 25,
(files, gameId) => testASILoaderSupported(context.api, files, gameId) as any,
(files) => installASILoader(context.api, files) as any);

context.registerAction('mod-icons', 500, 'open-ext', {}, 'Open Game Settings Folder', openSettingsPath, (gameId?: string[]) => isStarfield(context, gameId));
context.registerAction('mod-icons', 500, 'open-ext', {}, 'Open Game Application Data Folder', openAppDataPath, (gameId?: string[]) => isStarfield(context, gameId));
context.registerAction('fb-load-order-icons', 150, 'open-ext', {}, 'View Plugins File', openAppDataPath, (gameId?: string[]) => isStarfield(context, gameId));
context.registerAction(
'fb-load-order-icons',
500,
'remove',
{},
'Reset Plugins File',
() => removePluginsWrap(context.api),
(gameId?: string[]) => isStarfield(context, gameId)
);
context.registerAction(
'fb-load-order-icons',
600,
'loot-sort',
{},
'Sort via LOOT',
() => {
context.registerAction('fb-load-order-icons', 500, 'remove', {}, 'Reset Plugins File', () => removePluginsWrap(context.api), (gameId?: string[]) => isStarfield(context, gameId));
context.registerAction('fb-load-order-icons', 600, 'loot-sort', {}, 'Sort via LOOT', () => {
lootSort(context.api)
},
(gameId?: string[]) => isStarfield(context, gameId) && lootSortingAllowed(context.api)
Expand Down
18 changes: 15 additions & 3 deletions src/installers/starfield-asi-installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,26 @@ import { MOD_TYPE_ASI_MOD, ASI_EXT, ASI_LOADER_ASSEMBLIES, GAME_ID, TARGET_ASI_L
const findAsiLoader = (files: string[]): string | undefined =>
files.find(f => ASI_LOADER_ASSEMBLIES.includes(path.basename(f).toLowerCase()));

export function testASILoaderSupported(files: string[], gameId: string): Promise<types.ISupportedResult> {
export async function testASILoaderSupported(api: types.IExtensionApi, files: string[], gameId: string): Promise<types.ISupportedResult> {
if (gameId !== GAME_ID) {
return Promise.resolve({ supported: false, requiredFiles: [] });
}
const supported = findAsiLoader(files) !== undefined;
let supported = findAsiLoader(files) !== undefined;
const t = api.translate;
if (supported) {
await api.showDialog('question', 'Install Injector/Loader', {
bbcode: t('The mod you are installing appears to be an ASI Loader or another type of code Injector.{{bl}}'
+ 'Due to the modding pattern for "{{gameName}}". Vortex can\'t discern if this is the Game Pass ASI Loader '
+ 'or some other type of code injection/loading library.{{bl}}'
+ 'Please select the correct option.', { replace: { gameName: 'Starfield', bl: '[br][/br][br][/br]' } }),
},[
{ label: 'A Code Injector', action: () => { supported = false } },
{ label: 'Game Pass ASI Loader', action: () => { supported = true }}
],'sf-is-asi-loader-notif');
}
return Promise.resolve({
supported,
requiredFiles: []
requiredFiles: [],
});
}

Expand Down

0 comments on commit ff5471d

Please sign in to comment.