|
|
@ -6,7 +6,7 @@ import os
|
|
|
|
import shutil
|
|
|
|
import shutil
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
import tempfile
|
|
|
|
import tempfile
|
|
|
|
from typing import Tuple
|
|
|
|
from typing import Tuple, List
|
|
|
|
from zipfile import ZipFile
|
|
|
|
from zipfile import ZipFile
|
|
|
|
|
|
|
|
|
|
|
|
from PyQt6 import QtWidgets
|
|
|
|
from PyQt6 import QtWidgets
|
|
|
@ -17,9 +17,7 @@ from window.main_window import MainWindow
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ModManager:
|
|
|
|
class ModManager:
|
|
|
|
VERSION = "0.3.1"
|
|
|
|
VERSION = "0.3"
|
|
|
|
|
|
|
|
|
|
|
|
UNKNOWN_MOD_VERSION_STRING = "Not Tracked"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, log_level: int = logging.INFO):
|
|
|
|
def __init__(self, log_level: int = logging.INFO):
|
|
|
|
self.__logger = logging.getLogger("ModManager")
|
|
|
|
self.__logger = logging.getLogger("ModManager")
|
|
|
@ -285,7 +283,7 @@ class ModManager:
|
|
|
|
if file in unresolved_files:
|
|
|
|
if file in unresolved_files:
|
|
|
|
unknown_mod[os.path.basename(file)] = {"mod_files": [file]}
|
|
|
|
unknown_mod[os.path.basename(file)] = {"mod_files": [file]}
|
|
|
|
for key in unknown_mod.keys():
|
|
|
|
for key in unknown_mod.keys():
|
|
|
|
self.installed_mods[(key, ModManager.UNKNOWN_MOD_VERSION_STRING)] = unknown_mod[key]
|
|
|
|
self.installed_mods[key] = unknown_mod[key]
|
|
|
|
|
|
|
|
|
|
|
|
self.__window.set_installed_mods(self.installed_mods)
|
|
|
|
self.__window.set_installed_mods(self.installed_mods)
|
|
|
|
self.__window.set_available_mods(self.available_mods)
|
|
|
|
self.__window.set_available_mods(self.available_mods)
|
|
|
@ -389,7 +387,7 @@ class ModManager:
|
|
|
|
parent_dir = os.path.join(self.__settings.get_game_folder(), file).split(os.path.basename(file))[0]\
|
|
|
|
parent_dir = os.path.join(self.__settings.get_game_folder(), file).split(os.path.basename(file))[0]\
|
|
|
|
.replace("/", os.path.sep)
|
|
|
|
.replace("/", os.path.sep)
|
|
|
|
if not os.path.exists(parent_dir):
|
|
|
|
if not os.path.exists(parent_dir):
|
|
|
|
os.makedirs(parent_dir)
|
|
|
|
os.mkdir(parent_dir)
|
|
|
|
if not os.path.exists(os.path.join(self.__settings.get_game_folder().replace("/", os.path.sep),
|
|
|
|
if not os.path.exists(os.path.join(self.__settings.get_game_folder().replace("/", os.path.sep),
|
|
|
|
file.replace("/", os.path.sep))):
|
|
|
|
file.replace("/", os.path.sep))):
|
|
|
|
self.__logger.debug(
|
|
|
|
self.__logger.debug(
|
|
|
|