@@ -9,7 +9,12 @@ function createSaveDialog()
9
9
saveDialog .mapsList = guiCreateGridList ( 0.02 , 0.08 , 0.98 , 0.75 , true , saveDialog .window )
10
10
saveDialog .save = guiCreateButton ( 0.780357142 , 0.85388845 , 0.22857142 , 0.05555555 , " Save" , true , saveDialog .window )
11
11
saveDialog .cancel = guiCreateButton ( 0.780357142 , 0.919444 , 0.22857142 , 0.05555555 , " Cancel" , true , saveDialog .window )
12
- saveDialog .mapName = guiCreateEdit ( 0.02 , 0.87388845 , 0.75 , 0.08 , " " , true , saveDialog .window )
12
+ saveDialog .mapNameLabel = guiCreateLabel ( 0.3 , 0.835 , 0.45 , 0.05555555 , " Map Name:" , true , saveDialog .window )
13
+ guiLabelSetVerticalAlign (saveDialog .mapNameLabel , ' center' )
14
+ saveDialog .mapName = guiCreateEdit ( 0.3 , 0.9 , 0.45 , 0.08 , " " , true , saveDialog .window )
15
+ saveDialog .directoryLabel = guiCreateLabel ( 0.02 , 0.835 , 0.25 , 0.05555555 , " Output Directory:" , true , saveDialog .window )
16
+ guiLabelSetVerticalAlign (saveDialog .directoryLabel , ' center' )
17
+ saveDialog .directory = guiCreateEdit ( 0.02 , 0.9 , 0.25 , 0.08 , " " , true , saveDialog .window )
13
18
--
14
19
guiGridListAddColumn ( saveDialog .mapsList , " Name" , 0.4 )
15
20
guiGridListAddColumn ( saveDialog .mapsList , " Gamemodes" , 0.4 )
70
75
71
76
function saveButton ()
72
77
local resourceName = guiGetText ( saveDialog .mapName )
73
- editor_main .saveResource ( resourceName )
78
+ local directory = guiGetText ( saveDialog .directory )
79
+ editor_main .saveResource ( resourceName , directory )
74
80
end
75
81
76
82
function restoreSaveDialog ()
77
83
guiSetProperty (saveDialog .window , " Disabled" , " False" )
78
84
end
79
85
80
86
addEvent ( " saveAsShowDialog" , true )
81
- function saveShowDialog ( resources )
87
+ function saveShowDialog ( resources , directory )
82
88
if ( exports .editor_main :getMode () ~= 2 ) then
83
89
exports .editor_main :setMode (2 )
84
90
end
85
91
setGUIShowing (false )
86
92
guiSetInputEnabled ( true )
87
93
setWorldClickEnabled ( false )
88
94
guiSetText ( saveDialog .mapName , " " )
95
+ directory = ( type ( directory ) == ' string' ) and string.match (directory , " %[(%a+)%]" )
96
+ guiSetText ( saveDialog .directory , directory or ' ' )
89
97
guiGridListClear ( saveDialog .mapsList )
90
98
for i ,res in ipairs (resources ) do
91
99
if res [" type" ] == " map" and string.lower (res [" friendlyName" ]) ~= TEST_RESOURCE and string.lower (res [" friendlyName" ]) ~= DUMP_RESOURCE then
0 commit comments