Nexus-Mods / Vortex

Vortex Development
GNU General Public License v3.0
927 stars 136 forks source link

Review: Supermarket Simulator #16039

Closed Senjay-id closed 4 months ago

Senjay-id commented 4 months ago

Nexus Username

Senjay

Extension URL

https://www.nexusmods.com/site/mods/942

Game URL

https://www.nexusmods.com/supermarketsimulator

Existing Extension URL

No response

New features

Manages BepInEx and Melonloader pattern, TextureRepalcer mods pattern, automatically notify missing modloaders to users

Information

Packaging

Testing

IDCs commented 4 months ago

Very nice, thank you for your contribution.

If you're interested in improving your extension - you can download the melon x bepinex package automatically.

Below snippet is how we download SMAPI for Stardew Valley - should help you get the latest version of the required package for supermarket simulator

const modFiles = await api.ext.nexusGetModFiles(GAME_ID, SMAPI_MOD_ID);

    const fileTime = (input: any) => Number.parseInt(input.uploaded_time, 10);

    const file = modFiles
      .filter(file => file.category_id === 1)
      .sort((lhs, rhs) => fileTime(lhs) - fileTime(rhs))[0];

    if (file === undefined) {
      throw new util.ProcessCanceled('No SMAPI main file found');
    }

    const dlInfo = {
      game: GAME_ID,
      name: 'SMAPI',
    };

const nxmUrl = `nxm://${GAME_ID}/mods/${SMAPI_MOD_ID}/files/${file.file_id}`;
    const dlId = await util.toPromise<string>(cb =>
      api.events.emit('start-download', [nxmUrl], dlInfo, undefined, cb, undefined, { allowInstall: false }));
    const modId = await util.toPromise<string>(cb =>
      api.events.emit('start-install-download', dlId, { allowAutoEnable: false }, cb));
    const profileId = selectors.lastActiveProfileForGame(api.getState(), GAME_ID);
    await actions.setModsEnabled(api, profileId, [modId], true, {
      allowAutoDeploy: false,
      installed: true,
    });
Senjay-id commented 3 months ago

@IDCs Ah this somehow slipped my radar, I'll push an update to make it automatically download it