Fix sort order problem for mods
This commit is contained in:
@@ -52,9 +52,8 @@ module.exports = class Mod extends BaseModel
|
||||
if thisRequired isnt thatRequired
|
||||
return -1 if thisRequired
|
||||
return +1 if thatRequired
|
||||
else
|
||||
if this.name isnt that.name
|
||||
return if this.name < that.name then -1 else +1
|
||||
else if this.slug isnt that.slug
|
||||
return if this.slug < that.slug then -1 else +1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
@@ -106,6 +106,7 @@ module.exports = class ModPack extends BaseModel
|
||||
@trigger Event.add + ':mod', mod, this
|
||||
|
||||
@_mods.sort (a, b)-> a.compareTo b
|
||||
logger.debug "mods: #{(m.slug for m in @_mods)}"
|
||||
@trigger Event.sort + ':mod', this
|
||||
@trigger Event.change, this
|
||||
|
||||
@@ -120,7 +121,7 @@ module.exports = class ModPack extends BaseModel
|
||||
return mod if mod.slug is slug
|
||||
return null
|
||||
|
||||
getMods: ->
|
||||
getAllMods: ->
|
||||
return @_mods[..]
|
||||
|
||||
# Object Overrides #############################################################################
|
||||
|
||||
Reference in New Issue
Block a user