@@ -68,6 +68,7 @@ function buildMode:Init(dbFileName, buildName, buildXML, convertBuild, importLin
6868 if not buildName then
6969 main :SetMode (" LIST" )
7070 end
71+ self .saveAsSortMode = " NAME"
7172
7273 -- Load build file
7374 self .xmlSectionList = { }
@@ -1310,18 +1311,22 @@ function buildMode:OpenSaveAsPopup()
13101311 end
13111312 end )
13121313 end )
1313- controls .folder = new (" FolderListControl" , nil , {0 , 115 , 450 , 100 }, self .dbFileSubPath , function (subPath )
1314+
1315+ controls .folder = new (" FolderListControl" , nil , {0 , 115 , 450 , 400 }, self .dbFileSubPath , function (subPath )
13141316 updateBuildName ()
13151317 end )
1316- controls .save = new (" ButtonControl" , nil , {- 45 , 225 , 80 , 20 }, " Save" , function ()
1318+ controls .folder .sortMode = self .saveAsSortMode
1319+ controls .folder :SortList ()
1320+
1321+ controls .save = new (" ButtonControl" , nil , {- 45 , 525 , 80 , 20 }, " Save" , function ()
13171322 main :ClosePopup ()
13181323 self .dbFileName = newFileName
13191324 self .buildName = newBuildName
13201325 self .dbFileSubPath = controls .folder .subPath
13211326 self :SaveDBFile ()
13221327 self .spec :SetWindowTitleWithBuildClass ()
13231328 end )
1324- controls .close = new (" ButtonControl" , nil , {45 , 225 , 80 , 20 }, " Cancel" , function ()
1329+ controls .close = new (" ButtonControl" , nil , {45 , 525 , 80 , 20 }, " Cancel" , function ()
13251330 main :ClosePopup ()
13261331 self .actionOnSave = nil
13271332 end )
@@ -1333,7 +1338,18 @@ function buildMode:OpenSaveAsPopup()
13331338 controls .save .enabled = false
13341339 end
13351340
1336- main :OpenPopup (470 , 255 , self .dbFileName and " Save As" or " Save" , controls , " save" , " edit" , " close" )
1341+ controls .buildSortMode = new (" DropDownControl" , { " TOPRIGHT" , nil , " TOPRIGHT" }, { - 10 , 70 , 120 , 18 }, {
1342+ { label = " Sort By Name" , mode = " NAME" },
1343+ { label = " Sort By Last Edited" , mode = " EDITED" },
1344+ }, function (index , value )
1345+ self .saveAsSortMode = value .mode
1346+ controls .folder .sortMode = value .mode
1347+ controls .folder :SortList ()
1348+ end )
1349+ controls .buildSortMode .tooltipText = " Sort folders by name or date modified."
1350+ controls .buildSortMode :SelByValue (self .saveAsSortMode , " mode" )
1351+
1352+ main :OpenPopup (470 , 555 , self .dbFileName and " Save As" or " Save" , controls , " save" , " edit" , " close" )
13371353end
13381354
13391355-- Open the spectre library popup
0 commit comments