Skip to content

Commit 253f78a

Browse files
committed
1 parent 5f76653 commit 253f78a

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

Mopy/bash/basher.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,12 +1483,18 @@ def OnDropIndexes(self, indexes, newPos):
14831483
# Make sure we don't go out of bounds
14841484
target = indexes[0]
14851485
thisFile = self.items[target]
1486+
def isEsp(file):
1487+
if thisFile in bosh.modInfos:
1488+
return bosh.modInfos[thisFile].isEsp()
1489+
else:
1490+
return None
1491+
thisFileIsEsp = isEsp(thisFile)
14861492
while True:
14871493
if target < 0: break
14881494
if target + howMany >= len(self.items) - inc: break
14891495
if target == newPos: break
14901496
swapFile = self.items[target]
1491-
if thisFile.cext != swapFile.cext: break
1497+
if thisFileIsEsp != isEsp(swapFile): break
14921498
target += inc
14931499
if inc == 1 and target + howMany <= indexes[-1]: return
14941500
if inc == -1 and target >= indexes[0]: return
@@ -1704,7 +1710,7 @@ def SortItems(self,col=None,reverse=-2):
17041710
#--ESMs First?
17051711
settings['bash.mods.esmsFirst'] = self.esmsFirst
17061712
if self.esmsFirst or col == 'Load Order':
1707-
self.items.sort(key = lambda x: x.cext)
1713+
self.items.sort(key = lambda x: (x in bosh.modInfos) and bosh.modInfos[x].isEsp())
17081714
#--Selected First?
17091715
settings['bash.mods.selectedFirst'] = self.selectedFirst
17101716
if self.selectedFirst:

Mopy/bash/bosh.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11304,9 +11304,10 @@ def getOrdered(self,modNames,asTuple=True):
1130411304
"""Sort list of mod names into their load order."""
1130511305
data = self.data
1130611306
modNames = list(modNames) #--Don't do an in-place sort.
11307-
modNames.sort()
11307+
#modNames.sort()
1130811308
modNames.sort(key=lambda a: (a in data) and data[a].mtime) #--Sort on modified
11309-
modNames.sort(key=lambda a: a.cs[-1]) #--Sort on esm/esp
11309+
#modNames.sort(key=lambda a: a.cs[-1]) #--Sort on esm/esp
11310+
modNames.sort(key=lambda a: (a in data) and data[a].isEsp())
1131011311
if asTuple: return tuple(modNames)
1131111312
else: return modNames
1131211313

0 commit comments

Comments
 (0)