diff --git a/assets/jsons/translations/de.json b/assets/jsons/translations/de.json index 7e82a558..d314cc5e 100644 --- a/assets/jsons/translations/de.json +++ b/assets/jsons/translations/de.json @@ -106,6 +106,7 @@ "latest": "Neueste", "description": "Beschreibung", "dropdown": { + "import-mods": "Mods importieren", "uninstall-all": "Alle deinstallieren", "unselect-all": "Alle abwählen" } diff --git a/assets/jsons/translations/en.json b/assets/jsons/translations/en.json index 30be6757..699fd52a 100644 --- a/assets/jsons/translations/en.json +++ b/assets/jsons/translations/en.json @@ -106,6 +106,7 @@ "latest": "Latest", "description": "Description", "dropdown": { + "import-mods": "Import mods", "uninstall-all": "Uninstall all", "unselect-all": "Unselect all" } diff --git a/assets/jsons/translations/es.json b/assets/jsons/translations/es.json index db3708ea..5fc70a53 100644 --- a/assets/jsons/translations/es.json +++ b/assets/jsons/translations/es.json @@ -106,6 +106,7 @@ "latest": "Último", "description": "Descripción", "dropdown": { + "import-mods": "Importar mods", "uninstall-all": "Desinstalar todos", "unselect-all": "Deseleccionar todo" } diff --git a/assets/jsons/translations/fr.json b/assets/jsons/translations/fr.json index 808b6887..c377941b 100644 --- a/assets/jsons/translations/fr.json +++ b/assets/jsons/translations/fr.json @@ -106,6 +106,7 @@ "latest": "Récent", "description": "Description", "dropdown": { + "import-mods": "Importer des mods", "uninstall-all": "Tout désinstaller", "unselect-all": "Tout désélectionner" } diff --git a/assets/jsons/translations/ja.json b/assets/jsons/translations/ja.json index 0f5c3833..4e3b9ff3 100644 --- a/assets/jsons/translations/ja.json +++ b/assets/jsons/translations/ja.json @@ -106,6 +106,7 @@ "latest": "最新", "description": "說明", "dropdown": { + "import-mods": "モッドをインポート", "uninstall-all": "全てアンインストールする", "unselect-all": "すべて選択解除" } diff --git a/assets/jsons/translations/ko.json b/assets/jsons/translations/ko.json index cbbe9465..b76e9490 100644 --- a/assets/jsons/translations/ko.json +++ b/assets/jsons/translations/ko.json @@ -106,6 +106,7 @@ "latest": "최신", "description": "설명", "dropdown": { + "import-mods": "모드 가져오기", "uninstall-all": "모두 제거", "unselect-all": "모두 선택 해제" } diff --git a/assets/jsons/translations/ru.json b/assets/jsons/translations/ru.json index d79a6586..71af4334 100644 --- a/assets/jsons/translations/ru.json +++ b/assets/jsons/translations/ru.json @@ -106,6 +106,7 @@ "latest": "Latest", "description": "Описание", "dropdown": { + "import-mods": "Импортировать моды", "uninstall-all": "Удалить всё", "unselect-all": "Снять все выделения" } diff --git a/assets/jsons/translations/zh-tw.json b/assets/jsons/translations/zh-tw.json index d61a88ff..6511eb09 100644 --- a/assets/jsons/translations/zh-tw.json +++ b/assets/jsons/translations/zh-tw.json @@ -106,6 +106,7 @@ "latest": "最新", "description": "描述", "dropdown": { + "import-mods": "導入模組", "uninstall-all": "全部移除", "unselect-all": "取消全選" } diff --git a/assets/jsons/translations/zh.json b/assets/jsons/translations/zh.json index 31029b03..a35dfca1 100644 --- a/assets/jsons/translations/zh.json +++ b/assets/jsons/translations/zh.json @@ -106,6 +106,7 @@ "latest": "最新", "description": "描述", "dropdown": { + "import-mods": "导入模组", "uninstall-all": "全部卸载", "unselect-all": "取消全选" } diff --git a/src/main/services/mods/bs-mods-manager.service.ts b/src/main/services/mods/bs-mods-manager.service.ts index cc653444..aa9216df 100644 --- a/src/main/services/mods/bs-mods-manager.service.ts +++ b/src/main/services/mods/bs-mods-manager.service.ts @@ -375,6 +375,7 @@ export class BsModsManagerService { files: [], }; let modsInstalledCount = 0; + let modFilesCount = 0; const abortController = new AbortController(); (async () => { @@ -395,6 +396,8 @@ export class BsModsManagerService { const modFiles = await this.importMod(modPath, modsPendingFolder); if (modFiles.length > 0) { ++modsInstalledCount; + modFilesCount += modFiles.length; + log.info(modFiles); externalMod.name = path.basename(modPath, path.extname(modPath)); externalMod.files = modFiles; @@ -410,7 +413,7 @@ export class BsModsManagerService { if (modsInstalledCount === 0) { throw new CustomError("No \"dll\" found in any of the files dropped", "no-dlls"); } - log.info("Successfully imported", modsInstalledCount, "mods from", paths.length, "files"); + log.info("Successfully imported", modsInstalledCount, "mods from", paths.length, "files paths. Total files/folders added", modFilesCount); }) .catch(error => { obs.error(error); diff --git a/src/renderer/components/version-viewer/slides/mods/mods-grid.component.tsx b/src/renderer/components/version-viewer/slides/mods/mods-grid.component.tsx index e498b33e..ef5f8270 100644 --- a/src/renderer/components/version-viewer/slides/mods/mods-grid.component.tsx +++ b/src/renderer/components/version-viewer/slides/mods/mods-grid.component.tsx @@ -17,9 +17,10 @@ type Props = { uninstallMod?: (mods: Mod) => void; uninstallAllMods?: () => void; unselectAllMods?: () => void; + openModsDropZone?: () => void; }; -export function ModsGrid({ modsMap, installed, modsSelected, onModChange, moreInfoMod, onWantInfos, disabled, uninstallMod, uninstallAllMods, unselectAllMods }: Props) { +export function ModsGrid({ modsMap, installed, modsSelected, onModChange, moreInfoMod, onWantInfos, disabled, uninstallMod, uninstallAllMods, unselectAllMods, openModsDropZone }: Props) { const [filter, setFilter] = useState(""); const [filterEnabled, setFilterEnabled] = useState(false); @@ -68,6 +69,7 @@ export function ModsGrid({ modsMap, installed, modsSelected, onModChange, moreIn {t("pages.version-viewer.mods.mods-grid.header-bar.description")} openModsDropZone?.() }, { text: "pages.version-viewer.mods.mods-grid.header-bar.dropdown.unselect-all", icon: "cancel", onClick: () => unselectAllMods?.() }, { text: "pages.version-viewer.mods.mods-grid.header-bar.dropdown.uninstall-all", icon: "trash", onClick: () => uninstallAllMods?.() } ]} /> diff --git a/src/renderer/components/version-viewer/slides/mods/mods-slide.component.tsx b/src/renderer/components/version-viewer/slides/mods/mods-slide.component.tsx index caae8470..24367846 100644 --- a/src/renderer/components/version-viewer/slides/mods/mods-slide.component.tsx +++ b/src/renderer/components/version-viewer/slides/mods/mods-slide.component.tsx @@ -45,6 +45,7 @@ export function ModsSlide({ version, onDisclamerDecline }: { version: BSVersion; const isOnline = useObservable(() => os.isOnline$); const [installing, setInstalling] = useState(false); const [uninstalling, setUninstalling] = useState(false); + const [modsDropZoneOpen, setModsDropZoneOpen] = useState(false); const downloadRef = useRef(null); const [downloadWith, setDownloadWidth] = useState(0); @@ -170,6 +171,7 @@ export function ModsSlide({ version, onDisclamerDecline }: { version: BSVersion; }; const importMods = (files: string[]): void => { + setModsDropZoneOpen(false); modsManager.importMods(files, version); }; @@ -287,6 +289,7 @@ export function ModsSlide({ version, onDisclamerDecline }: { version: BSVersion; uninstallMod={uninstallMod} uninstallAllMods={uninstallAllMods} unselectAllMods={unselectAllMods} + openModsDropZone={() => setModsDropZoneOpen(true)} />
@@ -310,10 +313,15 @@ export function ModsSlide({ version, onDisclamerDecline }: { version: BSVersion; onFiles={importMods} text={t("pages.version-viewer.mods.drop-zone.text")} subtext={t("pages.version-viewer.mods.drop-zone.subtext")} + open={modsDropZoneOpen} + onClose={modsDropZoneOpen ? () => setModsDropZoneOpen(false) : undefined} filters={[ { name: ".zip", extensions: ["zip"] }, { name: ".dll", extensions: ["dll"] } ]} + dialogOptions={{ dialog: { + properties: ["openFile", "multiSelections"], + }}} >
{renderContent()}