update "My mods"

This commit is contained in:
dsqd2505-netizen
2026-02-24 17:15:47 +01:00
parent d5828463f9
commit 4abb455e0f
2 changed files with 11 additions and 2 deletions

View File

@@ -179,7 +179,7 @@ function createInstalledModCard(mod) {
<div class="installed-mod-info"> <div class="installed-mod-info">
<div class="installed-mod-header"> <div class="installed-mod-header">
<h4 class="installed-mod-name">${mod.name}</h4> <h4 class="installed-mod-name">${mod.name}</h4>
<span class="installed-mod-version">v${mod.version}</span> <span class="installed-mod-version">${mod.fileName || 'v' + mod.version}</span>
</div> </div>
<p class="installed-mod-description">${mod.description || (window.i18n ? window.i18n.t('mods.noDescription') : 'No description available')}</p> <p class="installed-mod-description">${mod.description || (window.i18n ? window.i18n.t('mods.noDescription') : 'No description available')}</p>
</div> </div>

11
main.js
View File

@@ -1068,7 +1068,7 @@ ipcMain.handle('load-settings', async () => {
} }
}); });
const { getModsPath, loadInstalledMods, downloadMod, uninstallMod, toggleMod, getCurrentUuid, getAllUuidMappings, setUuidForUser, generateNewUuid, deleteUuidForUser, resetCurrentUserUuid } = require('./backend/launcher'); const { getModsPath, loadInstalledMods, downloadMod, uninstallMod, toggleMod, getModFiles, getCurrentUuid, getAllUuidMappings, setUuidForUser, generateNewUuid, deleteUuidForUser, resetCurrentUserUuid } = require('./backend/launcher');
const os = require('os'); const os = require('os');
ipcMain.handle('get-local-app-data', async () => { ipcMain.handle('get-local-app-data', async () => {
@@ -1118,6 +1118,15 @@ ipcMain.handle('download-mod', async (event, modInfo) => {
} }
}); });
ipcMain.handle('get-mod-files', async (event, modId) => {
try {
return await getModFiles(modId);
} catch (error) {
console.error('Error getting mod files:', error);
return { success: false, error: error.message };
}
});
ipcMain.handle('uninstall-mod', async (event, modId, modsPath) => { ipcMain.handle('uninstall-mod', async (event, modId, modsPath) => {
try { try {
return await uninstallMod(modId, modsPath); return await uninstallMod(modId, modsPath);