drop collision check for custom mods
Some checks are pending
Mirror to Codeberg / mirror-to-codeberg (push) Waiting to run

Mod hashes are taken from the directory names, which cannot be the same
at the filesystem level. Custom mod hashes are also unique from local
mods because they are given a different namespace.
This commit is contained in:
aclist 2026-06-11 16:17:02 +09:00
parent 77df66979a
commit ad85bb7343
3 changed files with 5 additions and 19 deletions

View File

@ -156,7 +156,7 @@ class Emitter(GObject.GObject):
pass
@GObject.Signal(flags=GObject.SignalFlags.RUN_LAST, arg_types=(object, str, bool))
def custom_mods_loaded(self, store: "FastInsertListStore", folder: str, has_duplicates: bool) -> None:
def custom_mods_loaded(self, store: "FastInsertListStore", folder: str) -> None:
pass
@GObject.Signal(flags=GObject.SignalFlags.RUN_LAST, arg_types=(str, bool))

View File

@ -54,16 +54,7 @@ class OfflineManager:
store = ModelFactory().make_mod_store()
store.extend(mods)
has_duplicates = False
seen = set()
for row in store:
mod_id = row[1]
if mod_id in seen:
row[-1]=True
has_duplicates = True
seen.add(mod_id)
func = StoredFunc(lambda: self.emitter.emit("custom_mods_loaded", store, folder, has_duplicates))
func = StoredFunc(lambda: self.emitter.emit("custom_mods_loaded", store, folder))
self.thread_man.set_cleanup_func(func)
def setup(

View File

@ -117,6 +117,7 @@ class ModFrame(HeadingFrame):
sel.connect("changed", self._on_selection_changed)
# TODO: inherit icons from warnings area in preconnect dialog
# TODO: strings
self.error_label = Gtk.Label(label="No mods found", halign=Gtk.Align.START, margin_start=10, margin_bottom=5)
self.vbox.pack_end(self.error_label, expand=True, fill=True, padding=3)
@ -209,19 +210,12 @@ class CustomModFrame(ModFrame):
emitter: "Emitter",
store: "FastInsertListStore",
folder: str,
has_duplicates: bool,
) -> None:
if len(store) == 0:
self.hide_tree()
else:
self.present_tree()
if has_duplicates:
# TODO: block button access
# TODO: update error message
# cf hide_tree
pass
def _on_custom_button_clicked(self, button: Gtk.Button) -> None:
local_mods = self.get_mods()
self.parent.offline_man.get_custom_mods(local_mods)
@ -373,11 +367,12 @@ class OfflineLoader(Gtk.Box):
self.controller.open_page(NotebookPage.MODS)
def _on_ok_clicked(self, button: Gtk.Button) -> None:
# TODO: grab all values in one pass
# appid = self.radio_frame.get_appid()
# mission = self.mission_frame.get_mission()
# local_mods = self.local_frame.get_mods()
# custom_mods = self.custom_frame.get_mods()
# cf. api.mods._hash(uid, use_custom=True)
# TODO: dynamically calculate new symlink hashes
# TODO: set up all symlinks prior to launch, including custom ones
# self.offline_man.setup(appid, mission, local_mods, custom_mods)
pass