mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 14:42:54 +01:00
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:
1 parent
77df66979a
commit
ad85bb7343
3 files changed
+5
-19
No files matched your search
@@ -156,7 +156,7 @@ class Emitter(GObject.GObject):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
@GObject.Signal(flags=GObject.SignalFlags.RUN_LAST, arg_types=(object, str, bool))
|
@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
|
pass
|
||||||
|
|
||||||
@GObject.Signal(flags=GObject.SignalFlags.RUN_LAST, arg_types=(str, bool))
|
@GObject.Signal(flags=GObject.SignalFlags.RUN_LAST, arg_types=(str, bool))
|
||||||
|
|||||||
@@ -54,16 +54,7 @@ class OfflineManager:
|
|||||||
store = ModelFactory().make_mod_store()
|
store = ModelFactory().make_mod_store()
|
||||||
store.extend(mods)
|
store.extend(mods)
|
||||||
|
|
||||||
has_duplicates = False
|
func = StoredFunc(lambda: self.emitter.emit("custom_mods_loaded", store, folder))
|
||||||
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))
|
|
||||||
self.thread_man.set_cleanup_func(func)
|
self.thread_man.set_cleanup_func(func)
|
||||||
|
|
||||||
def setup(
|
def setup(
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ class ModFrame(HeadingFrame):
|
|||||||
sel.connect("changed", self._on_selection_changed)
|
sel.connect("changed", self._on_selection_changed)
|
||||||
|
|
||||||
# TODO: inherit icons from warnings area in preconnect dialog
|
# 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.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)
|
self.vbox.pack_end(self.error_label, expand=True, fill=True, padding=3)
|
||||||
|
|
||||||
@@ -209,19 +210,12 @@ class CustomModFrame(ModFrame):
|
|||||||
emitter: "Emitter",
|
emitter: "Emitter",
|
||||||
store: "FastInsertListStore",
|
store: "FastInsertListStore",
|
||||||
folder: str,
|
folder: str,
|
||||||
has_duplicates: bool,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
if len(store) == 0:
|
if len(store) == 0:
|
||||||
self.hide_tree()
|
self.hide_tree()
|
||||||
else:
|
else:
|
||||||
self.present_tree()
|
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:
|
def _on_custom_button_clicked(self, button: Gtk.Button) -> None:
|
||||||
local_mods = self.get_mods()
|
local_mods = self.get_mods()
|
||||||
self.parent.offline_man.get_custom_mods(local_mods)
|
self.parent.offline_man.get_custom_mods(local_mods)
|
||||||
@@ -373,11 +367,12 @@ class OfflineLoader(Gtk.Box):
|
|||||||
self.controller.open_page(NotebookPage.MODS)
|
self.controller.open_page(NotebookPage.MODS)
|
||||||
|
|
||||||
def _on_ok_clicked(self, button: Gtk.Button) -> None:
|
def _on_ok_clicked(self, button: Gtk.Button) -> None:
|
||||||
|
# TODO: grab all values in one pass
|
||||||
# appid = self.radio_frame.get_appid()
|
# appid = self.radio_frame.get_appid()
|
||||||
# mission = self.mission_frame.get_mission()
|
# mission = self.mission_frame.get_mission()
|
||||||
# local_mods = self.local_frame.get_mods()
|
# local_mods = self.local_frame.get_mods()
|
||||||
# custom_mods = self.custom_frame.get_mods()
|
# custom_mods = self.custom_frame.get_mods()
|
||||||
# cf. api.mods._hash(uid, use_custom=True)
|
# 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)
|
# self.offline_man.setup(appid, mission, local_mods, custom_mods)
|
||||||
pass
|
pass
|
||||||
Reference in new issue
Block a user