Skip to content

Commit 2e8a200

Browse files
committed
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 4ef96a6 commit 2e8a200

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
@@ -1776,9 +1776,16 @@ def bashed_patches(self):
17761776
# Load order API for the rest of Bash to use - if the load order or
17771777
# active plugins changed, those methods run a refresh on modInfos data
17781778
@_lo_cache
1779-
def refreshLoadOrder(self, forceRefresh=False, forceActive=False):
1780-
load_order.refresh_lo(cached=not forceRefresh,
1781-
cached_active=not forceActive)
1779+
def refreshLoadOrder(self, forceRefresh=True, forceActive=True,
1780+
unlock_lo=False):
1781+
def _do_lo_refresh():
1782+
load_order.refresh_lo(cached=not forceRefresh,
1783+
cached_active=not forceActive)
1784+
# Needed for BAIN, which may have to reorder installed plugins
1785+
if unlock_lo:
1786+
with load_order.Unlock(): _do_lo_refresh()
1787+
else: _do_lo_refresh()
1788+
17821789

17831790
@_lo_cache
17841791
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)