Skip to content

Commit 7a97594

Browse files
InfernioUtumno
authored andcommitted
bain: Fix install attempts causing LO lock warning RRR
Not sure this is the right approach, I'm only semi-familiar with LO code and not at all familiar with BAIN code. Note that I changed defaults for the ModInfos.refreshLoadOrder parameters, two places used True for them, one explicitly specified both and none used False. Under # 309 <--- RRR
1 parent d530a51 commit 7a97594

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

Mopy/bash/basher/mod_links.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@ def _esm_esl_flip_refresh(self, updated):
16001600
with balt.BusyCursor():
16011601
##: HACK: forcing active refresh cause mods may be reordered and
16021602
# we then need to sync order in skyrim's plugins.txt
1603-
bosh.modInfos.refreshLoadOrder(forceRefresh=True, forceActive=True)
1603+
bosh.modInfos.refreshLoadOrder()
16041604
# converted to esps/esls - rescan mergeable
16051605
bosh.modInfos.rescanMergeable(updated, bolt.Progress())
16061606
# will be moved to the top - note that modification times won't

Mopy/bash/bosh/__init__.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,9 +1777,16 @@ def bashed_patches(self):
17771777
# Load order API for the rest of Bash to use - if the load order or
17781778
# active plugins changed, those methods run a refresh on modInfos data
17791779
@_lo_cache
1780-
def refreshLoadOrder(self, forceRefresh=False, forceActive=False):
1781-
load_order.refresh_lo(cached=not forceRefresh,
1782-
cached_active=not forceActive)
1780+
def refreshLoadOrder(self, forceRefresh=True, forceActive=True,
1781+
unlock_lo=False):
1782+
def _do_lo_refresh():
1783+
load_order.refresh_lo(cached=not forceRefresh,
1784+
cached_active=not forceActive)
1785+
# Needed for BAIN, which may have to reorder installed plugins
1786+
if unlock_lo:
1787+
with load_order.Unlock(): _do_lo_refresh()
1788+
else: _do_lo_refresh()
1789+
17831790

17841791
@_lo_cache
17851792
def cached_lo_save_active(self, active=None):

Mopy/bash/bosh/bain.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2328,6 +2328,7 @@ def __installer_install(self, installer, destFiles, index, progress,
23282328
except FileError:
23292329
mods.discard(mod)
23302330
modInfos.cached_lo_append_if_missing(mods)
2331+
modInfos.refreshLoadOrder(unlock_lo=True)
23312332
# now that we saved load order update missing mtimes for mods:
23322333
for mod in mods:
23332334
s, c, _d = data_sizeCrcDate_update[mod.s]

0 commit comments

Comments
 (0)