· 9 years ago · Nov 29, 2016, 01:50 AM
1CreateGui = function()
2 local NewGuiPart1 = Instance.new("ScreenGui")
3 NewGuiPart1.Name = "Dex"
4 -------
5 local NewGuiPart2 = Instance.new("Frame")
6 NewGuiPart2.Active = true
7 NewGuiPart2.BackgroundTransparency = 0.10000000149012
8 NewGuiPart2.BorderColor3 = Color3.new(0.74902, 0.74902, 0.74902)
9 NewGuiPart2.Name = "PropertiesFrame"
10 NewGuiPart2.Position = UDim2.new(1, -300, 0.5, 21)
11 NewGuiPart2.Size = UDim2.new(0, 300, 0.5, -3)
12 NewGuiPart2.Parent = NewGuiPart1
13 -------
14 local NewGuiPart3 = Instance.new("Frame")
15 NewGuiPart3.BackgroundColor3 = Color3.new(0.913726, 0.913726, 0.913726)
16 NewGuiPart3.BorderColor3 = Color3.new(0.584314, 0.584314, 0.584314)
17 NewGuiPart3.Name = "Header"
18 NewGuiPart3.Position = UDim2.new(0, 0, 0, -36)
19 NewGuiPart3.Size = UDim2.new(1, 0, 0, 35)
20 NewGuiPart3.Parent = NewGuiPart2
21 -------
22 local NewGuiPart4 = Instance.new("TextLabel")
23 NewGuiPart4.BackgroundColor3 = Color3.new(0.639216, 0.635294, 0.647059)
24 NewGuiPart4.BackgroundTransparency = 1
25 NewGuiPart4.Position = UDim2.new(0, 4, 0, 0)
26 NewGuiPart4.Size = UDim2.new(1, -4, 0.5, 0)
27 NewGuiPart4.FontSize = Enum.FontSize.Size14
28 NewGuiPart4.Text = "Properties"
29 NewGuiPart4.TextColor3 = Color3.new(0, 0, 0)
30 NewGuiPart4.TextXAlignment = Enum.TextXAlignment.Left
31 NewGuiPart4.Parent = NewGuiPart3
32 -------
33 local NewGuiPart5 = Instance.new("TextBox")
34 NewGuiPart5.BackgroundColor3 = Color3.new(0.639216, 0.635294, 0.647059)
35 NewGuiPart5.BackgroundTransparency = 0.80000001192093
36 NewGuiPart5.Position = UDim2.new(0, 4, 0.5, 0)
37 NewGuiPart5.Size = UDim2.new(1, -8, 0.5, -3)
38 NewGuiPart5.FontSize = Enum.FontSize.Size14
39 NewGuiPart5.Text = "Search Properties"
40 NewGuiPart5.TextColor3 = Color3.new(0, 0, 0)
41 NewGuiPart5.TextXAlignment = Enum.TextXAlignment.Left
42 NewGuiPart5.Parent = NewGuiPart3
43 -------
44 local NewGuiPart6 = Instance.new("Frame")
45 NewGuiPart6.BackgroundTransparency = 0.10000000149012
46 NewGuiPart6.BorderColor3 = Color3.new(0.74902, 0.74902, 0.74902)
47 NewGuiPart6.Name = "ExplorerPanel"
48 NewGuiPart6.Position = UDim2.new(1, -300, 0, 0)
49 NewGuiPart6.Size = UDim2.new(0, 300, 0.5, -15)
50 NewGuiPart6.Parent = NewGuiPart1
51 -------
52 local NewGuiPart7 = Instance.new("Frame")
53 NewGuiPart7.BackgroundColor3 = Color3.new(0.913726, 0.913726, 0.913726)
54 NewGuiPart7.BorderColor3 = Color3.new(0.584314, 0.584314, 0.584314)
55 NewGuiPart7.Name = "SideMenu"
56 NewGuiPart7.Position = UDim2.new(1, -330, 0, 0)
57 NewGuiPart7.Size = UDim2.new(0, 30, 0, 150)
58 NewGuiPart7.ZIndex = 2
59 NewGuiPart7.Parent = NewGuiPart1
60 -------
61 local NewGuiPart8 = Instance.new("TextButton")
62 NewGuiPart8.Active = true
63 NewGuiPart8.BackgroundTransparency = 1
64 NewGuiPart8.Name = "Toggle"
65 NewGuiPart8.Position = UDim2.new(0, 0, 0, 120)
66 NewGuiPart8.Selectable = true
67 NewGuiPart8.Size = UDim2.new(0, 30, 0, 30)
68 NewGuiPart8.Style = Enum.ButtonStyle.Custom
69 NewGuiPart8.ZIndex = 2
70 NewGuiPart8.FontSize = Enum.FontSize.Size24
71 NewGuiPart8.Text = ">"
72 NewGuiPart8.Parent = NewGuiPart7
73 -------
74 local NewGuiPart9 = Instance.new("TextButton")
75 NewGuiPart9.Active = true
76 NewGuiPart9.BackgroundTransparency = 1
77 NewGuiPart9.Name = "Explorer"
78 NewGuiPart9.Position = UDim2.new(0, 0, 0, 90)
79 NewGuiPart9.Selectable = true
80 NewGuiPart9.Size = UDim2.new(0, 30, 0, 30)
81 NewGuiPart9.Style = Enum.ButtonStyle.Custom
82 NewGuiPart9.ZIndex = 2
83 NewGuiPart9.FontSize = Enum.FontSize.Size24
84 NewGuiPart9.Text = "E"
85 NewGuiPart9.Parent = NewGuiPart7
86 -------
87 local NewGuiPart10 = Instance.new("TextButton")
88 NewGuiPart10.Active = true
89 NewGuiPart10.BackgroundTransparency = 1
90 NewGuiPart10.Name = "Settings"
91 NewGuiPart10.Position = UDim2.new(0, 0, 0, 60)
92 NewGuiPart10.Selectable = true
93 NewGuiPart10.Size = UDim2.new(0, 30, 0, 30)
94 NewGuiPart10.Style = Enum.ButtonStyle.Custom
95 NewGuiPart10.ZIndex = 2
96 NewGuiPart10.FontSize = Enum.FontSize.Size24
97 NewGuiPart10.Text = "S"
98 NewGuiPart10.Parent = NewGuiPart7
99 -------
100 local NewGuiPart11 = Instance.new("TextLabel")
101 NewGuiPart11.BackgroundTransparency = 1
102 NewGuiPart11.Name = "Title"
103 NewGuiPart11.Size = UDim2.new(0, 30, 0, 20)
104 NewGuiPart11.ZIndex = 2
105 NewGuiPart11.Font = Enum.Font.SourceSansBold
106 NewGuiPart11.FontSize = Enum.FontSize.Size14
107 NewGuiPart11.Text = "DEX"
108 NewGuiPart11.TextWrapped = true
109 NewGuiPart11.Parent = NewGuiPart7
110 -------
111 local NewGuiPart12 = Instance.new("TextLabel")
112 NewGuiPart12.BackgroundTransparency = 1
113 NewGuiPart12.Name = "Version"
114 NewGuiPart12.Position = UDim2.new(0, 0, 0, 15)
115 NewGuiPart12.Size = UDim2.new(0, 30, 0, 20)
116 NewGuiPart12.ZIndex = 2
117 NewGuiPart12.Font = Enum.Font.SourceSansBold
118 NewGuiPart12.FontSize = Enum.FontSize.Size12
119 NewGuiPart12.Text = "V0.98"
120 NewGuiPart12.TextWrapped = true
121 NewGuiPart12.Parent = NewGuiPart7
122 -------
123 local NewGuiPart13 = Instance.new("TextButton")
124 NewGuiPart13.Active = true
125 NewGuiPart13.BackgroundColor3 = Color3.new(0.913726, 0.913726, 0.913726)
126 NewGuiPart13.BorderColor3 = Color3.new(0.584314, 0.584314, 0.584314)
127 NewGuiPart13.Name = "Toggle"
128 NewGuiPart13.Position = UDim2.new(1, 0, 0, 0)
129 NewGuiPart13.Selectable = true
130 NewGuiPart13.Size = UDim2.new(0, 30, 0, 30)
131 NewGuiPart13.Style = Enum.ButtonStyle.Custom
132 NewGuiPart13.FontSize = Enum.FontSize.Size24
133 NewGuiPart13.Text = "<"
134 NewGuiPart13.Parent = NewGuiPart1
135 -------
136 local NewGuiPart14 = Instance.new("Frame")
137 NewGuiPart14.BackgroundTransparency = 0.10000000149012
138 NewGuiPart14.BorderColor3 = Color3.new(0.74902, 0.74902, 0.74902)
139 NewGuiPart14.Name = "SettingsPanel"
140 NewGuiPart14.Position = UDim2.new(1, 0, 0, 0)
141 NewGuiPart14.Size = UDim2.new(0, 300, 1, 0)
142 NewGuiPart14.Parent = NewGuiPart1
143 -------
144 local NewGuiPart15 = Instance.new("Frame")
145 NewGuiPart15.BackgroundColor3 = Color3.new(0.913726, 0.913726, 0.913726)
146 NewGuiPart15.BorderColor3 = Color3.new(0.584314, 0.584314, 0.584314)
147 NewGuiPart15.Name = "Header"
148 NewGuiPart15.Size = UDim2.new(1, 0, 0, 17)
149 NewGuiPart15.Parent = NewGuiPart14
150 -------
151 local NewGuiPart16 = Instance.new("TextLabel")
152 NewGuiPart16.BackgroundColor3 = Color3.new(0.639216, 0.635294, 0.647059)
153 NewGuiPart16.BackgroundTransparency = 1
154 NewGuiPart16.Position = UDim2.new(0, 4, 0, 0)
155 NewGuiPart16.Size = UDim2.new(1, -4, 1, 0)
156 NewGuiPart16.FontSize = Enum.FontSize.Size14
157 NewGuiPart16.Text = "Settings"
158 NewGuiPart16.TextColor3 = Color3.new(0, 0, 0)
159 NewGuiPart16.TextXAlignment = Enum.TextXAlignment.Left
160 NewGuiPart16.Parent = NewGuiPart15
161 -------
162 local NewGuiPart17 = Instance.new("Frame")
163 NewGuiPart17.BackgroundTransparency = 1
164 NewGuiPart17.Name = "ClickSelect"
165 NewGuiPart17.Position = UDim2.new(0, 0, 0, 18)
166 NewGuiPart17.Size = UDim2.new(1, 0, 0, 30)
167 NewGuiPart17.Parent = NewGuiPart14
168 -------
169 local NewGuiPart18 = Instance.new("TextLabel")
170 NewGuiPart18.BackgroundTransparency = 0.5
171 NewGuiPart18.Name = "Name"
172 NewGuiPart18.Size = UDim2.new(0.5, 0, 1, 0)
173 NewGuiPart18.FontSize = Enum.FontSize.Size14
174 NewGuiPart18.Text = "Click Part to Select"
175 NewGuiPart18.Parent = NewGuiPart17
176 -------
177 local NewGuiPart19 = Instance.new("TextButton")
178 NewGuiPart19.Active = true
179 NewGuiPart19.BackgroundTransparency = 0.5
180 NewGuiPart19.BorderColor3 = Color3.new(0, 0, 0)
181 NewGuiPart19.Name = "Change"
182 NewGuiPart19.Position = UDim2.new(0.5, 0, 0, 0)
183 NewGuiPart19.Selectable = true
184 NewGuiPart19.Size = UDim2.new(0.5, 0, 1, 0)
185 NewGuiPart19.Style = Enum.ButtonStyle.Custom
186 NewGuiPart19.FontSize = Enum.FontSize.Size18
187 NewGuiPart19.Text = "OFF"
188 NewGuiPart19.Parent = NewGuiPart17
189 -------
190 local NewGuiPart20 = Instance.new("Frame")
191 NewGuiPart20.BackgroundTransparency = 1
192 NewGuiPart20.Name = "ClearProperties"
193 NewGuiPart20.Position = UDim2.new(0, 0, 0, 78)
194 NewGuiPart20.Size = UDim2.new(1, 0, 0, 30)
195 NewGuiPart20.Parent = NewGuiPart14
196 -------
197 local NewGuiPart21 = Instance.new("TextLabel")
198 NewGuiPart21.BackgroundTransparency = 0.5
199 NewGuiPart21.Name = "Name"
200 NewGuiPart21.Size = UDim2.new(0.5, 0, 1, 0)
201 NewGuiPart21.FontSize = Enum.FontSize.Size14
202 NewGuiPart21.Text = "Clear Property on Focus"
203 NewGuiPart21.Parent = NewGuiPart20
204 -------
205 local NewGuiPart22 = Instance.new("TextButton")
206 NewGuiPart22.Active = true
207 NewGuiPart22.BackgroundTransparency = 0.5
208 NewGuiPart22.BorderColor3 = Color3.new(0, 0, 0)
209 NewGuiPart22.Name = "Change"
210 NewGuiPart22.Position = UDim2.new(0.5, 0, 0, 0)
211 NewGuiPart22.Selectable = true
212 NewGuiPart22.Size = UDim2.new(0.5, 0, 1, 0)
213 NewGuiPart22.Style = Enum.ButtonStyle.Custom
214 NewGuiPart22.FontSize = Enum.FontSize.Size18
215 NewGuiPart22.Text = "OFF"
216 NewGuiPart22.Parent = NewGuiPart20
217 -------
218 local NewGuiPart23 = Instance.new("Frame")
219 NewGuiPart23.BackgroundTransparency = 1
220 NewGuiPart23.Name = "SelectionBox"
221 NewGuiPart23.Position = UDim2.new(0, 0, 0, 48)
222 NewGuiPart23.Size = UDim2.new(1, 0, 0, 30)
223 NewGuiPart23.Parent = NewGuiPart14
224 -------
225 local NewGuiPart24 = Instance.new("TextLabel")
226 NewGuiPart24.BackgroundTransparency = 0.5
227 NewGuiPart24.Name = "Name"
228 NewGuiPart24.Size = UDim2.new(0.5, 0, 1, 0)
229 NewGuiPart24.FontSize = Enum.FontSize.Size14
230 NewGuiPart24.Text = "Selection Box"
231 NewGuiPart24.Parent = NewGuiPart23
232 -------
233 local NewGuiPart25 = Instance.new("TextButton")
234 NewGuiPart25.Active = true
235 NewGuiPart25.BackgroundTransparency = 0.5
236 NewGuiPart25.BorderColor3 = Color3.new(0, 0, 0)
237 NewGuiPart25.Name = "Change"
238 NewGuiPart25.Position = UDim2.new(0.5, 0, 0, 0)
239 NewGuiPart25.Selectable = true
240 NewGuiPart25.Size = UDim2.new(0.5, 0, 1, 0)
241 NewGuiPart25.Style = Enum.ButtonStyle.Custom
242 NewGuiPart25.FontSize = Enum.FontSize.Size18
243 NewGuiPart25.Text = "OFF"
244 NewGuiPart25.Parent = NewGuiPart23
245 -------
246 local NewGuiPart26 = Instance.new("Frame")
247 NewGuiPart26.BackgroundTransparency = 1
248 NewGuiPart26.Name = "SelectUngrouped"
249 NewGuiPart26.Position = UDim2.new(0, 0, 0, 108)
250 NewGuiPart26.Size = UDim2.new(1, 0, 0, 30)
251 NewGuiPart26.Parent = NewGuiPart14
252 -------
253 local NewGuiPart27 = Instance.new("TextLabel")
254 NewGuiPart27.BackgroundTransparency = 0.5
255 NewGuiPart27.Name = "Name"
256 NewGuiPart27.Size = UDim2.new(0.5, 0, 1, 0)
257 NewGuiPart27.FontSize = Enum.FontSize.Size14
258 NewGuiPart27.Text = "Select Ungrouped"
259 NewGuiPart27.Parent = NewGuiPart26
260 -------
261 local NewGuiPart28 = Instance.new("TextButton")
262 NewGuiPart28.Active = true
263 NewGuiPart28.BackgroundTransparency = 0.5
264 NewGuiPart28.BorderColor3 = Color3.new(0, 0, 0)
265 NewGuiPart28.Name = "Change"
266 NewGuiPart28.Position = UDim2.new(0.5, 0, 0, 0)
267 NewGuiPart28.Selectable = true
268 NewGuiPart28.Size = UDim2.new(0.5, 0, 1, 0)
269 NewGuiPart28.Style = Enum.ButtonStyle.Custom
270 NewGuiPart28.FontSize = Enum.FontSize.Size18
271 NewGuiPart28.Text = "ON"
272 NewGuiPart28.Parent = NewGuiPart26
273 -------
274 local NewGuiPart29 = Instance.new("Frame")
275 NewGuiPart29.Active = true
276 NewGuiPart29.BackgroundColor3 = Color3.new(0.913726, 0.913726, 0.913726)
277 NewGuiPart29.BorderColor3 = Color3.new(0.584314, 0.584314, 0.584314)
278 NewGuiPart29.Name = "SaveInstance"
279 NewGuiPart29.Position = UDim2.new(0.300000012, 0, 0.300000012, 0)
280 NewGuiPart29.Size = UDim2.new(0, 350, 0, 20)
281 NewGuiPart29.Visible = false
282 NewGuiPart29.ZIndex = 2
283 NewGuiPart29.Draggable = true
284 NewGuiPart29.Parent = NewGuiPart1
285 -------
286 local NewGuiPart30 = Instance.new("TextLabel")
287 NewGuiPart30.BackgroundColor3 = Color3.new(0.639216, 0.635294, 0.647059)
288 NewGuiPart30.BackgroundTransparency = 1
289 NewGuiPart30.Name = "Title"
290 NewGuiPart30.Size = UDim2.new(1, 0, 1, 0)
291 NewGuiPart30.ZIndex = 2
292 NewGuiPart30.FontSize = Enum.FontSize.Size14
293 NewGuiPart30.Text = "Save Instance"
294 NewGuiPart30.TextColor3 = Color3.new(0, 0, 0)
295 NewGuiPart30.TextXAlignment = Enum.TextXAlignment.Left
296 NewGuiPart30.Parent = NewGuiPart29
297 -------
298 local NewGuiPart31 = Instance.new("Frame")
299 NewGuiPart31.BackgroundTransparency = 0.10000000149012
300 NewGuiPart31.BorderColor3 = Color3.new(0.74902, 0.74902, 0.74902)
301 NewGuiPart31.Name = "MainWindow"
302 NewGuiPart31.Size = UDim2.new(1, 0, 0, 200)
303 NewGuiPart31.Parent = NewGuiPart29
304 -------
305 local NewGuiPart32 = Instance.new("TextButton")
306 NewGuiPart32.Active = true
307 NewGuiPart32.BackgroundTransparency = 0.5
308 NewGuiPart32.BorderColor3 = Color3.new(0, 0, 0)
309 NewGuiPart32.Name = "Save"
310 NewGuiPart32.Position = UDim2.new(0.075000003, 0, 1, -40)
311 NewGuiPart32.Selectable = true
312 NewGuiPart32.Size = UDim2.new(0.400000006, 0, 0, 30)
313 NewGuiPart32.Style = Enum.ButtonStyle.Custom
314 NewGuiPart32.FontSize = Enum.FontSize.Size18
315 NewGuiPart32.Text = "Save"
316 NewGuiPart32.Parent = NewGuiPart31
317 -------
318 local NewGuiPart33 = Instance.new("TextLabel")
319 NewGuiPart33.BackgroundTransparency = 1
320 NewGuiPart33.Name = "Desc"
321 NewGuiPart33.Position = UDim2.new(0, 0, 0, 20)
322 NewGuiPart33.Size = UDim2.new(1, 0, 0, 40)
323 NewGuiPart33.FontSize = Enum.FontSize.Size14
324 NewGuiPart33.Text = "This will save an instance to your PC. Type in the name for your instance. (.rbxmx will be added automatically.)"
325 NewGuiPart33.TextWrapped = true
326 NewGuiPart33.Parent = NewGuiPart31
327 -------
328 local NewGuiPart34 = Instance.new("TextButton")
329 NewGuiPart34.Active = true
330 NewGuiPart34.BackgroundTransparency = 0.5
331 NewGuiPart34.BorderColor3 = Color3.new(0, 0, 0)
332 NewGuiPart34.Name = "Cancel"
333 NewGuiPart34.Position = UDim2.new(0.524999976, 0, 1, -40)
334 NewGuiPart34.Selectable = true
335 NewGuiPart34.Size = UDim2.new(0.400000006, 0, 0, 30)
336 NewGuiPart34.Style = Enum.ButtonStyle.Custom
337 NewGuiPart34.FontSize = Enum.FontSize.Size18
338 NewGuiPart34.Text = "Cancel"
339 NewGuiPart34.Parent = NewGuiPart31
340 -------
341 local NewGuiPart35 = Instance.new("TextBox")
342 NewGuiPart35.BackgroundTransparency = 0.20000000298023
343 NewGuiPart35.Name = "FileName"
344 NewGuiPart35.Position = UDim2.new(0.075000003, 0, 0.400000006, 0)
345 NewGuiPart35.Size = UDim2.new(0.850000024, 0, 0, 30)
346 NewGuiPart35.FontSize = Enum.FontSize.Size18
347 NewGuiPart35.Text = ""
348 NewGuiPart35.TextXAlignment = Enum.TextXAlignment.Left
349 NewGuiPart35.Parent = NewGuiPart31
350 -------
351 local NewGuiPart36 = Instance.new("TextButton")
352 NewGuiPart36.Active = true
353 NewGuiPart36.BackgroundTransparency = 0.60000002384186
354 NewGuiPart36.Name = "SaveObjects"
355 NewGuiPart36.Position = UDim2.new(0.075000003, 0, 0.625, 0)
356 NewGuiPart36.Selectable = true
357 NewGuiPart36.Size = UDim2.new(0, 20, 0, 20)
358 NewGuiPart36.Style = Enum.ButtonStyle.Custom
359 NewGuiPart36.ZIndex = 2
360 NewGuiPart36.FontSize = Enum.FontSize.Size18
361 NewGuiPart36.Text = ""
362 NewGuiPart36.TextColor3 = Color3.new(1, 1, 1)
363 NewGuiPart36.Parent = NewGuiPart31
364 -------
365 local NewGuiPart37 = Instance.new("TextLabel")
366 NewGuiPart37.BackgroundColor3 = Color3.new(0.380392, 0.380392, 0.380392)
367 NewGuiPart37.BackgroundTransparency = 0.40000000596046
368 NewGuiPart37.BorderSizePixel = 0
369 NewGuiPart37.Name = "enabled"
370 NewGuiPart37.Position = UDim2.new(0, 3, 0, 3)
371 NewGuiPart37.Size = UDim2.new(0, 14, 0, 14)
372 NewGuiPart37.FontSize = Enum.FontSize.Size14
373 NewGuiPart37.Text = ""
374 NewGuiPart37.Parent = NewGuiPart36
375 -------
376 local NewGuiPart38 = Instance.new("TextLabel")
377 NewGuiPart38.BackgroundTransparency = 1
378 NewGuiPart38.Name = "Desc2"
379 NewGuiPart38.Position = UDim2.new(0.075000003, 30, 0.625, 0)
380 NewGuiPart38.Size = UDim2.new(0.925000012, -30, 0, 20)
381 NewGuiPart38.FontSize = Enum.FontSize.Size14
382 NewGuiPart38.Text = "Save 'Object' type values"
383 NewGuiPart38.TextXAlignment = Enum.TextXAlignment.Left
384 NewGuiPart38.Parent = NewGuiPart31
385 -------
386 local NewGuiPart39 = Instance.new("Frame")
387 NewGuiPart39.Active = true
388 NewGuiPart39.BackgroundColor3 = Color3.new(0.913726, 0.913726, 0.913726)
389 NewGuiPart39.BorderColor3 = Color3.new(0.584314, 0.584314, 0.584314)
390 NewGuiPart39.Name = "Confirmation"
391 NewGuiPart39.Position = UDim2.new(0.300000012, 0, 0.349999994, 0)
392 NewGuiPart39.Size = UDim2.new(0, 350, 0, 20)
393 NewGuiPart39.Visible = false
394 NewGuiPart39.ZIndex = 3
395 NewGuiPart39.Draggable = true
396 NewGuiPart39.Parent = NewGuiPart1
397 -------
398 local NewGuiPart40 = Instance.new("TextLabel")
399 NewGuiPart40.BackgroundColor3 = Color3.new(0.639216, 0.635294, 0.647059)
400 NewGuiPart40.BackgroundTransparency = 1
401 NewGuiPart40.Name = "Title"
402 NewGuiPart40.Size = UDim2.new(1, 0, 1, 0)
403 NewGuiPart40.ZIndex = 3
404 NewGuiPart40.FontSize = Enum.FontSize.Size14
405 NewGuiPart40.Text = "Confirm"
406 NewGuiPart40.TextColor3 = Color3.new(0, 0, 0)
407 NewGuiPart40.TextXAlignment = Enum.TextXAlignment.Left
408 NewGuiPart40.Parent = NewGuiPart39
409 -------
410 local NewGuiPart41 = Instance.new("Frame")
411 NewGuiPart41.BackgroundTransparency = 0.10000000149012
412 NewGuiPart41.BorderColor3 = Color3.new(0.74902, 0.74902, 0.74902)
413 NewGuiPart41.Name = "MainWindow"
414 NewGuiPart41.Size = UDim2.new(1, 0, 0, 150)
415 NewGuiPart41.ZIndex = 2
416 NewGuiPart41.Parent = NewGuiPart39
417 -------
418 local NewGuiPart42 = Instance.new("TextButton")
419 NewGuiPart42.Active = true
420 NewGuiPart42.BackgroundTransparency = 0.5
421 NewGuiPart42.BorderColor3 = Color3.new(0, 0, 0)
422 NewGuiPart42.Name = "Yes"
423 NewGuiPart42.Position = UDim2.new(0.075000003, 0, 1, -40)
424 NewGuiPart42.Selectable = true
425 NewGuiPart42.Size = UDim2.new(0.400000006, 0, 0, 30)
426 NewGuiPart42.Style = Enum.ButtonStyle.Custom
427 NewGuiPart42.ZIndex = 2
428 NewGuiPart42.FontSize = Enum.FontSize.Size18
429 NewGuiPart42.Text = "Yes"
430 NewGuiPart42.Parent = NewGuiPart41
431 -------
432 local NewGuiPart43 = Instance.new("TextLabel")
433 NewGuiPart43.BackgroundTransparency = 1
434 NewGuiPart43.Name = "Desc"
435 NewGuiPart43.Position = UDim2.new(0, 0, 0, 20)
436 NewGuiPart43.Size = UDim2.new(1, 0, 0, 40)
437 NewGuiPart43.ZIndex = 2
438 NewGuiPart43.FontSize = Enum.FontSize.Size14
439 NewGuiPart43.Text = "The file, FILENAME, already exists. Overwrite?"
440 NewGuiPart43.TextWrapped = true
441 NewGuiPart43.Parent = NewGuiPart41
442 -------
443 local NewGuiPart44 = Instance.new("TextButton")
444 NewGuiPart44.Active = true
445 NewGuiPart44.BackgroundTransparency = 0.5
446 NewGuiPart44.BorderColor3 = Color3.new(0, 0, 0)
447 NewGuiPart44.Name = "No"
448 NewGuiPart44.Position = UDim2.new(0.524999976, 0, 1, -40)
449 NewGuiPart44.Selectable = true
450 NewGuiPart44.Size = UDim2.new(0.400000006, 0, 0, 30)
451 NewGuiPart44.Style = Enum.ButtonStyle.Custom
452 NewGuiPart44.ZIndex = 2
453 NewGuiPart44.FontSize = Enum.FontSize.Size18
454 NewGuiPart44.Text = "No"
455 NewGuiPart44.Parent = NewGuiPart41
456 -------
457 local NewGuiPart45 = Instance.new("Frame")
458 NewGuiPart45.Active = true
459 NewGuiPart45.BackgroundColor3 = Color3.new(0.913726, 0.913726, 0.913726)
460 NewGuiPart45.BorderColor3 = Color3.new(0.584314, 0.584314, 0.584314)
461 NewGuiPart45.Name = "Caution"
462 NewGuiPart45.Position = UDim2.new(0.300000012, 0, 0.300000012, 0)
463 NewGuiPart45.Size = UDim2.new(0, 350, 0, 20)
464 NewGuiPart45.Visible = false
465 NewGuiPart45.ZIndex = 5
466 NewGuiPart45.Draggable = true
467 NewGuiPart45.Parent = NewGuiPart1
468 -------
469 local NewGuiPart46 = Instance.new("TextLabel")
470 NewGuiPart46.BackgroundColor3 = Color3.new(0.639216, 0.635294, 0.647059)
471 NewGuiPart46.BackgroundTransparency = 1
472 NewGuiPart46.Name = "Title"
473 NewGuiPart46.Size = UDim2.new(1, 0, 1, 0)
474 NewGuiPart46.ZIndex = 5
475 NewGuiPart46.FontSize = Enum.FontSize.Size14
476 NewGuiPart46.Text = "Caution"
477 NewGuiPart46.TextColor3 = Color3.new(0, 0, 0)
478 NewGuiPart46.TextXAlignment = Enum.TextXAlignment.Left
479 NewGuiPart46.Parent = NewGuiPart45
480 -------
481 local NewGuiPart47 = Instance.new("Frame")
482 NewGuiPart47.BackgroundTransparency = 0.10000000149012
483 NewGuiPart47.BorderColor3 = Color3.new(0.74902, 0.74902, 0.74902)
484 NewGuiPart47.Name = "MainWindow"
485 NewGuiPart47.Size = UDim2.new(1, 0, 0, 150)
486 NewGuiPart47.ZIndex = 4
487 NewGuiPart47.Parent = NewGuiPart45
488 -------
489 local NewGuiPart48 = Instance.new("TextLabel")
490 NewGuiPart48.BackgroundTransparency = 1
491 NewGuiPart48.Name = "Desc"
492 NewGuiPart48.Position = UDim2.new(0, 0, 0, 20)
493 NewGuiPart48.Size = UDim2.new(1, 0, 0, 42)
494 NewGuiPart48.ZIndex = 4
495 NewGuiPart48.FontSize = Enum.FontSize.Size14
496 NewGuiPart48.Text = "The file, FILENAME, already exists. Overwrite?"
497 NewGuiPart48.TextWrapped = true
498 NewGuiPart48.Parent = NewGuiPart47
499 -------
500 local NewGuiPart49 = Instance.new("TextButton")
501 NewGuiPart49.Active = true
502 NewGuiPart49.BackgroundTransparency = 0.5
503 NewGuiPart49.BorderColor3 = Color3.new(0, 0, 0)
504 NewGuiPart49.Name = "Ok"
505 NewGuiPart49.Position = UDim2.new(0.300000012, 0, 1, -40)
506 NewGuiPart49.Selectable = true
507 NewGuiPart49.Size = UDim2.new(0.400000006, 0, 0, 30)
508 NewGuiPart49.Style = Enum.ButtonStyle.Custom
509 NewGuiPart49.ZIndex = 4
510 NewGuiPart49.FontSize = Enum.FontSize.Size18
511 NewGuiPart49.Text = "Ok"
512 NewGuiPart49.Parent = NewGuiPart47
513 -------
514 local NewGuiPart50 = Instance.new("Frame")
515 NewGuiPart50.Active = true
516 NewGuiPart50.BackgroundColor3 = Color3.new(0.913726, 0.913726, 0.913726)
517 NewGuiPart50.BorderColor3 = Color3.new(0.584314, 0.584314, 0.584314)
518 NewGuiPart50.Name = "CallRemote"
519 NewGuiPart50.Position = UDim2.new(0.300000012, 0, 0.300000012, 0)
520 NewGuiPart50.Size = UDim2.new(0, 350, 0, 20)
521 NewGuiPart50.Visible = false
522 NewGuiPart50.ZIndex = 2
523 NewGuiPart50.Draggable = true
524 NewGuiPart50.Parent = NewGuiPart1
525 -------
526 local NewGuiPart51 = Instance.new("TextLabel")
527 NewGuiPart51.BackgroundColor3 = Color3.new(0.639216, 0.635294, 0.647059)
528 NewGuiPart51.BackgroundTransparency = 1
529 NewGuiPart51.Name = "Title"
530 NewGuiPart51.Size = UDim2.new(1, 0, 1, 0)
531 NewGuiPart51.ZIndex = 2
532 NewGuiPart51.FontSize = Enum.FontSize.Size14
533 NewGuiPart51.Text = "Call Remote"
534 NewGuiPart51.TextColor3 = Color3.new(0, 0, 0)
535 NewGuiPart51.TextXAlignment = Enum.TextXAlignment.Left
536 NewGuiPart51.Parent = NewGuiPart50
537 -------
538 local NewGuiPart52 = Instance.new("Frame")
539 NewGuiPart52.BackgroundTransparency = 0.10000000149012
540 NewGuiPart52.BorderColor3 = Color3.new(0.74902, 0.74902, 0.74902)
541 NewGuiPart52.Name = "MainWindow"
542 NewGuiPart52.Size = UDim2.new(1, 0, 0, 200)
543 NewGuiPart52.Parent = NewGuiPart50
544 -------
545 local NewGuiPart53 = Instance.new("TextLabel")
546 NewGuiPart53.BackgroundTransparency = 1
547 NewGuiPart53.Name = "Desc"
548 NewGuiPart53.Position = UDim2.new(0, 0, 0, 20)
549 NewGuiPart53.Size = UDim2.new(1, 0, 0, 20)
550 NewGuiPart53.FontSize = Enum.FontSize.Size14
551 NewGuiPart53.Text = "Arguments"
552 NewGuiPart53.TextWrapped = true
553 NewGuiPart53.Parent = NewGuiPart52
554 -------
555 local NewGuiPart54 = Instance.new("ScrollingFrame")
556 NewGuiPart54.BackgroundTransparency = 1
557 NewGuiPart54.Name = "Arguments"
558 NewGuiPart54.Position = UDim2.new(0, 0, 0, 40)
559 NewGuiPart54.Selectable = true
560 NewGuiPart54.Size = UDim2.new(1, 0, 0, 80)
561 NewGuiPart54.BottomImage = "rbxasset://textures/blackBkg_square.png"
562 NewGuiPart54.CanvasSize = UDim2.new(0, 0, 0, 0)
563 NewGuiPart54.MidImage = "rbxasset://textures/blackBkg_square.png"
564 NewGuiPart54.TopImage = "rbxasset://textures/blackBkg_square.png"
565 NewGuiPart54.ClipsDescendants = true
566 NewGuiPart54.Parent = NewGuiPart52
567 -------
568 local NewGuiPart55 = Instance.new("TextButton")
569 NewGuiPart55.Active = true
570 NewGuiPart55.BackgroundTransparency = 0.60000002384186
571 NewGuiPart55.Name = "DisplayReturned"
572 NewGuiPart55.Position = UDim2.new(0.075000003, 0, 0.625, 0)
573 NewGuiPart55.Selectable = true
574 NewGuiPart55.Size = UDim2.new(0, 20, 0, 20)
575 NewGuiPart55.Style = Enum.ButtonStyle.Custom
576 NewGuiPart55.ZIndex = 2
577 NewGuiPart55.FontSize = Enum.FontSize.Size18
578 NewGuiPart55.Text = ""
579 NewGuiPart55.TextColor3 = Color3.new(1, 1, 1)
580 NewGuiPart55.Parent = NewGuiPart52
581 -------
582 local NewGuiPart56 = Instance.new("TextLabel")
583 NewGuiPart56.BackgroundColor3 = Color3.new(0.380392, 0.380392, 0.380392)
584 NewGuiPart56.BackgroundTransparency = 0.40000000596046
585 NewGuiPart56.BorderSizePixel = 0
586 NewGuiPart56.Name = "enabled"
587 NewGuiPart56.Position = UDim2.new(0, 3, 0, 3)
588 NewGuiPart56.Size = UDim2.new(0, 14, 0, 14)
589 NewGuiPart56.Visible = false
590 NewGuiPart56.FontSize = Enum.FontSize.Size14
591 NewGuiPart56.Text = ""
592 NewGuiPart56.Parent = NewGuiPart55
593 -------
594 local NewGuiPart57 = Instance.new("TextLabel")
595 NewGuiPart57.BackgroundTransparency = 1
596 NewGuiPart57.Name = "Desc2"
597 NewGuiPart57.Position = UDim2.new(0.075000003, 30, 0.625, 0)
598 NewGuiPart57.Size = UDim2.new(0.925000012, -30, 0, 20)
599 NewGuiPart57.FontSize = Enum.FontSize.Size14
600 NewGuiPart57.Text = "Display values returned"
601 NewGuiPart57.TextXAlignment = Enum.TextXAlignment.Left
602 NewGuiPart57.Parent = NewGuiPart52
603 -------
604 local NewGuiPart58 = Instance.new("TextButton")
605 NewGuiPart58.Active = true
606 NewGuiPart58.BackgroundTransparency = 0.5
607 NewGuiPart58.BorderColor3 = Color3.new(0, 0, 0)
608 NewGuiPart58.Name = "Add"
609 NewGuiPart58.Position = UDim2.new(0.800000012, 0, 0.625, 0)
610 NewGuiPart58.Selectable = true
611 NewGuiPart58.Size = UDim2.new(0, 20, 0, 20)
612 NewGuiPart58.Style = Enum.ButtonStyle.Custom
613 NewGuiPart58.Font = Enum.Font.SourceSansBold
614 NewGuiPart58.FontSize = Enum.FontSize.Size24
615 NewGuiPart58.Text = "+"
616 NewGuiPart58.Parent = NewGuiPart52
617 -------
618 local NewGuiPart59 = Instance.new("TextButton")
619 NewGuiPart59.Active = true
620 NewGuiPart59.BackgroundTransparency = 0.5
621 NewGuiPart59.BorderColor3 = Color3.new(0, 0, 0)
622 NewGuiPart59.Name = "Subtract"
623 NewGuiPart59.Position = UDim2.new(0.899999976, 0, 0.625, 0)
624 NewGuiPart59.Selectable = true
625 NewGuiPart59.Size = UDim2.new(0, 20, 0, 20)
626 NewGuiPart59.Style = Enum.ButtonStyle.Custom
627 NewGuiPart59.Font = Enum.Font.SourceSansBold
628 NewGuiPart59.FontSize = Enum.FontSize.Size24
629 NewGuiPart59.Text = "-"
630 NewGuiPart59.Parent = NewGuiPart52
631 -------
632 local NewGuiPart60 = Instance.new("Frame")
633 NewGuiPart60.BackgroundTransparency = 0.5
634 NewGuiPart60.BorderColor3 = Color3.new(0.74902, 0.74902, 0.74902)
635 NewGuiPart60.Name = "ArgumentTemplate"
636 NewGuiPart60.Size = UDim2.new(1, 0, 0, 20)
637 NewGuiPart60.Visible = false
638 NewGuiPart60.Parent = NewGuiPart52
639 -------
640 local NewGuiPart61 = Instance.new("TextButton")
641 NewGuiPart61.Active = true
642 NewGuiPart61.BackgroundTransparency = 0.89999997615814
643 NewGuiPart61.BorderColor3 = Color3.new(0, 0, 0)
644 NewGuiPart61.Name = "Type"
645 NewGuiPart61.Selectable = true
646 NewGuiPart61.Size = UDim2.new(0.400000006, 0, 0, 20)
647 NewGuiPart61.Style = Enum.ButtonStyle.Custom
648 NewGuiPart61.FontSize = Enum.FontSize.Size18
649 NewGuiPart61.Text = "Script"
650 NewGuiPart61.Parent = NewGuiPart60
651 -------
652 local NewGuiPart62 = Instance.new("TextBox")
653 NewGuiPart62.BackgroundTransparency = 0.89999997615814
654 NewGuiPart62.Name = "Value"
655 NewGuiPart62.Position = UDim2.new(0.400000006, 0, 0, 0)
656 NewGuiPart62.Size = UDim2.new(0.600000024, -12, 0, 20)
657 NewGuiPart62.FontSize = Enum.FontSize.Size14
658 NewGuiPart62.Text = ""
659 NewGuiPart62.TextXAlignment = Enum.TextXAlignment.Left
660 NewGuiPart62.Parent = NewGuiPart60
661 -------
662 local NewGuiPart63 = Instance.new("TextButton")
663 NewGuiPart63.Active = true
664 NewGuiPart63.BackgroundTransparency = 0.5
665 NewGuiPart63.BorderColor3 = Color3.new(0, 0, 0)
666 NewGuiPart63.Name = "Cancel"
667 NewGuiPart63.Position = UDim2.new(0.524999976, 0, 1, -40)
668 NewGuiPart63.Selectable = true
669 NewGuiPart63.Size = UDim2.new(0.400000006, 0, 0, 30)
670 NewGuiPart63.Style = Enum.ButtonStyle.Custom
671 NewGuiPart63.FontSize = Enum.FontSize.Size18
672 NewGuiPart63.Text = "Cancel"
673 NewGuiPart63.Parent = NewGuiPart52
674 -------
675 local NewGuiPart64 = Instance.new("TextButton")
676 NewGuiPart64.Active = true
677 NewGuiPart64.BackgroundTransparency = 0.5
678 NewGuiPart64.BorderColor3 = Color3.new(0, 0, 0)
679 NewGuiPart64.Name = "Ok"
680 NewGuiPart64.Position = UDim2.new(0.075000003, 0, 1, -40)
681 NewGuiPart64.Selectable = true
682 NewGuiPart64.Size = UDim2.new(0.400000006, 0, 0, 30)
683 NewGuiPart64.Style = Enum.ButtonStyle.Custom
684 NewGuiPart64.FontSize = Enum.FontSize.Size18
685 NewGuiPart64.Text = "Call"
686 NewGuiPart64.Parent = NewGuiPart52
687 -------
688 local NewGuiPart65 = Instance.new("Frame")
689 NewGuiPart65.Active = true
690 NewGuiPart65.BackgroundColor3 = Color3.new(0.913726, 0.913726, 0.913726)
691 NewGuiPart65.BorderColor3 = Color3.new(0.584314, 0.584314, 0.584314)
692 NewGuiPart65.Name = "TableCaution"
693 NewGuiPart65.Position = UDim2.new(0.300000012, 0, 0.300000012, 0)
694 NewGuiPart65.Size = UDim2.new(0, 350, 0, 20)
695 NewGuiPart65.Visible = false
696 NewGuiPart65.ZIndex = 2
697 NewGuiPart65.Draggable = true
698 NewGuiPart65.Parent = NewGuiPart1
699 -------
700 local NewGuiPart66 = Instance.new("Frame")
701 NewGuiPart66.BackgroundTransparency = 0.10000000149012
702 NewGuiPart66.BorderColor3 = Color3.new(0.74902, 0.74902, 0.74902)
703 NewGuiPart66.Name = "MainWindow"
704 NewGuiPart66.Size = UDim2.new(1, 0, 0, 150)
705 NewGuiPart66.Parent = NewGuiPart65
706 -------
707 local NewGuiPart67 = Instance.new("TextButton")
708 NewGuiPart67.Active = true
709 NewGuiPart67.BackgroundTransparency = 0.5
710 NewGuiPart67.BorderColor3 = Color3.new(0, 0, 0)
711 NewGuiPart67.Name = "Ok"
712 NewGuiPart67.Position = UDim2.new(0.300000012, 0, 1, -40)
713 NewGuiPart67.Selectable = true
714 NewGuiPart67.Size = UDim2.new(0.400000006, 0, 0, 30)
715 NewGuiPart67.Style = Enum.ButtonStyle.Custom
716 NewGuiPart67.FontSize = Enum.FontSize.Size18
717 NewGuiPart67.Text = "Ok"
718 NewGuiPart67.Parent = NewGuiPart66
719 -------
720 local NewGuiPart68 = Instance.new("ScrollingFrame")
721 NewGuiPart68.BackgroundTransparency = 1
722 NewGuiPart68.Name = "TableResults"
723 NewGuiPart68.Position = UDim2.new(0, 0, 0, 20)
724 NewGuiPart68.Selectable = true
725 NewGuiPart68.Size = UDim2.new(1, 0, 0, 80)
726 NewGuiPart68.BottomImage = "rbxasset://textures/blackBkg_square.png"
727 NewGuiPart68.CanvasSize = UDim2.new(0, 0, 0, 0)
728 NewGuiPart68.MidImage = "rbxasset://textures/blackBkg_square.png"
729 NewGuiPart68.TopImage = "rbxasset://textures/blackBkg_square.png"
730 NewGuiPart68.ClipsDescendants = true
731 NewGuiPart68.Parent = NewGuiPart66
732 -------
733 local NewGuiPart69 = Instance.new("Frame")
734 NewGuiPart69.BackgroundTransparency = 0.5
735 NewGuiPart69.BorderColor3 = Color3.new(0.74902, 0.74902, 0.74902)
736 NewGuiPart69.Name = "TableTemplate"
737 NewGuiPart69.Size = UDim2.new(1, 0, 0, 20)
738 NewGuiPart69.Visible = false
739 NewGuiPart69.Parent = NewGuiPart66
740 -------
741 local NewGuiPart70 = Instance.new("TextLabel")
742 NewGuiPart70.BackgroundTransparency = 0.89999997615814
743 NewGuiPart70.Name = "Type"
744 NewGuiPart70.Size = UDim2.new(0.400000006, 0, 0, 20)
745 NewGuiPart70.FontSize = Enum.FontSize.Size18
746 NewGuiPart70.Text = "Script"
747 NewGuiPart70.Parent = NewGuiPart69
748 -------
749 local NewGuiPart71 = Instance.new("TextLabel")
750 NewGuiPart71.BackgroundTransparency = 0.89999997615814
751 NewGuiPart71.Name = "Value"
752 NewGuiPart71.Position = UDim2.new(0.400000006, 0, 0, 0)
753 NewGuiPart71.Size = UDim2.new(0.600000024, -12, 0, 20)
754 NewGuiPart71.FontSize = Enum.FontSize.Size14
755 NewGuiPart71.Text = "Script"
756 NewGuiPart71.Parent = NewGuiPart69
757 -------
758 local NewGuiPart72 = Instance.new("TextLabel")
759 NewGuiPart72.BackgroundColor3 = Color3.new(0.639216, 0.635294, 0.647059)
760 NewGuiPart72.BackgroundTransparency = 1
761 NewGuiPart72.Name = "Title"
762 NewGuiPart72.Size = UDim2.new(1, 0, 1, 0)
763 NewGuiPart72.ZIndex = 2
764 NewGuiPart72.FontSize = Enum.FontSize.Size14
765 NewGuiPart72.Text = "Caution"
766 NewGuiPart72.TextColor3 = Color3.new(0, 0, 0)
767 NewGuiPart72.TextXAlignment = Enum.TextXAlignment.Left
768 NewGuiPart72.Parent = NewGuiPart65
769
770 return NewGuiPart1
771end
772
773local D_E_X = CreateGui()
774
775local what = Instance.new("BindableFunction",D_E_X.ExplorerPanel)
776what.Name = "GetOption"
777local what = Instance.new("BindableFunction",D_E_X.ExplorerPanel)
778what.Name = "SetOption"
779local what = Instance.new("BindableFunction",D_E_X.ExplorerPanel)
780what.Name = "GetSelection"
781local what = Instance.new("BindableFunction",D_E_X.ExplorerPanel)
782what.Name = "SetSelection"
783local what = Instance.new("BindableEvent",D_E_X.ExplorerPanel)
784what.Name = "SelectionChanged"
785
786local what = Instance.new("BindableFunction",D_E_X.PropertiesFrame)
787what.Name = "GetApi"
788local what = Instance.new("BindableFunction",D_E_X.PropertiesFrame)
789what.Name = "GetAwaiting"
790local what = Instance.new("BindableEvent",D_E_X.PropertiesFrame)
791what.Name = "SetAwaiting"
792
793local what = Instance.new("BindableFunction",D_E_X.SettingsPanel)
794what.Name = "GetSetting"
795
796D_E_X.Parent = game.CoreGui
797
798spawn(function()
799 local Gui = D_E_X
800
801local SideMenu = Gui:WaitForChild("SideMenu")
802local OpenToggleButton = Gui:WaitForChild("Toggle")
803local CloseToggleButton = SideMenu:WaitForChild("Toggle")
804local ExplorerButton = SideMenu:WaitForChild("Explorer")
805local SettingsButton = SideMenu:WaitForChild("Settings")
806
807local SelectionBox = Instance.new("SelectionBox")
808SelectionBox.Parent = Gui
809
810local ExplorerPanel = Gui:WaitForChild("ExplorerPanel")
811local PropertiesFrame = Gui:WaitForChild("PropertiesFrame")
812local SettingsPanel = Gui:WaitForChild("SettingsPanel")
813
814local SettingsListener = SettingsPanel:WaitForChild("GetSetting")
815
816local ClickSelectOption = SettingsPanel:WaitForChild("ClickSelect"):WaitForChild("Change")
817local SelectionBoxOption = SettingsPanel:WaitForChild("SelectionBox"):WaitForChild("Change")
818local ClearPropsOption = SettingsPanel:WaitForChild("ClearProperties"):WaitForChild("Change")
819local SelectUngroupedOption = SettingsPanel:WaitForChild("SelectUngrouped"):WaitForChild("Change")
820
821local SelectionChanged = ExplorerPanel:WaitForChild("SelectionChanged")
822local GetSelection = ExplorerPanel:WaitForChild("GetSelection")
823local SetSelection = ExplorerPanel:WaitForChild("SetSelection")
824
825local Player = game:GetService("Players").LocalPlayer
826local Mouse = Player:GetMouse()
827
828local CurrentWindow = "Explorer"
829
830local Settings = {
831 ClickSelect = false,
832 SelBox = false,
833 ClearProps = false,
834 SelectUngrouped = true
835}
836
837function ReturnSetting(set)
838 if set == "ClearProps" then
839 return Settings.ClearProps
840 elseif set == "SelectUngrouped" then
841 return Settings.SelectUngrouped
842 end
843end
844
845OpenToggleButton.MouseButton1Up:connect(function()
846 SideMenu:TweenPosition(UDim2.new(1, -330, 0, 0), "Out", "Quad", 0.5, true)
847
848 if CurrentWindow == "Explorer" then
849 ExplorerPanel:TweenPosition(UDim2.new(1, -300, 0, 0), "Out", "Quad", 0.5, true)
850 PropertiesFrame:TweenPosition(UDim2.new(1, -300, 0.5, 21), "Out", "Quad", 0.5, true)
851 else
852 SettingsPanel:TweenPosition(UDim2.new(1, -300, 0, 0), "Out", "Quad", 0.5, true)
853 end
854
855 OpenToggleButton:TweenPosition(UDim2.new(1,0,0,0), "Out", "Quad", 0.5, true)
856end)
857
858CloseToggleButton.MouseButton1Up:connect(function()
859 SideMenu:TweenPosition(UDim2.new(1, 0, 0, 0), "Out", "Quad", 0.5, true)
860
861 ExplorerPanel:TweenPosition(UDim2.new(1, 30, 0, 0), "Out", "Quad", 0.5, true)
862 PropertiesFrame:TweenPosition(UDim2.new(1, 30, 0.5, 21), "Out", "Quad", 0.5, true)
863 SettingsPanel:TweenPosition(UDim2.new(1, 30, 0, 0), "Out", "Quad", 0.5, true)
864
865 OpenToggleButton:TweenPosition(UDim2.new(1,-30,0,0), "Out", "Quad", 0.5, true)
866end)
867
868ExplorerButton.MouseButton1Up:connect(function()
869 if CurrentWindow ~= "Explorer" then
870 CurrentWindow = "Explorer"
871
872 ExplorerPanel:TweenPosition(UDim2.new(1, -300, 0, 0), "Out", "Quad", 0.5, true)
873 PropertiesFrame:TweenPosition(UDim2.new(1, -300, 0.5, 21), "Out", "Quad", 0.5, true)
874 SettingsPanel:TweenPosition(UDim2.new(1, 0, 0, 0), "Out", "Quad", 0.5, true)
875 end
876end)
877
878SettingsButton.MouseButton1Up:connect(function()
879 if CurrentWindow ~= "Settings" then
880 CurrentWindow = "Settings"
881
882 ExplorerPanel:TweenPosition(UDim2.new(1, 0, 0, 0), "Out", "Quad", 0.5, true)
883 PropertiesFrame:TweenPosition(UDim2.new(1, 0, 0.5, 21), "Out", "Quad", 0.5, true)
884 SettingsPanel:TweenPosition(UDim2.new(1, -300, 0, 0), "Out", "Quad", 0.5, true)
885 end
886end)
887
888ClickSelectOption.MouseButton1Up:connect(function()
889 if Settings.ClickSelect then
890 Settings.ClickSelect = false
891 ClickSelectOption.Text = "OFF"
892 else
893 Settings.ClickSelect = true
894 ClickSelectOption.Text = "ON"
895 end
896end)
897
898SelectionBoxOption.MouseButton1Up:connect(function()
899 if Settings.SelBox then
900 Settings.SelBox = false
901 SelectionBox.Adornee = nil
902 SelectionBoxOption.Text = "OFF"
903 else
904 Settings.SelBox = true
905 SelectionBoxOption.Text = "ON"
906 end
907end)
908
909ClearPropsOption.MouseButton1Up:connect(function()
910 if Settings.ClearProps then
911 Settings.ClearProps = false
912 ClearPropsOption.Text = "OFF"
913 else
914 Settings.ClearProps = true
915 ClearPropsOption.Text = "ON"
916 end
917end)
918
919SelectUngroupedOption.MouseButton1Up:connect(function()
920 if Settings.SelectUngrouped then
921 Settings.SelectUngrouped = false
922 SelectUngroupedOption.Text = "OFF"
923 else
924 Settings.SelectUngrouped = true
925 SelectUngroupedOption.Text = "ON"
926 end
927end)
928
929local function getSelection()
930 local t = GetSelection:Invoke()
931 if t and #t > 0 then
932 return t[1]
933 else
934 return nil
935 end
936end
937
938Mouse.Button1Down:connect(function()
939 if CurrentWindow == "Explorer" and Settings.ClickSelect then
940 local target = Mouse.Target
941 if target then
942 SetSelection:Invoke({target})
943 end
944 end
945end)
946
947SelectionChanged.Event:connect(function()
948 if Settings.SelBox then
949 local success,err = pcall(function()
950 local selection = getSelection()
951 SelectionBox.Adornee = selection
952 end)
953 if err then
954 SelectionBox.Adornee = nil
955 end
956 end
957end)
958
959SettingsListener.OnInvoke = ReturnSetting
960end)
961
962spawn(function()
963 -- initial states
964local Option = {
965 -- can modify object parents in the hierarchy
966 Modifiable = false;
967 -- can select objects
968 Selectable = true;
969}
970
971-- MERELY
972
973Option.Modifiable = true
974
975-- END MERELY
976
977-- general size of GUI objects, in pixels
978local GUI_SIZE = 16
979-- padding between items within each entry
980local ENTRY_PADDING = 1
981-- padding between each entry
982local ENTRY_MARGIN = 1
983
984local Input = game:GetService("UserInputService")
985local HoldingCtrl = false
986local HoldingShift = false
987
988--[[
989
990# Explorer Panel
991
992A GUI panel that displays the game hierarchy.
993
994
995## Selection Bindables
996
997- `Function GetSelection ( )`
998
999 Returns an array of objects representing the objects currently
1000 selected in the panel.
1001
1002- `Function SetSelection ( Objects selection )`
1003
1004 Sets the objects that are selected in the panel. `selection` is an array
1005 of objects.
1006
1007- `Event SelectionChanged ( )`
1008
1009 Fired after the selection changes.
1010
1011
1012## Option Bindables
1013
1014- `Function GetOption ( string optionName )`
1015
1016 If `optionName` is given, returns the value of that option. Otherwise,
1017 returns a table of options and their current values.
1018
1019- `Function SetOption ( string optionName, bool value )`
1020
1021 Sets `optionName` to `value`.
1022
1023 Options:
1024
1025 - Modifiable
1026
1027 Whether objects can be modified by the panel.
1028
1029 Note that modifying objects depends on being able to select them. If
1030 Selectable is false, then Actions will not be available. Reparenting
1031 is still possible, but only for the dragged object.
1032
1033 - Selectable
1034
1035 Whether objects can be selected.
1036
1037 If Modifiable is false, then left-clicking will perform a drag
1038 selection.
1039
1040## Updates
1041
1042- 2013-09-18
1043 - Fixed explorer icons to match studio explorer.
1044
1045- 2013-09-14
1046 - Added GetOption and SetOption bindables.
1047 - Option: Modifiable; sets whether objects can be modified by the panel.
1048 - Option: Selectable; sets whether objects can be selected.
1049 - Slight modification to left-click selection behavior.
1050 - Improved layout and scaling.
1051
1052- 2013-09-13
1053 - Added drag to reparent objects.
1054 - Left-click to select/deselect object.
1055 - Left-click and drag unselected object to reparent single object.
1056 - Left-click and drag selected object to move reparent entire selection.
1057 - Right-click while dragging to cancel.
1058
1059- 2013-09-11
1060 - Added explorer panel header with actions.
1061 - Added Cut action.
1062 - Added Copy action.
1063 - Added Paste action.
1064 - Added Delete action.
1065 - Added drag selection.
1066 - Left-click: Add to selection on drag.
1067 - Right-click: Add to or remove from selection on drag.
1068 - Ensured SelectionChanged fires only when the selection actually changes.
1069 - Added documentation and change log.
1070 - Fixed thread issue.
1071
1072- 2013-09-09
1073 - Added basic multi-selection.
1074 - Left-click to set selection.
1075 - Right-click to add to or remove from selection.
1076 - Removed "Selection" ObjectValue.
1077 - Added GetSelection BindableFunction.
1078 - Added SetSelection BindableFunction.
1079 - Added SelectionChanged BindableEvent.
1080 - Changed font to SourceSans.
1081
1082- 2013-08-31
1083 - Improved GUI sizing based off of `GUI_SIZE` constant.
1084 - Automatic font size detection.
1085
1086- 2013-08-27
1087 - Initial explorer panel.
1088
1089
1090## Todo
1091
1092- Sorting
1093 - by ExplorerOrder
1094 - by children
1095 - by name
1096- Drag objects to reparent
1097
1098]]
1099
1100local ENTRY_SIZE = GUI_SIZE + ENTRY_PADDING*2
1101local ENTRY_BOUND = ENTRY_SIZE + ENTRY_MARGIN
1102local HEADER_SIZE = ENTRY_SIZE*2
1103
1104local FONT = 'SourceSans'
1105local FONT_SIZE do
1106 local size = {8,9,10,11,12,14,18,24,36,48}
1107 local s
1108 local n = math.huge
1109 for i = 1,#size do
1110 if size[i] <= GUI_SIZE then
1111 FONT_SIZE = i - 1
1112 end
1113 end
1114end
1115
1116local GuiColor = {
1117 Background = Color3.new(233/255, 233/255, 233/255);
1118 Border = Color3.new(149/255, 149/255, 149/255);
1119 Selected = Color3.new( 96/255, 140/255, 211/255);
1120 BorderSelected = Color3.new( 86/255, 125/255, 188/255);
1121 Text = Color3.new( 0/255, 0/255, 0/255);
1122 TextDisabled = Color3.new(128/255, 128/255, 128/255);
1123 TextSelected = Color3.new(255/255, 255/255, 255/255);
1124 Button = Color3.new(221/255, 221/255, 221/255);
1125 ButtonBorder = Color3.new(149/255, 149/255, 149/255);
1126 ButtonSelected = Color3.new(255/255, 0/255, 0/255);
1127 Field = Color3.new(255/255, 255/255, 255/255);
1128 FieldBorder = Color3.new(191/255, 191/255, 191/255);
1129 TitleBackground = Color3.new(178/255, 178/255, 178/255);
1130}
1131
1132----------------------------------------------------------------
1133----------------------------------------------------------------
1134----------------------------------------------------------------
1135----------------------------------------------------------------
1136---- Icon map constants
1137
1138local MAP_ID = 418720155
1139
1140-- Indices based on implementation of Icon function.
1141local ACTION_CUT = 160
1142local ACTION_COPY = 161
1143local ACTION_PASTE = 162
1144local ACTION_DELETE = 163
1145local ACTION_SORT = 164
1146local ACTION_CUT_OVER = 174
1147local ACTION_COPY_OVER = 175
1148local ACTION_PASTE_OVER = 176
1149local ACTION_DELETE_OVER = 177
1150local ACTION_SORT_OVER = 178
1151
1152local NODE_COLLAPSED = 165
1153local NODE_EXPANDED = 166
1154local NODE_COLLAPSED_OVER = 179
1155local NODE_EXPANDED_OVER = 180
1156
1157local ExplorerIndex = {
1158 ["Accessory"] = 32;
1159 ["Accoutrement"] = 32;
1160 ["AdService"] = 73;
1161 ["Animation"] = 60;
1162 ["AnimationController"] = 60;
1163 ["AnimationTrack"] = 60;
1164 ["Animator"] = 60;
1165 ["ArcHandles"] = 56;
1166 ["AssetService"] = 72;
1167 ["Attachment"] = 34;
1168 ["Backpack"] = 20;
1169 ["BadgeService"] = 75;
1170 ["BallSocketConstraint"] = 89;
1171 ["BillboardGui"] = 64;
1172 ["BinaryStringValue"] = 4;
1173 ["BindableEvent"] = 67;
1174 ["BindableFunction"] = 66;
1175 ["BlockMesh"] = 8;
1176 ["BloomEffect"] = 90;
1177 ["BlurEffect"] = 90;
1178 ["BodyAngularVelocity"] = 14;
1179 ["BodyForce"] = 14;
1180 ["BodyGyro"] = 14;
1181 ["BodyPosition"] = 14;
1182 ["BodyThrust"] = 14;
1183 ["BodyVelocity"] = 14;
1184 ["BoolValue"] = 4;
1185 ["BoxHandleAdornment"] = 54;
1186 ["BrickColorValue"] = 4;
1187 ["Camera"] = 5;
1188 ["CFrameValue"] = 4;
1189 ["CharacterMesh"] = 60;
1190 ["Chat"] = 33;
1191 ["ClickDetector"] = 41;
1192 ["CollectionService"] = 30;
1193 ["Color3Value"] = 4;
1194 ["ColorCorrectionEffect"] = 90;
1195 ["ConeHandleAdornment"] = 54;
1196 ["Configuration"] = 58;
1197 ["ContentProvider"] = 72;
1198 ["ContextActionService"] = 41;
1199 ["CoreGui"] = 46;
1200 ["CoreScript"] = 18;
1201 ["CornerWedgePart"] = 1;
1202 ["CustomEvent"] = 4;
1203 ["CustomEventReceiver"] = 4;
1204 ["CylinderHandleAdornment"] = 54;
1205 ["CylinderMesh"] = 8;
1206 ["CylindricalConstraint"] = 89;
1207 ["Debris"] = 30;
1208 ["Decal"] = 7;
1209 ["Dialog"] = 62;
1210 ["DialogChoice"] = 63;
1211 ["DoubleConstrainedValue"] = 4;
1212 ["Explosion"] = 36;
1213 ["FileMesh"] = 8;
1214 ["Fire"] = 61;
1215 ["Flag"] = 38;
1216 ["FlagStand"] = 39;
1217 ["FloorWire"] = 4;
1218 ["Folder"] = 70;
1219 ["ForceField"] = 37;
1220 ["Frame"] = 48;
1221 ["GamePassService"] = 19;
1222 ["Glue"] = 34;
1223 ["GuiButton"] = 52;
1224 ["GuiMain"] = 47;
1225 ["GuiService"] = 47;
1226 ["Handles"] = 53;
1227 ["HapticService"] = 84;
1228 ["Hat"] = 45;
1229 ["HingeConstraint"] = 89;
1230 ["Hint"] = 33;
1231 ["HopperBin"] = 22;
1232 ["HttpService"] = 76;
1233 ["Humanoid"] = 9;
1234 ["ImageButton"] = 52;
1235 ["ImageLabel"] = 49;
1236 ["InsertService"] = 72;
1237 ["IntConstrainedValue"] = 4;
1238 ["IntValue"] = 4;
1239 ["JointInstance"] = 34;
1240 ["JointsService"] = 34;
1241 ["Keyframe"] = 60;
1242 ["KeyframeSequence"] = 60;
1243 ["KeyframeSequenceProvider"] = 60;
1244 ["Lighting"] = 13;
1245 ["LineHandleAdornment"] = 54;
1246 ["LocalScript"] = 18;
1247 ["LogService"] = 87;
1248 ["MarketplaceService"] = 46;
1249 ["Message"] = 33;
1250 ["Model"] = 2;
1251 ["ModuleScript"] = 71;
1252 ["Motor"] = 34;
1253 ["Motor6D"] = 34;
1254 ["MoveToConstraint"] = 89;
1255 ["NegateOperation"] = 78;
1256 ["NetworkClient"] = 16;
1257 ["NetworkReplicator"] = 29;
1258 ["NetworkServer"] = 15;
1259 ["NumberValue"] = 4;
1260 ["ObjectValue"] = 4;
1261 ["Pants"] = 44;
1262 ["ParallelRampPart"] = 1;
1263 ["Part"] = 1;
1264 ["ParticleEmitter"] = 69;
1265 ["PartPairLasso"] = 57;
1266 ["PathfindingService"] = 37;
1267 ["Platform"] = 35;
1268 ["Player"] = 12;
1269 ["PlayerGui"] = 46;
1270 ["Players"] = 21;
1271 ["PlayerScripts"] = 82;
1272 ["PointLight"] = 13;
1273 ["PointsService"] = 83;
1274 ["Pose"] = 60;
1275 ["PrismaticConstraint"] = 89;
1276 ["PrismPart"] = 1;
1277 ["PyramidPart"] = 1;
1278 ["RayValue"] = 4;
1279 ["ReflectionMetadata"] = 86;
1280 ["ReflectionMetadataCallbacks"] = 86;
1281 ["ReflectionMetadataClass"] = 86;
1282 ["ReflectionMetadataClasses"] = 86;
1283 ["ReflectionMetadataEnum"] = 86;
1284 ["ReflectionMetadataEnumItem"] = 86;
1285 ["ReflectionMetadataEnums"] = 86;
1286 ["ReflectionMetadataEvents"] = 86;
1287 ["ReflectionMetadataFunctions"] = 86;
1288 ["ReflectionMetadataMember"] = 86;
1289 ["ReflectionMetadataProperties"] = 86;
1290 ["ReflectionMetadataYieldFunctions"] = 86;
1291 ["RemoteEvent"] = 80;
1292 ["RemoteFunction"] = 79;
1293 ["ReplicatedFirst"] = 72;
1294 ["ReplicatedStorage"] = 72;
1295 ["RightAngleRampPart"] = 1;
1296 ["RocketPropulsion"] = 14;
1297 ["RodConstraint"] = 89;
1298 ["RopeConstraint"] = 89;
1299 ["Rotate"] = 34;
1300 ["RotateP"] = 34;
1301 ["RotateV"] = 34;
1302 ["RunService"] = 66;
1303 ["ScreenGui"] = 47;
1304 ["Script"] = 6;
1305 ["ScrollingFrame"] = 48;
1306 ["Seat"] = 35;
1307 ["Selection"] = 55;
1308 ["SelectionBox"] = 54;
1309 ["SelectionPartLasso"] = 57;
1310 ["SelectionPointLasso"] = 57;
1311 ["SelectionSphere"] = 54;
1312 ["ServerScriptService"] = 0;
1313 ["ServerStorage"] = 74;
1314 ["Shirt"] = 43;
1315 ["ShirtGraphic"] = 40;
1316 ["SkateboardPlatform"] = 35;
1317 ["Sky"] = 28;
1318 ["SlidingBallConstraint"] = 89;
1319 ["Smoke"] = 59;
1320 ["Snap"] = 34;
1321 ["Sound"] = 11;
1322 ["SoundService"] = 31;
1323 ["Sparkles"] = 42;
1324 ["SpawnLocation"] = 25;
1325 ["SpecialMesh"] = 8;
1326 ["SphereHandleAdornment"] = 54;
1327 ["SpotLight"] = 13;
1328 ["SpringConstraint"] = 89;
1329 ["StarterCharacterScripts"] = 82;
1330 ["StarterGear"] = 20;
1331 ["StarterGui"] = 46;
1332 ["StarterPack"] = 20;
1333 ["StarterPlayer"] = 88;
1334 ["StarterPlayerScripts"] = 82;
1335 ["Status"] = 2;
1336 ["StringValue"] = 4;
1337 ["SunRaysEffect"] = 90;
1338 ["SurfaceGui"] = 64;
1339 ["SurfaceLight"] = 13;
1340 ["SurfaceSelection"] = 55;
1341 ["Team"] = 24;
1342 ["Teams"] = 23;
1343 ["TeleportService"] = 81;
1344 ["Terrain"] = 65;
1345 ["TerrainRegion"] = 65;
1346 ["TestService"] = 68;
1347 ["TextBox"] = 51;
1348 ["TextButton"] = 51;
1349 ["TextLabel"] = 50;
1350 ["Texture"] = 10;
1351 ["TextureTrail"] = 4;
1352 ["Tool"] = 17;
1353 ["TouchTransmitter"] = 37;
1354 ["TrussPart"] = 1;
1355 ["UnionOperation"] = 77;
1356 ["UserInputService"] = 84;
1357 ["Vector3Value"] = 4;
1358 ["VehicleSeat"] = 35;
1359 ["VelocityMotor"] = 34;
1360 ["WedgePart"] = 1;
1361 ["Weld"] = 34;
1362 ["Workspace"] = 19;
1363}
1364
1365----------------------------------------------------------------
1366----------------------------------------------------------------
1367----------------------------------------------------------------
1368----------------------------------------------------------------
1369----------------------------------------------------------------
1370
1371function Create(ty,data)
1372 local obj
1373 if type(ty) == 'string' then
1374 obj = Instance.new(ty)
1375 else
1376 obj = ty
1377 end
1378 for k, v in pairs(data) do
1379 if type(k) == 'number' then
1380 v.Parent = obj
1381 else
1382 obj[k] = v
1383 end
1384 end
1385 return obj
1386end
1387
1388local barActive = false
1389local activeOptions = {}
1390
1391function createDDown(dBut, callback,...)
1392 if barActive then
1393 for i,v in pairs(activeOptions) do
1394 v:Destroy()
1395 end
1396 activeOptions = {}
1397 barActive = false
1398 return
1399 else
1400 barActive = true
1401 end
1402 local slots = {...}
1403 local base = dBut
1404 for i,v in pairs(slots) do
1405 local newOption = base:Clone()
1406 newOption.ZIndex = 5
1407 newOption.Name = "Option "..tostring(i)
1408 newOption.Parent = base.Parent.Parent.Parent
1409 newOption.BackgroundTransparency = 0
1410 newOption.ZIndex = 2
1411 table.insert(activeOptions,newOption)
1412 newOption.Position = UDim2.new(-0.4, dBut.Position.X.Offset, dBut.Position.Y.Scale, dBut.Position.Y.Offset + (#activeOptions * dBut.Size.Y.Offset))
1413 newOption.Text = slots[i]
1414 newOption.MouseButton1Down:connect(function()
1415 dBut.Text = slots[i]
1416 callback(slots[i])
1417 for i,v in pairs(activeOptions) do
1418 v:Destroy()
1419 end
1420 activeOptions = {}
1421 barActive = false
1422 end)
1423 end
1424end
1425
1426-- Connects a function to an event such that it fires asynchronously
1427function Connect(event,func)
1428 return event:connect(function(...)
1429 local a = {...}
1430 spawn(function() func(unpack(a)) end)
1431 end)
1432end
1433
1434-- returns the ascendant ScreenGui of an object
1435function GetScreen(screen)
1436 if screen == nil then return nil end
1437 while not screen:IsA("ScreenGui") do
1438 screen = screen.Parent
1439 if screen == nil then return nil end
1440 end
1441 return screen
1442end
1443
1444do
1445 local ZIndexLock = {}
1446 -- Sets the ZIndex of an object and its descendants. Objects are locked so
1447 -- that SetZIndexOnChanged doesn't spawn multiple threads that set the
1448 -- ZIndex of the same object.
1449 function SetZIndex(object,z)
1450 if not ZIndexLock[object] then
1451 ZIndexLock[object] = true
1452 if object:IsA'GuiObject' then
1453 object.ZIndex = z
1454 end
1455 local children = object:GetChildren()
1456 for i = 1,#children do
1457 SetZIndex(children[i],z)
1458 end
1459 ZIndexLock[object] = nil
1460 end
1461 end
1462
1463 function SetZIndexOnChanged(object)
1464 return object.Changed:connect(function(p)
1465 if p == "ZIndex" then
1466 SetZIndex(object,object.ZIndex)
1467 end
1468 end)
1469 end
1470end
1471
1472---- IconMap ----
1473-- Image size: 256px x 256px
1474-- Icon size: 16px x 16px
1475-- Padding between each icon: 2px
1476-- Padding around image edge: 1px
1477-- Total icons: 14 x 14 (196)
1478local Icon do
1479 local iconMap = 'http://www.roblox.com/asset/?id=' .. MAP_ID
1480 game:GetService('ContentProvider'):Preload(iconMap)
1481 local iconDehash do
1482 -- 14 x 14, 0-based input, 0-based output
1483 local f=math.floor
1484 function iconDehash(h)
1485 return f(h/14%14),f(h%14)
1486 end
1487 end
1488
1489 function Icon(IconFrame,index)
1490 local row,col = iconDehash(index)
1491 local mapSize = Vector2.new(256,256)
1492 local pad,border = 2,1
1493 local iconSize = 16
1494
1495 local class = 'Frame'
1496 if type(IconFrame) == 'string' then
1497 class = IconFrame
1498 IconFrame = nil
1499 end
1500
1501 if not IconFrame then
1502 IconFrame = Create(class,{
1503 Name = "Icon";
1504 BackgroundTransparency = 1;
1505 ClipsDescendants = true;
1506 Create('ImageLabel',{
1507 Name = "IconMap";
1508 Active = false;
1509 BackgroundTransparency = 1;
1510 Image = iconMap;
1511 Size = UDim2.new(mapSize.x/iconSize,0,mapSize.y/iconSize,0);
1512 });
1513 })
1514 end
1515
1516 IconFrame.IconMap.Position = UDim2.new(-col - (pad*(col+1) + border)/iconSize,0,-row - (pad*(row+1) + border)/iconSize,0)
1517 return IconFrame
1518 end
1519end
1520
1521----------------------------------------------------------------
1522----------------------------------------------------------------
1523----------------------------------------------------------------
1524----------------------------------------------------------------
1525---- ScrollBar
1526do
1527 -- AutoButtonColor doesn't always reset properly
1528 local function ResetButtonColor(button)
1529 local active = button.Active
1530 button.Active = not active
1531 button.Active = active
1532 end
1533
1534 local function ArrowGraphic(size,dir,scaled,template)
1535 local Frame = Create('Frame',{
1536 Name = "Arrow Graphic";
1537 BorderSizePixel = 0;
1538 Size = UDim2.new(0,size,0,size);
1539 Transparency = 1;
1540 })
1541 if not template then
1542 template = Instance.new("Frame")
1543 template.BorderSizePixel = 0
1544 end
1545
1546 local transform
1547 if dir == nil or dir == 'Up' then
1548 function transform(p,s) return p,s end
1549 elseif dir == 'Down' then
1550 function transform(p,s) return UDim2.new(0,p.X.Offset,0,size-p.Y.Offset-1),s end
1551 elseif dir == 'Left' then
1552 function transform(p,s) return UDim2.new(0,p.Y.Offset,0,p.X.Offset),UDim2.new(0,s.Y.Offset,0,s.X.Offset) end
1553 elseif dir == 'Right' then
1554 function transform(p,s) return UDim2.new(0,size-p.Y.Offset-1,0,p.X.Offset),UDim2.new(0,s.Y.Offset,0,s.X.Offset) end
1555 end
1556
1557 local scale
1558 if scaled then
1559 function scale(p,s) return UDim2.new(p.X.Offset/size,0,p.Y.Offset/size,0),UDim2.new(s.X.Offset/size,0,s.Y.Offset/size,0) end
1560 else
1561 function scale(p,s) return p,s end
1562 end
1563
1564 local o = math.floor(size/4)
1565 if size%2 == 0 then
1566 local n = size/2-1
1567 for i = 0,n do
1568 local t = template:Clone()
1569 local p,s = scale(transform(
1570 UDim2.new(0,n-i,0,o+i),
1571 UDim2.new(0,(i+1)*2,0,1)
1572 ))
1573 t.Position = p
1574 t.Size = s
1575 t.Parent = Frame
1576 end
1577 else
1578 local n = (size-1)/2
1579 for i = 0,n do
1580 local t = template:Clone()
1581 local p,s = scale(transform(
1582 UDim2.new(0,n-i,0,o+i),
1583 UDim2.new(0,i*2+1,0,1)
1584 ))
1585 t.Position = p
1586 t.Size = s
1587 t.Parent = Frame
1588 end
1589 end
1590 if size%4 > 1 then
1591 local t = template:Clone()
1592 local p,s = scale(transform(
1593 UDim2.new(0,0,0,size-o-1),
1594 UDim2.new(0,size,0,1)
1595 ))
1596 t.Position = p
1597 t.Size = s
1598 t.Parent = Frame
1599 end
1600 return Frame
1601 end
1602
1603
1604 local function GripGraphic(size,dir,spacing,scaled,template)
1605 local Frame = Create('Frame',{
1606 Name = "Grip Graphic";
1607 BorderSizePixel = 0;
1608 Size = UDim2.new(0,size.x,0,size.y);
1609 Transparency = 1;
1610 })
1611 if not template then
1612 template = Instance.new("Frame")
1613 template.BorderSizePixel = 0
1614 end
1615
1616 spacing = spacing or 2
1617
1618 local scale
1619 if scaled then
1620 function scale(p) return UDim2.new(p.X.Offset/size.x,0,p.Y.Offset/size.y,0) end
1621 else
1622 function scale(p) return p end
1623 end
1624
1625 if dir == 'Vertical' then
1626 for i=0,size.x-1,spacing do
1627 local t = template:Clone()
1628 t.Size = scale(UDim2.new(0,1,0,size.y))
1629 t.Position = scale(UDim2.new(0,i,0,0))
1630 t.Parent = Frame
1631 end
1632 elseif dir == nil or dir == 'Horizontal' then
1633 for i=0,size.y-1,spacing do
1634 local t = template:Clone()
1635 t.Size = scale(UDim2.new(0,size.x,0,1))
1636 t.Position = scale(UDim2.new(0,0,0,i))
1637 t.Parent = Frame
1638 end
1639 end
1640
1641 return Frame
1642 end
1643
1644 local mt = {
1645 __index = {
1646 GetScrollPercent = function(self)
1647 return self.ScrollIndex/(self.TotalSpace-self.VisibleSpace)
1648 end;
1649 CanScrollDown = function(self)
1650 return self.ScrollIndex + self.VisibleSpace < self.TotalSpace
1651 end;
1652 CanScrollUp = function(self)
1653 return self.ScrollIndex > 0
1654 end;
1655 ScrollDown = function(self)
1656 self.ScrollIndex = self.ScrollIndex + self.PageIncrement
1657 self:Update()
1658 end;
1659 ScrollUp = function(self)
1660 self.ScrollIndex = self.ScrollIndex - self.PageIncrement
1661 self:Update()
1662 end;
1663 ScrollTo = function(self,index)
1664 self.ScrollIndex = index
1665 self:Update()
1666 end;
1667 SetScrollPercent = function(self,percent)
1668 self.ScrollIndex = math.floor((self.TotalSpace - self.VisibleSpace)*percent + 0.5)
1669 self:Update()
1670 end;
1671 };
1672 }
1673 mt.__index.CanScrollRight = mt.__index.CanScrollDown
1674 mt.__index.CanScrollLeft = mt.__index.CanScrollUp
1675 mt.__index.ScrollLeft = mt.__index.ScrollUp
1676 mt.__index.ScrollRight = mt.__index.ScrollDown
1677
1678 function ScrollBar(horizontal)
1679 -- create row scroll bar
1680 local ScrollFrame = Create('Frame',{
1681 Name = "ScrollFrame";
1682 Position = horizontal and UDim2.new(0,0,1,-GUI_SIZE) or UDim2.new(1,-GUI_SIZE,0,0);
1683 Size = horizontal and UDim2.new(1,0,0,GUI_SIZE) or UDim2.new(0,GUI_SIZE,1,0);
1684 BackgroundTransparency = 1;
1685 Create('ImageButton',{
1686 Name = "ScrollDown";
1687 Position = horizontal and UDim2.new(1,-GUI_SIZE,0,0) or UDim2.new(0,0,1,-GUI_SIZE);
1688 Size = UDim2.new(0, GUI_SIZE, 0, GUI_SIZE);
1689 BackgroundColor3 = GuiColor.Button;
1690 BorderColor3 = GuiColor.Border;
1691 --BorderSizePixel = 0;
1692 });
1693 Create('ImageButton',{
1694 Name = "ScrollUp";
1695 Size = UDim2.new(0, GUI_SIZE, 0, GUI_SIZE);
1696 BackgroundColor3 = GuiColor.Button;
1697 BorderColor3 = GuiColor.Border;
1698 --BorderSizePixel = 0;
1699 });
1700 Create('ImageButton',{
1701 Name = "ScrollBar";
1702 Size = horizontal and UDim2.new(1,-GUI_SIZE*2,1,0) or UDim2.new(1,0,1,-GUI_SIZE*2);
1703 Position = horizontal and UDim2.new(0,GUI_SIZE,0,0) or UDim2.new(0,0,0,GUI_SIZE);
1704 AutoButtonColor = false;
1705 BackgroundColor3 = Color3.new(0.94902, 0.94902, 0.94902);
1706 BorderColor3 = GuiColor.Border;
1707 --BorderSizePixel = 0;
1708 Create('ImageButton',{
1709 Name = "ScrollThumb";
1710 AutoButtonColor = false;
1711 Size = UDim2.new(0, GUI_SIZE, 0, GUI_SIZE);
1712 BackgroundColor3 = GuiColor.Button;
1713 BorderColor3 = GuiColor.Border;
1714 --BorderSizePixel = 0;
1715 });
1716 });
1717 })
1718
1719 local graphicTemplate = Create('Frame',{
1720 Name="Graphic";
1721 BorderSizePixel = 0;
1722 BackgroundColor3 = GuiColor.Border;
1723 })
1724 local graphicSize = GUI_SIZE/2
1725
1726 local ScrollDownFrame = ScrollFrame.ScrollDown
1727 local ScrollDownGraphic = ArrowGraphic(graphicSize,horizontal and 'Right' or 'Down',true,graphicTemplate)
1728 ScrollDownGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
1729 ScrollDownGraphic.Parent = ScrollDownFrame
1730 local ScrollUpFrame = ScrollFrame.ScrollUp
1731 local ScrollUpGraphic = ArrowGraphic(graphicSize,horizontal and 'Left' or 'Up',true,graphicTemplate)
1732 ScrollUpGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
1733 ScrollUpGraphic.Parent = ScrollUpFrame
1734 local ScrollBarFrame = ScrollFrame.ScrollBar
1735 local ScrollThumbFrame = ScrollBarFrame.ScrollThumb
1736 do
1737 local size = GUI_SIZE*3/8
1738 local Decal = GripGraphic(Vector2.new(size,size),horizontal and 'Vertical' or 'Horizontal',2,graphicTemplate)
1739 Decal.Position = UDim2.new(0.5,-size/2,0.5,-size/2)
1740 Decal.Parent = ScrollThumbFrame
1741 end
1742
1743 local Class = setmetatable({
1744 GUI = ScrollFrame;
1745 ScrollIndex = 0;
1746 VisibleSpace = 0;
1747 TotalSpace = 0;
1748 PageIncrement = 1;
1749 },mt)
1750
1751 local UpdateScrollThumb
1752 if horizontal then
1753 function UpdateScrollThumb()
1754 ScrollThumbFrame.Size = UDim2.new(Class.VisibleSpace/Class.TotalSpace,0,0,GUI_SIZE)
1755 if ScrollThumbFrame.AbsoluteSize.x < GUI_SIZE then
1756 ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE)
1757 end
1758 local barSize = ScrollBarFrame.AbsoluteSize.x
1759 ScrollThumbFrame.Position = UDim2.new(Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.x)/barSize,0,0,0)
1760 end
1761 else
1762 function UpdateScrollThumb()
1763 ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,Class.VisibleSpace/Class.TotalSpace,0)
1764 if ScrollThumbFrame.AbsoluteSize.y < GUI_SIZE then
1765 ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE)
1766 end
1767 local barSize = ScrollBarFrame.AbsoluteSize.y
1768 ScrollThumbFrame.Position = UDim2.new(0,0,Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.y)/barSize,0)
1769 end
1770 end
1771
1772 local lastDown
1773 local lastUp
1774 local scrollStyle = {BackgroundColor3=GuiColor.Border,BackgroundTransparency=0}
1775 local scrollStyle_ds = {BackgroundColor3=GuiColor.Border,BackgroundTransparency=0.7}
1776
1777 local function Update()
1778 local t = Class.TotalSpace
1779 local v = Class.VisibleSpace
1780 local s = Class.ScrollIndex
1781 if v <= t then
1782 if s > 0 then
1783 if s + v > t then
1784 Class.ScrollIndex = t - v
1785 end
1786 else
1787 Class.ScrollIndex = 0
1788 end
1789 else
1790 Class.ScrollIndex = 0
1791 end
1792
1793 if Class.UpdateCallback then
1794 if Class.UpdateCallback(Class) == false then
1795 return
1796 end
1797 end
1798
1799 local down = Class:CanScrollDown()
1800 local up = Class:CanScrollUp()
1801 if down ~= lastDown then
1802 lastDown = down
1803 ScrollDownFrame.Active = down
1804 ScrollDownFrame.AutoButtonColor = down
1805 local children = ScrollDownGraphic:GetChildren()
1806 local style = down and scrollStyle or scrollStyle_ds
1807 for i = 1,#children do
1808 Create(children[i],style)
1809 end
1810 end
1811 if up ~= lastUp then
1812 lastUp = up
1813 ScrollUpFrame.Active = up
1814 ScrollUpFrame.AutoButtonColor = up
1815 local children = ScrollUpGraphic:GetChildren()
1816 local style = up and scrollStyle or scrollStyle_ds
1817 for i = 1,#children do
1818 Create(children[i],style)
1819 end
1820 end
1821 ScrollThumbFrame.Visible = down or up
1822 UpdateScrollThumb()
1823 end
1824 Class.Update = Update
1825
1826 SetZIndexOnChanged(ScrollFrame)
1827
1828 local MouseDrag = Create('ImageButton',{
1829 Name = "MouseDrag";
1830 Position = UDim2.new(-0.25,0,-0.25,0);
1831 Size = UDim2.new(1.5,0,1.5,0);
1832 Transparency = 1;
1833 AutoButtonColor = false;
1834 Active = true;
1835 ZIndex = 10;
1836 })
1837
1838 local scrollEventID = 0
1839 ScrollDownFrame.MouseButton1Down:connect(function()
1840 scrollEventID = tick()
1841 local current = scrollEventID
1842 local up_con
1843 up_con = MouseDrag.MouseButton1Up:connect(function()
1844 scrollEventID = tick()
1845 MouseDrag.Parent = nil
1846 ResetButtonColor(ScrollDownFrame)
1847 up_con:disconnect(); drag = nil
1848 end)
1849 MouseDrag.Parent = GetScreen(ScrollFrame)
1850 Class:ScrollDown()
1851 wait(0.2) -- delay before auto scroll
1852 while scrollEventID == current do
1853 Class:ScrollDown()
1854 if not Class:CanScrollDown() then break end
1855 wait()
1856 end
1857 end)
1858
1859 ScrollDownFrame.MouseButton1Up:connect(function()
1860 scrollEventID = tick()
1861 end)
1862
1863 ScrollUpFrame.MouseButton1Down:connect(function()
1864 scrollEventID = tick()
1865 local current = scrollEventID
1866 local up_con
1867 up_con = MouseDrag.MouseButton1Up:connect(function()
1868 scrollEventID = tick()
1869 MouseDrag.Parent = nil
1870 ResetButtonColor(ScrollUpFrame)
1871 up_con:disconnect(); drag = nil
1872 end)
1873 MouseDrag.Parent = GetScreen(ScrollFrame)
1874 Class:ScrollUp()
1875 wait(0.2)
1876 while scrollEventID == current do
1877 Class:ScrollUp()
1878 if not Class:CanScrollUp() then break end
1879 wait()
1880 end
1881 end)
1882
1883 ScrollUpFrame.MouseButton1Up:connect(function()
1884 scrollEventID = tick()
1885 end)
1886
1887 if horizontal then
1888 ScrollBarFrame.MouseButton1Down:connect(function(x,y)
1889 scrollEventID = tick()
1890 local current = scrollEventID
1891 local up_con
1892 up_con = MouseDrag.MouseButton1Up:connect(function()
1893 scrollEventID = tick()
1894 MouseDrag.Parent = nil
1895 ResetButtonColor(ScrollUpFrame)
1896 up_con:disconnect(); drag = nil
1897 end)
1898 MouseDrag.Parent = GetScreen(ScrollFrame)
1899 if x > ScrollThumbFrame.AbsolutePosition.x then
1900 Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
1901 wait(0.2)
1902 while scrollEventID == current do
1903 if x < ScrollThumbFrame.AbsolutePosition.x + ScrollThumbFrame.AbsoluteSize.x then break end
1904 Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
1905 wait()
1906 end
1907 else
1908 Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
1909 wait(0.2)
1910 while scrollEventID == current do
1911 if x > ScrollThumbFrame.AbsolutePosition.x then break end
1912 Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
1913 wait()
1914 end
1915 end
1916 end)
1917 else
1918 ScrollBarFrame.MouseButton1Down:connect(function(x,y)
1919 scrollEventID = tick()
1920 local current = scrollEventID
1921 local up_con
1922 up_con = MouseDrag.MouseButton1Up:connect(function()
1923 scrollEventID = tick()
1924 MouseDrag.Parent = nil
1925 ResetButtonColor(ScrollUpFrame)
1926 up_con:disconnect(); drag = nil
1927 end)
1928 MouseDrag.Parent = GetScreen(ScrollFrame)
1929 if y > ScrollThumbFrame.AbsolutePosition.y then
1930 Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
1931 wait(0.2)
1932 while scrollEventID == current do
1933 if y < ScrollThumbFrame.AbsolutePosition.y + ScrollThumbFrame.AbsoluteSize.y then break end
1934 Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
1935 wait()
1936 end
1937 else
1938 Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
1939 wait(0.2)
1940 while scrollEventID == current do
1941 if y > ScrollThumbFrame.AbsolutePosition.y then break end
1942 Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
1943 wait()
1944 end
1945 end
1946 end)
1947 end
1948
1949 if horizontal then
1950 ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
1951 scrollEventID = tick()
1952 local mouse_offset = x - ScrollThumbFrame.AbsolutePosition.x
1953 local drag_con
1954 local up_con
1955 drag_con = MouseDrag.MouseMoved:connect(function(x,y)
1956 local bar_abs_pos = ScrollBarFrame.AbsolutePosition.x
1957 local bar_drag = ScrollBarFrame.AbsoluteSize.x - ScrollThumbFrame.AbsoluteSize.x
1958 local bar_abs_one = bar_abs_pos + bar_drag
1959 x = x - mouse_offset
1960 x = x < bar_abs_pos and bar_abs_pos or x > bar_abs_one and bar_abs_one or x
1961 x = x - bar_abs_pos
1962 Class:SetScrollPercent(x/(bar_drag))
1963 end)
1964 up_con = MouseDrag.MouseButton1Up:connect(function()
1965 scrollEventID = tick()
1966 MouseDrag.Parent = nil
1967 ResetButtonColor(ScrollThumbFrame)
1968 drag_con:disconnect(); drag_con = nil
1969 up_con:disconnect(); drag = nil
1970 end)
1971 MouseDrag.Parent = GetScreen(ScrollFrame)
1972 end)
1973 else
1974 ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
1975 scrollEventID = tick()
1976 local mouse_offset = y - ScrollThumbFrame.AbsolutePosition.y
1977 local drag_con
1978 local up_con
1979 drag_con = MouseDrag.MouseMoved:connect(function(x,y)
1980 local bar_abs_pos = ScrollBarFrame.AbsolutePosition.y
1981 local bar_drag = ScrollBarFrame.AbsoluteSize.y - ScrollThumbFrame.AbsoluteSize.y
1982 local bar_abs_one = bar_abs_pos + bar_drag
1983 y = y - mouse_offset
1984 y = y < bar_abs_pos and bar_abs_pos or y > bar_abs_one and bar_abs_one or y
1985 y = y - bar_abs_pos
1986 Class:SetScrollPercent(y/(bar_drag))
1987 end)
1988 up_con = MouseDrag.MouseButton1Up:connect(function()
1989 scrollEventID = tick()
1990 MouseDrag.Parent = nil
1991 ResetButtonColor(ScrollThumbFrame)
1992 drag_con:disconnect(); drag_con = nil
1993 up_con:disconnect(); drag = nil
1994 end)
1995 MouseDrag.Parent = GetScreen(ScrollFrame)
1996 end)
1997 end
1998
1999 function Class:Destroy()
2000 ScrollFrame:Destroy()
2001 MouseDrag:Destroy()
2002 for k in pairs(Class) do
2003 Class[k] = nil
2004 end
2005 setmetatable(Class,nil)
2006 end
2007
2008 Update()
2009
2010 return Class
2011 end
2012end
2013
2014----------------------------------------------------------------
2015----------------------------------------------------------------
2016----------------------------------------------------------------
2017----------------------------------------------------------------
2018---- Explorer panel
2019
2020local explorerPanel = D_E_X.ExplorerPanel
2021Create(explorerPanel,{
2022 BackgroundColor3 = GuiColor.Field;
2023 BorderColor3 = GuiColor.Border;
2024 Active = true;
2025})
2026
2027local SettingsRemote = explorerPanel.Parent:WaitForChild("SettingsPanel"):WaitForChild("GetSetting")
2028local GetApiRemote = explorerPanel.Parent:WaitForChild("PropertiesFrame"):WaitForChild("GetApi")
2029local GetAwaitRemote = explorerPanel.Parent:WaitForChild("PropertiesFrame"):WaitForChild("GetAwaiting")
2030local bindSetAwaiting = explorerPanel.Parent:WaitForChild("PropertiesFrame"):WaitForChild("SetAwaiting")
2031
2032local SaveInstanceWindow = explorerPanel.Parent:WaitForChild("SaveInstance")
2033local ConfirmationWindow = explorerPanel.Parent:WaitForChild("Confirmation")
2034local CautionWindow = explorerPanel.Parent:WaitForChild("Caution")
2035local TableCautionWindow = explorerPanel.Parent:WaitForChild("TableCaution")
2036
2037local RemoteWindow = explorerPanel.Parent:WaitForChild("CallRemote")
2038
2039local CurrentSaveInstanceWindow
2040local CurrentRemoteWindow
2041
2042local lastSelectedNode
2043
2044local listFrame = Create('Frame',{
2045 Name = "List";
2046 BackgroundTransparency = 1;
2047 ClipsDescendants = true;
2048 Position = UDim2.new(0,0,0,HEADER_SIZE);
2049 Size = UDim2.new(1,-GUI_SIZE,1,-HEADER_SIZE);
2050 Parent = explorerPanel;
2051})
2052
2053local scrollBar = ScrollBar(false)
2054scrollBar.PageIncrement = 1
2055Create(scrollBar.GUI,{
2056 Position = UDim2.new(1,-GUI_SIZE,0,HEADER_SIZE);
2057 Size = UDim2.new(0,GUI_SIZE,1,-HEADER_SIZE);
2058 Parent = explorerPanel;
2059})
2060
2061local scrollBarH = ScrollBar(true)
2062scrollBarH.PageIncrement = GUI_SIZE
2063Create(scrollBarH.GUI,{
2064 Position = UDim2.new(0,0,1,-GUI_SIZE);
2065 Size = UDim2.new(1,-GUI_SIZE,0,GUI_SIZE);
2066 Visible = false;
2067 Parent = explorerPanel;
2068})
2069
2070local headerFrame = Create('Frame',{
2071 Name = "Header";
2072 BackgroundColor3 = GuiColor.Background;
2073 BorderColor3 = GuiColor.Border;
2074 Position = UDim2.new(0,0,0,0);
2075 Size = UDim2.new(1,0,0,HEADER_SIZE);
2076 Parent = explorerPanel;
2077 Create('TextLabel',{
2078 Text = "Explorer";
2079 BackgroundTransparency = 1;
2080 TextColor3 = GuiColor.Text;
2081 TextXAlignment = 'Left';
2082 Font = FONT;
2083 FontSize = FONT_SIZE;
2084 Position = UDim2.new(0,4,0,0);
2085 Size = UDim2.new(1,-4,0.5,0);
2086 });
2087})
2088
2089local explorerFilter = Create('TextBox',{
2090 Text = "Filter Workspace";
2091 BackgroundTransparency = 0.8;
2092 TextColor3 = GuiColor.Text;
2093 TextXAlignment = 'Left';
2094 Font = FONT;
2095 FontSize = FONT_SIZE;
2096 Position = UDim2.new(0,4,0.5,0);
2097 Size = UDim2.new(1,-8,0.5,-2);
2098});
2099explorerFilter.Parent = headerFrame
2100
2101SetZIndexOnChanged(explorerPanel)
2102
2103local function CreateColor3(r, g, b) return Color3.new(r/255,g/255,b/255) end
2104
2105local Styles = {
2106 Font = Enum.Font.Arial;
2107 Margin = 5;
2108 Black = CreateColor3(0,0,0);
2109 White = CreateColor3(255,255,255);
2110}
2111
2112local DropDown = {
2113 Font = Styles.Font;
2114 FontSize = Enum.FontSize.Size14;
2115 TextColor = CreateColor3(0,0,0);
2116 TextColorOver = Styles.White;
2117 TextXAlignment = Enum.TextXAlignment.Left;
2118 Height = 20;
2119 BackColor = Styles.White;
2120 BackColorOver = CreateColor3(86,125,188);
2121 BorderColor = CreateColor3(216,216,216);
2122 BorderSizePixel = 2;
2123 ArrowColor = CreateColor3(160,160,160);
2124 ArrowColorOver = Styles.Black;
2125}
2126
2127local Row = {
2128 Font = Styles.Font;
2129 FontSize = Enum.FontSize.Size14;
2130 TextXAlignment = Enum.TextXAlignment.Left;
2131 TextColor = Styles.Black;
2132 TextColorOver = Styles.White;
2133 TextLockedColor = CreateColor3(120,120,120);
2134 Height = 24;
2135 BorderColor = CreateColor3(216,216,216);
2136 BackgroundColor = Styles.White;
2137 BackgroundColorAlternate = CreateColor3(246,246,246);
2138 BackgroundColorMouseover = CreateColor3(211,224,244);
2139 TitleMarginLeft = 15;
2140}
2141
2142local currentRightClickMenu
2143local CurrentInsertObjectWindow
2144local CurrentFunctionCallerWindow
2145
2146local RbxApi
2147
2148function ClassCanCreate(IName)
2149 local success,err = pcall(function() Instance.new(IName) end)
2150 if err then
2151 return false
2152 else
2153 return true
2154 end
2155end
2156
2157function GetClasses()
2158 if RbxApi == nil then return {} end
2159 local classTable = {}
2160 for i,v in pairs(RbxApi.Classes) do
2161 if ClassCanCreate(v.Name) then
2162 table.insert(classTable,v.Name)
2163 end
2164 end
2165 return classTable
2166end
2167
2168local function sortAlphabetic(t, property)
2169 table.sort(t,
2170 function(x,y) return x[property] < y[property]
2171 end)
2172end
2173
2174local function FunctionIsHidden(functionData)
2175 local tags = functionData["tags"]
2176 for _,name in pairs(tags) do
2177 if name == "deprecated"
2178 or name == "hidden"
2179 or name == "writeonly" then
2180 return true
2181 end
2182 end
2183 return false
2184end
2185
2186local function GetAllFunctions(className)
2187 local class = RbxApi.Classes[className]
2188 local functions = {}
2189
2190 if not class then return functions end
2191
2192 while class do
2193 if class.Name == "Instance" then break end
2194 for _,nextFunction in pairs(class.Functions) do
2195 if not FunctionIsHidden(nextFunction) then
2196 table.insert(functions, nextFunction)
2197 end
2198 end
2199 class = RbxApi.Classes[class.Superclass]
2200 end
2201
2202 sortAlphabetic(functions, "Name")
2203
2204 return functions
2205end
2206
2207function GetFunctions()
2208 if RbxApi == nil then return {} end
2209 local List = SelectionVar():Get()
2210
2211 if #List == 0 then return end
2212
2213 local MyObject = List[1]
2214
2215 local functionTable = {}
2216 for i,v in pairs(GetAllFunctions(MyObject.ClassName)) do
2217 table.insert(functionTable,v)
2218 end
2219 return functionTable
2220end
2221
2222function CreateInsertObjectMenu(choices, currentChoice, readOnly, onClick)
2223 local mouse = game.Players.LocalPlayer:GetMouse()
2224 local totalSize = explorerPanel.Parent.AbsoluteSize.y
2225 if #choices == 0 then return end
2226
2227 table.sort(choices, function(a,b) return a < b end)
2228
2229 local frame = Instance.new("Frame")
2230 frame.Name = "InsertObject"
2231 frame.Size = UDim2.new(0, 200, 1, 0)
2232 frame.BackgroundTransparency = 1
2233 frame.Active = true
2234
2235 local menu = nil
2236 local arrow = nil
2237 local expanded = false
2238 local margin = DropDown.BorderSizePixel;
2239
2240 --[[
2241 local button = Instance.new("TextButton")
2242 button.Font = Row.Font
2243 button.FontSize = Row.FontSize
2244 button.TextXAlignment = Row.TextXAlignment
2245 button.BackgroundTransparency = 1
2246 button.TextColor3 = Row.TextColor
2247 if readOnly then
2248 button.TextColor3 = Row.TextLockedColor
2249 end
2250 button.Text = currentChoice
2251 button.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0)
2252 button.Position = UDim2.new(0, Styles.Margin, 0, 0)
2253 button.Parent = frame
2254 --]]
2255
2256 local function hideMenu()
2257 expanded = false
2258 --showArrow(DropDown.ArrowColor)
2259 if frame then
2260 --frame:Destroy()
2261 CurrentInsertObjectWindow.Visible = false
2262 end
2263 end
2264
2265 local function showMenu()
2266 expanded = true
2267 menu = Instance.new("ScrollingFrame")
2268 menu.Size = UDim2.new(0,200,1,0)
2269 menu.CanvasSize = UDim2.new(0, 200, 0, #choices * DropDown.Height)
2270 menu.Position = UDim2.new(0, margin, 0, 0)
2271 menu.BackgroundTransparency = 0
2272 menu.BackgroundColor3 = DropDown.BackColor
2273 menu.BorderColor3 = DropDown.BorderColor
2274 menu.BorderSizePixel = DropDown.BorderSizePixel
2275 menu.TopImage = "rbxasset://textures/blackBkg_square.png"
2276 menu.MidImage = "rbxasset://textures/blackBkg_square.png"
2277 menu.BottomImage = "rbxasset://textures/blackBkg_square.png"
2278 menu.Active = true
2279 menu.ZIndex = 5
2280 menu.Parent = frame
2281
2282 --local parentFrameHeight = script.Parent.List.Size.Y.Offset
2283 --local rowHeight = mouse.Y
2284 --if (rowHeight + menu.Size.Y.Offset) > parentFrameHeight then
2285 -- menu.Position = UDim2.new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin)
2286 --end
2287
2288 local function choice(name)
2289 onClick(name)
2290 hideMenu()
2291 end
2292
2293 for i,name in pairs(choices) do
2294 local option = CreateRightClickMenuItem(name, function()
2295 choice(name)
2296 end,1)
2297 option.Size = UDim2.new(1, 0, 0, 20)
2298 option.Position = UDim2.new(0, 0, 0, (i - 1) * DropDown.Height)
2299 option.ZIndex = menu.ZIndex
2300 option.Parent = menu
2301 end
2302 end
2303
2304
2305 showMenu()
2306
2307
2308 return frame
2309end
2310
2311function CreateFunctionCallerMenu(choices, currentChoice, readOnly, onClick)
2312 local mouse = game.Players.LocalPlayer:GetMouse()
2313 local totalSize = explorerPanel.Parent.AbsoluteSize.y
2314 if #choices == 0 then return end
2315
2316 table.sort(choices, function(a,b) return a.Name < b.Name end)
2317
2318 local frame = Instance.new("Frame")
2319 frame.Name = "InsertObject"
2320 frame.Size = UDim2.new(0, 200, 1, 0)
2321 frame.BackgroundTransparency = 1
2322 frame.Active = true
2323
2324 local menu = nil
2325 local arrow = nil
2326 local expanded = false
2327 local margin = DropDown.BorderSizePixel;
2328
2329 local function hideMenu()
2330 expanded = false
2331 --showArrow(DropDown.ArrowColor)
2332 if frame then
2333 --frame:Destroy()
2334 CurrentInsertObjectWindow.Visible = false
2335 end
2336 end
2337
2338 local function showMenu()
2339 expanded = true
2340 menu = Instance.new("ScrollingFrame")
2341 menu.Size = UDim2.new(0,300,1,0)
2342 menu.CanvasSize = UDim2.new(0, 300, 0, #choices * DropDown.Height)
2343 menu.Position = UDim2.new(0, margin, 0, 0)
2344 menu.BackgroundTransparency = 0
2345 menu.BackgroundColor3 = DropDown.BackColor
2346 menu.BorderColor3 = DropDown.BorderColor
2347 menu.BorderSizePixel = DropDown.BorderSizePixel
2348 menu.TopImage = "rbxasset://textures/blackBkg_square.png"
2349 menu.MidImage = "rbxasset://textures/blackBkg_square.png"
2350 menu.BottomImage = "rbxasset://textures/blackBkg_square.png"
2351 menu.Active = true
2352 menu.ZIndex = 5
2353 menu.Parent = frame
2354
2355 --local parentFrameHeight = script.Parent.List.Size.Y.Offset
2356 --local rowHeight = mouse.Y
2357 --if (rowHeight + menu.Size.Y.Offset) > parentFrameHeight then
2358 -- menu.Position = UDim2.new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin)
2359 --end
2360
2361 local function GetParameters(functionData)
2362 local paraString = ""
2363 paraString = paraString.."("
2364 for i,v in pairs(functionData.Arguments) do
2365 paraString = paraString..v.Type.." "..v.Name
2366 if i < #functionData.Arguments then
2367 paraString = paraString..", "
2368 end
2369 end
2370 paraString = paraString..")"
2371 return paraString
2372 end
2373
2374 local function choice(name)
2375 onClick(name)
2376 hideMenu()
2377 end
2378
2379 for i,name in pairs(choices) do
2380 local option = CreateRightClickMenuItem(name.ReturnType.." "..name.Name..GetParameters(name), function()
2381 choice(name)
2382 end,2)
2383 option.Size = UDim2.new(1, 0, 0, 20)
2384 option.Position = UDim2.new(0, 0, 0, (i - 1) * DropDown.Height)
2385 option.ZIndex = menu.ZIndex
2386 option.Parent = menu
2387 end
2388 end
2389
2390
2391 showMenu()
2392
2393
2394 return frame
2395end
2396
2397function CreateInsertObject()
2398 if not CurrentInsertObjectWindow then return end
2399 CurrentInsertObjectWindow.Visible = true
2400 if currentRightClickMenu and CurrentInsertObjectWindow.Visible then
2401 CurrentInsertObjectWindow.Position = UDim2.new(0,currentRightClickMenu.Position.X.Offset-currentRightClickMenu.Size.X.Offset-2,0,0)
2402 end
2403 if CurrentInsertObjectWindow.Visible then
2404 CurrentInsertObjectWindow.Parent = explorerPanel.Parent
2405 end
2406end
2407
2408function CreateFunctionCaller()
2409 if CurrentFunctionCallerWindow then
2410 CurrentFunctionCallerWindow:Destroy()
2411 CurrentFunctionCallerWindow = nil
2412 end
2413 CurrentFunctionCallerWindow = CreateFunctionCallerMenu(
2414 GetFunctions(),
2415 "",
2416 false,
2417 function(option)
2418 CurrentFunctionCallerWindow:Destroy()
2419 CurrentFunctionCallerWindow = nil
2420 local list = SelectionVar():Get()
2421 for i = 1,#list do
2422 pcall(function() Instance.new(option,list[i]) end)
2423 end
2424 print(option.Name .. " selected to be called. Function caller being added soon, please wait!")
2425 --CallFunction()
2426 DestroyRightClick()
2427 end
2428 )
2429 if currentRightClickMenu and CurrentFunctionCallerWindow then
2430 CurrentFunctionCallerWindow.Position = UDim2.new(0,currentRightClickMenu.Position.X.Offset-currentRightClickMenu.Size.X.Offset*1.5-2,0,0)
2431 end
2432 if CurrentFunctionCallerWindow then
2433 CurrentFunctionCallerWindow.Parent = explorerPanel.Parent
2434 end
2435end
2436
2437function CreateRightClickMenuItem(text, onClick, insObj)
2438 local button = Instance.new("TextButton")
2439 button.Font = DropDown.Font
2440 button.FontSize = DropDown.FontSize
2441 button.TextColor3 = DropDown.TextColor
2442 button.TextXAlignment = DropDown.TextXAlignment
2443 button.BackgroundColor3 = DropDown.BackColor
2444 button.AutoButtonColor = false
2445 button.BorderSizePixel = 0
2446 button.Active = true
2447 button.Text = text
2448
2449 if insObj == 1 then
2450 local newIcon = Icon(nil,ExplorerIndex[text] or 0)
2451 newIcon.Position = UDim2.new(0,0,0,2)
2452 newIcon.Size = UDim2.new(0,16,0,16)
2453 newIcon.IconMap.ZIndex = 5
2454 newIcon.Parent = button
2455 button.Text = "\t\t"..button.Text
2456 elseif insObj == 2 then
2457 button.FontSize = Enum.FontSize.Size11
2458 end
2459
2460 button.MouseEnter:connect(function()
2461 button.TextColor3 = DropDown.TextColorOver
2462 button.BackgroundColor3 = DropDown.BackColorOver
2463 if not insObj and CurrentInsertObjectWindow then
2464 if CurrentInsertObjectWindow.Visible == false and button.Text == "Insert Object" then
2465 CreateInsertObject()
2466 elseif CurrentInsertObjectWindow.Visible and button.Text ~= "Insert Object" then
2467 CurrentInsertObjectWindow.Visible = false
2468 end
2469 end
2470 if not insObj then
2471 if CurrentFunctionCallerWindow and button.Text ~= "Call Function" then
2472 CurrentFunctionCallerWindow:Destroy()
2473 CurrentFunctionCallerWindow = nil
2474 elseif button.Text == "Call Function" then
2475 CreateFunctionCaller()
2476 end
2477 end
2478 end)
2479 button.MouseLeave:connect(function()
2480 button.TextColor3 = DropDown.TextColor
2481 button.BackgroundColor3 = DropDown.BackColor
2482 end)
2483 button.MouseButton1Click:connect(function()
2484 button.TextColor3 = DropDown.TextColor
2485 button.BackgroundColor3 = DropDown.BackColor
2486 onClick(text)
2487 end)
2488 return button
2489end
2490
2491function CreateRightClickMenu(choices, currentChoice, readOnly, onClick)
2492 local mouse = game.Players.LocalPlayer:GetMouse()
2493
2494 local frame = Instance.new("Frame")
2495 frame.Name = "DropDown"
2496 frame.Size = UDim2.new(0, 200, 1, 0)
2497 frame.BackgroundTransparency = 1
2498 frame.Active = true
2499
2500 local menu = nil
2501 local arrow = nil
2502 local expanded = false
2503 local margin = DropDown.BorderSizePixel;
2504
2505 --[[
2506 local button = Instance.new("TextButton")
2507 button.Font = Row.Font
2508 button.FontSize = Row.FontSize
2509 button.TextXAlignment = Row.TextXAlignment
2510 button.BackgroundTransparency = 1
2511 button.TextColor3 = Row.TextColor
2512 if readOnly then
2513 button.TextColor3 = Row.TextLockedColor
2514 end
2515 button.Text = currentChoice
2516 button.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0)
2517 button.Position = UDim2.new(0, Styles.Margin, 0, 0)
2518 button.Parent = frame
2519 --]]
2520
2521 local function hideMenu()
2522 expanded = false
2523 --showArrow(DropDown.ArrowColor)
2524 if frame then
2525 frame:Destroy()
2526 DestroyRightClick()
2527 end
2528 end
2529
2530 local function showMenu()
2531 expanded = true
2532 menu = Instance.new("Frame")
2533 menu.Size = UDim2.new(0, 200, 0, #choices * DropDown.Height)
2534 menu.Position = UDim2.new(0, margin, 0, 5)
2535 menu.BackgroundTransparency = 0
2536 menu.BackgroundColor3 = DropDown.BackColor
2537 menu.BorderColor3 = DropDown.BorderColor
2538 menu.BorderSizePixel = DropDown.BorderSizePixel
2539 menu.Active = true
2540 menu.ZIndex = 5
2541 menu.Parent = frame
2542
2543 --local parentFrameHeight = script.Parent.List.Size.Y.Offset
2544 --local rowHeight = mouse.Y
2545 --if (rowHeight + menu.Size.Y.Offset) > parentFrameHeight then
2546 -- menu.Position = UDim2.new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin)
2547 --end
2548
2549 local function choice(name)
2550 onClick(name)
2551 hideMenu()
2552 end
2553
2554 for i,name in pairs(choices) do
2555 local option = CreateRightClickMenuItem(name, function()
2556 choice(name)
2557 end)
2558 option.Size = UDim2.new(1, 0, 0, 20)
2559 option.Position = UDim2.new(0, 0, 0, (i - 1) * DropDown.Height)
2560 option.ZIndex = menu.ZIndex
2561 option.Parent = menu
2562 end
2563 end
2564
2565
2566 showMenu()
2567
2568
2569 return frame
2570end
2571
2572function checkMouseInGui(gui)
2573 if gui == nil then return false end
2574 local plrMouse = game.Players.LocalPlayer:GetMouse()
2575 local guiPosition = gui.AbsolutePosition
2576 local guiSize = gui.AbsoluteSize
2577
2578 if plrMouse.X >= guiPosition.x and plrMouse.X <= guiPosition.x + guiSize.x and plrMouse.Y >= guiPosition.y and plrMouse.Y <= guiPosition.y + guiSize.y then
2579 return true
2580 else
2581 return false
2582 end
2583end
2584
2585local clipboard = {}
2586local function delete(o)
2587 o.Parent = nil
2588end
2589
2590local getTextWidth do
2591 local text = Create('TextLabel',{
2592 Name = "TextWidth";
2593 TextXAlignment = 'Left';
2594 TextYAlignment = 'Center';
2595 Font = FONT;
2596 FontSize = FONT_SIZE;
2597 Text = "";
2598 Position = UDim2.new(0,0,0,0);
2599 Size = UDim2.new(1,0,1,0);
2600 Visible = false;
2601 Parent = explorerPanel;
2602 })
2603 function getTextWidth(s)
2604 text.Text = s
2605 return text.TextBounds.x
2606 end
2607end
2608
2609local nameScanned = false
2610-- Holds the game tree converted to a list.
2611local TreeList = {}
2612-- Matches objects to their tree node representation.
2613local NodeLookup = {}
2614
2615local nodeWidth = 0
2616
2617function filteringWorkspace()
2618 if explorerFilter.Text ~= "" and explorerFilter.Text ~= "Filter Workspace" then
2619 return true
2620 end
2621 return false
2622end
2623
2624function lookForAName(obj,name)
2625 for i,v in pairs(obj:GetChildren()) do
2626 if string.find(string.lower(v.Name),string.lower(name)) then nameScanned = true end
2627 lookForAName(v,name)
2628 end
2629end
2630
2631function scanName(obj)
2632 nameScanned = false
2633 if string.find(string.lower(obj.Name),string.lower(explorerFilter.Text)) then
2634 nameScanned = true
2635 else
2636 lookForAName(obj,explorerFilter.Text)
2637 end
2638 return nameScanned
2639end
2640
2641local updateList,rawUpdateList,updateScroll,rawUpdateSize do
2642 local function r(t)
2643 for i = 1,#t do
2644 if not filteringWorkspace() or scanName(t[i].Object) then
2645 TreeList[#TreeList+1] = t[i]
2646
2647 local w = (t[i].Depth)*(2+ENTRY_PADDING+GUI_SIZE) + 2 + ENTRY_SIZE + 4 + getTextWidth(t[i].Object.Name) + 4
2648 if w > nodeWidth then
2649 nodeWidth = w
2650 end
2651 if t[i].Expanded or filteringWorkspace() then
2652 r(t[i])
2653 end
2654 end
2655 end
2656 end
2657
2658 function rawUpdateSize()
2659 scrollBarH.TotalSpace = nodeWidth
2660 scrollBarH.VisibleSpace = listFrame.AbsoluteSize.x
2661 scrollBarH:Update()
2662 local visible = scrollBarH:CanScrollDown() or scrollBarH:CanScrollUp()
2663 scrollBarH.GUI.Visible = visible
2664
2665 listFrame.Size = UDim2.new(1,-GUI_SIZE,1,-GUI_SIZE*(visible and 1 or 0) - HEADER_SIZE)
2666
2667 scrollBar.VisibleSpace = math.ceil(listFrame.AbsoluteSize.y/ENTRY_BOUND)
2668 scrollBar.GUI.Size = UDim2.new(0,GUI_SIZE,1,-GUI_SIZE*(visible and 1 or 0) - HEADER_SIZE)
2669
2670 scrollBar.TotalSpace = #TreeList+1
2671 scrollBar:Update()
2672 end
2673
2674 function rawUpdateList()
2675 -- Clear then repopulate the entire list. It appears to be fast enough.
2676 TreeList = {}
2677 nodeWidth = 0
2678 r(NodeLookup[workspace.Parent])
2679 rawUpdateSize()
2680 end
2681
2682 -- Adding or removing large models will cause many updates to occur. We
2683 -- can reduce the number of updates by creating a delay, then dropping any
2684 -- updates that occur during the delay.
2685 local updatingList = false
2686 function updateList()
2687 if updatingList then return end
2688 updatingList = true
2689 wait(0.25)
2690 updatingList = false
2691 rawUpdateList()
2692 end
2693
2694 local updatingScroll = false
2695 function updateScroll()
2696 if updatingScroll then return end
2697 updatingScroll = true
2698 wait(0.25)
2699 updatingScroll = false
2700 scrollBar:Update()
2701 end
2702end
2703
2704local Selection do
2705 local bindGetSelection = explorerPanel:FindFirstChild("GetSelection")
2706 if not bindGetSelection then
2707 bindGetSelection = Create('BindableFunction',{Name = "GetSelection"})
2708 bindGetSelection.Parent = explorerPanel
2709 end
2710
2711 local bindSetSelection = explorerPanel:FindFirstChild("SetSelection")
2712 if not bindSetSelection then
2713 bindSetSelection = Create('BindableFunction',{Name = "SetSelection"})
2714 bindSetSelection.Parent = explorerPanel
2715 end
2716
2717 local bindSelectionChanged = explorerPanel:FindFirstChild("SelectionChanged")
2718 if not bindSelectionChanged then
2719 bindSelectionChanged = Create('BindableEvent',{Name = "SelectionChanged"})
2720 bindSelectionChanged.Parent = explorerPanel
2721 end
2722
2723 local SelectionList = {}
2724 local SelectionSet = {}
2725 local Updates = true
2726 Selection = {
2727 Selected = SelectionSet;
2728 List = SelectionList;
2729 }
2730
2731 local function addObject(object)
2732 -- list update
2733 local lupdate = false
2734 -- scroll update
2735 local supdate = false
2736
2737 if not SelectionSet[object] then
2738 local node = NodeLookup[object]
2739 if node then
2740 table.insert(SelectionList,object)
2741 SelectionSet[object] = true
2742 node.Selected = true
2743
2744 -- expand all ancestors so that selected node becomes visible
2745 node = node.Parent
2746 while node do
2747 if not node.Expanded then
2748 node.Expanded = true
2749 lupdate = true
2750 end
2751 node = node.Parent
2752 end
2753 supdate = true
2754 end
2755 end
2756 return lupdate,supdate
2757 end
2758
2759 function Selection:Set(objects)
2760 local lupdate = false
2761 local supdate = false
2762
2763 if #SelectionList > 0 then
2764 for i = 1,#SelectionList do
2765 local object = SelectionList[i]
2766 local node = NodeLookup[object]
2767 if node then
2768 node.Selected = false
2769 SelectionSet[object] = nil
2770 end
2771 end
2772
2773 SelectionList = {}
2774 Selection.List = SelectionList
2775 supdate = true
2776 end
2777
2778 for i = 1,#objects do
2779 local l,s = addObject(objects[i])
2780 lupdate = l or lupdate
2781 supdate = s or supdate
2782 end
2783
2784 if lupdate then
2785 rawUpdateList()
2786 supdate = true
2787 elseif supdate then
2788 scrollBar:Update()
2789 end
2790
2791 if supdate then
2792 bindSelectionChanged:Fire()
2793 end
2794 end
2795
2796 function Selection:Add(object)
2797 local l,s = addObject(object)
2798 if l then
2799 rawUpdateList()
2800 if Updates then
2801 bindSelectionChanged:Fire()
2802 end
2803 elseif s then
2804 scrollBar:Update()
2805 if Updates then
2806 bindSelectionChanged:Fire()
2807 end
2808 end
2809 end
2810
2811 function Selection:StopUpdates()
2812 Updates = false
2813 end
2814
2815 function Selection:ResumeUpdates()
2816 Updates = true
2817 bindSelectionChanged:Fire()
2818 end
2819
2820 function Selection:Remove(object,noupdate)
2821 if SelectionSet[object] then
2822 local node = NodeLookup[object]
2823 if node then
2824 node.Selected = false
2825 SelectionSet[object] = nil
2826 for i = 1,#SelectionList do
2827 if SelectionList[i] == object then
2828 table.remove(SelectionList,i)
2829 break
2830 end
2831 end
2832
2833 if not noupdate then
2834 scrollBar:Update()
2835 end
2836 bindSelectionChanged:Fire()
2837 end
2838 end
2839 end
2840
2841 function Selection:Get()
2842 local list = {}
2843 for i = 1,#SelectionList do
2844 list[i] = SelectionList[i]
2845 end
2846 return list
2847 end
2848
2849 bindSetSelection.OnInvoke = function(...)
2850 Selection:Set(...)
2851 end
2852
2853 bindGetSelection.OnInvoke = function()
2854 return Selection:Get()
2855 end
2856end
2857
2858function CreateCaution(title,msg)
2859 local newCaution = CautionWindow:Clone()
2860 newCaution.Title.Text = title
2861 newCaution.MainWindow.Desc.Text = msg
2862 newCaution.Parent = explorerPanel.Parent
2863 newCaution.Visible = true
2864 newCaution.MainWindow.Ok.MouseButton1Up:connect(function()
2865 newCaution:Destroy()
2866 end)
2867end
2868
2869function CreateTableCaution(title,msg)
2870 if type(msg) ~= "table" then return CreateCaution(title,tostring(msg)) end
2871 local newCaution = TableCautionWindow:Clone()
2872 newCaution.Title.Text = title
2873
2874 local TableList = newCaution.MainWindow.TableResults
2875 local TableTemplate = newCaution.MainWindow.TableTemplate
2876
2877 for i,v in pairs(msg) do
2878 local newResult = TableTemplate:Clone()
2879 newResult.Type.Text = type(v)
2880 newResult.Value.Text = tostring(v)
2881 newResult.Position = UDim2.new(0,0,0,#TableList:GetChildren() * 20)
2882 newResult.Parent = TableList
2883 TableList.CanvasSize = UDim2.new(0,0,0,#TableList:GetChildren() * 20)
2884 newResult.Visible = true
2885 end
2886 newCaution.Parent = explorerPanel.Parent
2887 newCaution.Visible = true
2888 newCaution.MainWindow.Ok.MouseButton1Up:connect(function()
2889 newCaution:Destroy()
2890 end)
2891end
2892
2893local function Split(str, delimiter)
2894 local start = 1
2895 local t = {}
2896 while true do
2897 local pos = string.find (str, delimiter, start, true)
2898 if not pos then
2899 break
2900 end
2901 table.insert (t, string.sub (str, start, pos - 1))
2902 start = pos + string.len (delimiter)
2903 end
2904 table.insert (t, string.sub (str, start))
2905 return t
2906end
2907
2908local function ToValue(value,type)
2909 if type == "Vector2" then
2910 local list = Split(value,",")
2911 if #list < 2 then return nil end
2912 local x = tonumber(list[1]) or 0
2913 local y = tonumber(list[2]) or 0
2914 return Vector2.new(x,y)
2915 elseif type == "Vector3" then
2916 local list = Split(value,",")
2917 if #list < 3 then return nil end
2918 local x = tonumber(list[1]) or 0
2919 local y = tonumber(list[2]) or 0
2920 local z = tonumber(list[3]) or 0
2921 return Vector3.new(x,y,z)
2922 elseif type == "Color3" then
2923 local list = Split(value,",")
2924 if #list < 3 then return nil end
2925 local r = tonumber(list[1]) or 0
2926 local g = tonumber(list[2]) or 0
2927 local b = tonumber(list[3]) or 0
2928 return Color3.new(r/255,g/255, b/255)
2929 elseif type == "UDim2" then
2930 local list = Split(string.gsub(string.gsub(value, "{", ""),"}",""),",")
2931 if #list < 4 then return nil end
2932 local xScale = tonumber(list[1]) or 0
2933 local xOffset = tonumber(list[2]) or 0
2934 local yScale = tonumber(list[3]) or 0
2935 local yOffset = tonumber(list[4]) or 0
2936 return UDim2.new(xScale, xOffset, yScale, yOffset)
2937 elseif type == "Number" then
2938 return tonumber(value)
2939 elseif type == "String" then
2940 return value
2941 elseif type == "NumberRange" then
2942 local list = Split(value,",")
2943 if #list == 1 then
2944 if tonumber(list[1]) == nil then return nil end
2945 local newVal = tonumber(list[1]) or 0
2946 return NumberRange.new(newVal)
2947 end
2948 if #list < 2 then return nil end
2949 local x = tonumber(list[1]) or 0
2950 local y = tonumber(list[2]) or 0
2951 return NumberRange.new(x,y)
2952 elseif type == "Script" then
2953 local success,err = ypcall(function()
2954 _G.D_E_X_DONOTUSETHISPLEASE = nil
2955 loadstring(
2956 "_G.D_E_X_DONOTUSETHISPLEASE = "..value
2957 )()
2958 return _G.D_E_X_DONOTUSETHISPLEASE
2959 end)
2960 if err then
2961 return nil
2962 end
2963 else
2964 return nil
2965 end
2966end
2967
2968function PromptRemoteCaller(inst)
2969 if CurrentRemoteWindow then
2970 CurrentRemoteWindow:Destroy()
2971 CurrentRemoteWindow = nil
2972 end
2973 CurrentRemoteWindow = RemoteWindow:Clone()
2974 CurrentRemoteWindow.Parent = explorerPanel.Parent
2975 CurrentRemoteWindow.Visible = true
2976
2977 local displayValues = false
2978
2979 local ArgumentList = CurrentRemoteWindow.MainWindow.Arguments
2980 local ArgumentTemplate = CurrentRemoteWindow.MainWindow.ArgumentTemplate
2981
2982 if inst:IsA("RemoteEvent") then
2983 CurrentRemoteWindow.Title.Text = "Fire Event"
2984 CurrentRemoteWindow.MainWindow.Ok.Text = "Fire"
2985 CurrentRemoteWindow.MainWindow.DisplayReturned.Visible = false
2986 CurrentRemoteWindow.MainWindow.Desc2.Visible = false
2987 end
2988
2989 local newArgument = ArgumentTemplate:Clone()
2990 newArgument.Parent = ArgumentList
2991 newArgument.Visible = true
2992 newArgument.Type.MouseButton1Down:connect(function()
2993 createDDown(newArgument.Type,function(choice)
2994 newArgument.Type.Text = choice
2995 end,"Script","Number","String","Color3","Vector3","Vector2","UDim2","NumberRange")
2996 end)
2997
2998 CurrentRemoteWindow.MainWindow.Ok.MouseButton1Up:connect(function()
2999 if CurrentRemoteWindow and inst.Parent ~= nil then
3000 local MyArguments = {}
3001 for i,v in pairs(ArgumentList:GetChildren()) do
3002 table.insert(MyArguments,ToValue(v.Value.Text,v.Type.Text))
3003 end
3004 if inst:IsA("RemoteFunction") then
3005 if displayValues then
3006 spawn(function()
3007 local myResults = inst:InvokeServer(unpack(MyArguments))
3008 if myResults then
3009 CreateTableCaution("Remote Caller",myResults)
3010 else
3011 CreateCaution("Remote Caller","This remote did not return anything.")
3012 end
3013 end)
3014 else
3015 spawn(function()
3016 inst:InvokeServer(unpack(MyArguments))
3017 end)
3018 end
3019 else
3020 inst:FireServer(unpack(MyArguments))
3021 end
3022 CurrentRemoteWindow:Destroy()
3023 CurrentRemoteWindow = nil
3024 end
3025 end)
3026
3027 CurrentRemoteWindow.MainWindow.Add.MouseButton1Up:connect(function()
3028 if CurrentRemoteWindow then
3029 local newArgument = ArgumentTemplate:Clone()
3030 newArgument.Position = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
3031 newArgument.Parent = ArgumentList
3032 ArgumentList.CanvasSize = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
3033 newArgument.Visible = true
3034 newArgument.Type.MouseButton1Down:connect(function()
3035 createDDown(newArgument.Type,function(choice)
3036 newArgument.Type.Text = choice
3037 end,"Script","Number","String","Color3","Vector3","Vector2","UDim2","NumberRange")
3038 end)
3039 end
3040 end)
3041
3042 CurrentRemoteWindow.MainWindow.Subtract.MouseButton1Up:connect(function()
3043 if CurrentRemoteWindow then
3044 if #ArgumentList:GetChildren() > 1 then
3045 ArgumentList:GetChildren()[#ArgumentList:GetChildren()]:Destroy()
3046 ArgumentList.CanvasSize = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
3047 end
3048 end
3049 end)
3050
3051 CurrentRemoteWindow.MainWindow.Cancel.MouseButton1Up:connect(function()
3052 if CurrentRemoteWindow then
3053 CurrentRemoteWindow:Destroy()
3054 CurrentRemoteWindow = nil
3055 end
3056 end)
3057
3058 CurrentRemoteWindow.MainWindow.DisplayReturned.MouseButton1Up:connect(function()
3059 if displayValues then
3060 displayValues = false
3061 CurrentRemoteWindow.MainWindow.DisplayReturned.enabled.Visible = false
3062 else
3063 displayValues = true
3064 CurrentRemoteWindow.MainWindow.DisplayReturned.enabled.Visible = true
3065 end
3066 end)
3067end
3068
3069function PromptSaveInstance(inst)
3070 if not SaveInstance and not _G.SaveInstance then CreateCaution("SaveInstance Missing","You do not have the SaveInstance function installed. Please go to RaspberryPi's thread to retrieve it.") return end
3071 if CurrentSaveInstanceWindow then
3072 CurrentSaveInstanceWindow:Destroy()
3073 CurrentSaveInstanceWindow = nil
3074 if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
3075 explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
3076 end
3077 end
3078 CurrentSaveInstanceWindow = SaveInstanceWindow:Clone()
3079 CurrentSaveInstanceWindow.Parent = explorerPanel.Parent
3080 CurrentSaveInstanceWindow.Visible = true
3081
3082 local filename = CurrentSaveInstanceWindow.MainWindow.FileName
3083 local saveObjects = true
3084 local overwriteCaution = false
3085
3086 CurrentSaveInstanceWindow.MainWindow.Save.MouseButton1Up:connect(function()
3087 if readfile and getelysianpath then
3088 if readfile(getelysianpath()..filename.Text..".rbxmx") then
3089 if not overwriteCaution then
3090 overwriteCaution = true
3091 local newCaution = ConfirmationWindow:Clone()
3092 newCaution.Name = "SaveInstanceOverwriteCaution"
3093 newCaution.MainWindow.Desc.Text = "The file, "..filename.Text..".rbxmx, already exists. Overwrite?"
3094 newCaution.Parent = explorerPanel.Parent
3095 newCaution.Visible = true
3096 newCaution.MainWindow.Yes.MouseButton1Up:connect(function()
3097 ypcall(function()
3098 SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
3099 end)
3100 overwriteCaution = false
3101 newCaution:Destroy()
3102 if CurrentSaveInstanceWindow then
3103 CurrentSaveInstanceWindow:Destroy()
3104 CurrentSaveInstanceWindow = nil
3105 end
3106 end)
3107 newCaution.MainWindow.No.MouseButton1Up:connect(function()
3108 overwriteCaution = false
3109 newCaution:Destroy()
3110 end)
3111 end
3112 else
3113 ypcall(function()
3114 SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
3115 end)
3116 if CurrentSaveInstanceWindow then
3117 CurrentSaveInstanceWindow:Destroy()
3118 CurrentSaveInstanceWindow = nil
3119 if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
3120 explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
3121 end
3122 end
3123 end
3124 else
3125 ypcall(function()
3126 if SaveInstance then
3127 SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
3128 else
3129 _G.SaveInstance(inst,filename.Text,not saveObjects)
3130 end
3131 end)
3132 if CurrentSaveInstanceWindow then
3133 CurrentSaveInstanceWindow:Destroy()
3134 CurrentSaveInstanceWindow = nil
3135 if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
3136 explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
3137 end
3138 end
3139 end
3140 end)
3141 CurrentSaveInstanceWindow.MainWindow.Cancel.MouseButton1Up:connect(function()
3142 if CurrentSaveInstanceWindow then
3143 CurrentSaveInstanceWindow:Destroy()
3144 CurrentSaveInstanceWindow = nil
3145 if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
3146 explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
3147 end
3148 end
3149 end)
3150 CurrentSaveInstanceWindow.MainWindow.SaveObjects.MouseButton1Up:connect(function()
3151 if saveObjects then
3152 saveObjects = false
3153 CurrentSaveInstanceWindow.MainWindow.SaveObjects.enabled.Visible = false
3154 else
3155 saveObjects = true
3156 CurrentSaveInstanceWindow.MainWindow.SaveObjects.enabled.Visible = true
3157 end
3158 end)
3159end
3160
3161function DestroyRightClick()
3162 if currentRightClickMenu then
3163 currentRightClickMenu:Destroy()
3164 currentRightClickMenu = nil
3165 end
3166 if CurrentInsertObjectWindow and CurrentInsertObjectWindow.Visible then
3167 CurrentInsertObjectWindow.Visible = false
3168 end
3169end
3170
3171function rightClickMenu(sObj)
3172 local mouse = game.Players.LocalPlayer:GetMouse()
3173
3174 currentRightClickMenu = CreateRightClickMenu(
3175 {"Cut","Copy","Paste Into","Duplicate","Delete","Group","Ungroup","Select Children","Teleport To","Insert Part","Insert Object","Save Instance","Call Function","Call Remote"},
3176 "",
3177 false,
3178 function(option)
3179 if option == "Cut" then
3180 if not Option.Modifiable then return end
3181 clipboard = {}
3182 local list = Selection.List
3183 local cut = {}
3184 for i = 1,#list do
3185 local obj = list[i]:Clone()
3186 if obj then
3187 table.insert(clipboard,obj)
3188 table.insert(cut,list[i])
3189 end
3190 end
3191 for i = 1,#cut do
3192 pcall(delete,cut[i])
3193 end
3194 elseif option == "Copy" then
3195 if not Option.Modifiable then return end
3196 clipboard = {}
3197 local list = Selection.List
3198 for i = 1,#list do
3199 table.insert(clipboard,list[i]:Clone())
3200 end
3201 elseif option == "Paste Into" then
3202 if not Option.Modifiable then return end
3203 local parent = Selection.List[1] or workspace
3204 for i = 1,#clipboard do
3205 clipboard[i]:Clone().Parent = parent
3206 end
3207 elseif option == "Duplicate" then
3208 if not Option.Modifiable then return end
3209 local list = Selection:Get()
3210 for i = 1,#list do
3211 list[i]:Clone().Parent = Selection.List[1].Parent or workspace
3212 end
3213 elseif option == "Delete" then
3214 if not Option.Modifiable then return end
3215 local list = Selection:Get()
3216 for i = 1,#list do
3217 pcall(delete,list[i])
3218 end
3219 Selection:Set({})
3220 elseif option == "Group" then
3221 if not Option.Modifiable then return end
3222 local newModel = Instance.new("Model")
3223 local list = Selection:Get()
3224 newModel.Parent = Selection.List[1].Parent or workspace
3225 for i = 1,#list do
3226 list[i].Parent = newModel
3227 end
3228 Selection:Set({})
3229 elseif option == "Ungroup" then
3230 if not Option.Modifiable then return end
3231 local ungrouped = {}
3232 local list = Selection:Get()
3233 for i = 1,#list do
3234 if list[i]:IsA("Model") then
3235 for i2,v2 in pairs(list[i]:GetChildren()) do
3236 v2.Parent = list[i].Parent or workspace
3237 table.insert(ungrouped,v2)
3238 end
3239 pcall(delete,list[i])
3240 end
3241 end
3242 Selection:Set({})
3243 if SettingsRemote:Invoke("SelectUngrouped") then
3244 for i,v in pairs(ungrouped) do
3245 Selection:Add(v)
3246 end
3247 end
3248 elseif option == "Select Children" then
3249 if not Option.Modifiable then return end
3250 local list = Selection:Get()
3251 Selection:Set({})
3252 Selection:StopUpdates()
3253 for i = 1,#list do
3254 for i2,v2 in pairs(list[i]:GetChildren()) do
3255 Selection:Add(v2)
3256 end
3257 end
3258 Selection:ResumeUpdates()
3259 elseif option == "Teleport To" then
3260 if not Option.Modifiable then return end
3261 local list = Selection:Get()
3262 for i = 1,#list do
3263 if list[i]:IsA("BasePart") then
3264 pcall(function()
3265 game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = list[i].CFrame
3266 end)
3267 break
3268 end
3269 end
3270 elseif option == "Insert Part" then
3271 if not Option.Modifiable then return end
3272 local insertedParts = {}
3273 local list = Selection:Get()
3274 for i = 1,#list do
3275 pcall(function()
3276 local newPart = Instance.new("Part")
3277 newPart.Parent = list[i]
3278 newPart.CFrame = CFrame.new(game.Players.LocalPlayer.Character.Head.Position) + Vector3.new(0,3,0)
3279 table.insert(insertedParts,newPart)
3280 end)
3281 end
3282 elseif option == "Save Instance" then
3283 if not Option.Modifiable then return end
3284 local list = Selection:Get()
3285 if #list == 1 then
3286 list[1].Archivable = true
3287 ypcall(function()PromptSaveInstance(list[1]:Clone())end)
3288 elseif #list > 1 then
3289 local newModel = Instance.new("Model")
3290 newModel.Name = "SavedInstances"
3291 for i = 1,#list do
3292 ypcall(function()
3293 list[i].Archivable = true
3294 list[i]:Clone().Parent = newModel
3295 end)
3296 end
3297 PromptSaveInstance(newModel)
3298 end
3299 elseif option == "Call Remote" then
3300 if not Option.Modifiable then return end
3301 local list = Selection:Get()
3302 for i = 1,#list do
3303 if list[i]:IsA("RemoteFunction") or list[i]:IsA("RemoteEvent") then
3304 PromptRemoteCaller(list[i])
3305 break
3306 end
3307 end
3308 end
3309 end)
3310 currentRightClickMenu.Parent = explorerPanel.Parent
3311 currentRightClickMenu.Position = UDim2.new(0,mouse.X,0,mouse.Y)
3312 if currentRightClickMenu.AbsolutePosition.X + currentRightClickMenu.AbsoluteSize.X > explorerPanel.AbsolutePosition.X + explorerPanel.AbsoluteSize.X then
3313 currentRightClickMenu.Position = UDim2.new(0, explorerPanel.AbsolutePosition.X + explorerPanel.AbsoluteSize.X - currentRightClickMenu.AbsoluteSize.X, 0, mouse.Y)
3314 end
3315end
3316
3317local function cancelReparentDrag()end
3318local function cancelSelectDrag()end
3319do
3320 local listEntries = {}
3321 local nameConnLookup = {}
3322
3323 local mouseDrag = Create('ImageButton',{
3324 Name = "MouseDrag";
3325 Position = UDim2.new(-0.25,0,-0.25,0);
3326 Size = UDim2.new(1.5,0,1.5,0);
3327 Transparency = 1;
3328 AutoButtonColor = false;
3329 Active = true;
3330 ZIndex = 10;
3331 })
3332 local function dragSelect(last,add,button)
3333 local connDrag
3334 local conUp
3335
3336 conDrag = mouseDrag.MouseMoved:connect(function(x,y)
3337 local pos = Vector2.new(x,y) - listFrame.AbsolutePosition
3338 local size = listFrame.AbsoluteSize
3339 if pos.x < 0 or pos.x > size.x or pos.y < 0 or pos.y > size.y then return end
3340
3341 local i = math.ceil(pos.y/ENTRY_BOUND) + scrollBar.ScrollIndex
3342 -- Mouse may have made a large step, so interpolate between the
3343 -- last index and the current.
3344 for n = i<last and i or last, i>last and i or last do
3345 local node = TreeList[n]
3346 if node then
3347 if add then
3348 Selection:Add(node.Object)
3349 else
3350 Selection:Remove(node.Object)
3351 end
3352 end
3353 end
3354 last = i
3355 end)
3356
3357 function cancelSelectDrag()
3358 mouseDrag.Parent = nil
3359 conDrag:disconnect()
3360 conUp:disconnect()
3361 function cancelSelectDrag()end
3362 end
3363
3364 conUp = mouseDrag[button]:connect(cancelSelectDrag)
3365
3366 mouseDrag.Parent = GetScreen(listFrame)
3367 end
3368
3369 local function dragReparent(object,dragGhost,clickPos,ghostOffset)
3370 local connDrag
3371 local conUp
3372 local conUp2
3373
3374 local parentIndex = nil
3375 local dragged = false
3376
3377 local parentHighlight = Create('Frame',{
3378 Transparency = 1;
3379 Visible = false;
3380 Create('Frame',{
3381 BorderSizePixel = 0;
3382 BackgroundColor3 = Color3.new(0,0,0);
3383 BackgroundTransparency = 0.1;
3384 Position = UDim2.new(0,0,0,0);
3385 Size = UDim2.new(1,0,0,1);
3386 });
3387 Create('Frame',{
3388 BorderSizePixel = 0;
3389 BackgroundColor3 = Color3.new(0,0,0);
3390 BackgroundTransparency = 0.1;
3391 Position = UDim2.new(1,0,0,0);
3392 Size = UDim2.new(0,1,1,0);
3393 });
3394 Create('Frame',{
3395 BorderSizePixel = 0;
3396 BackgroundColor3 = Color3.new(0,0,0);
3397 BackgroundTransparency = 0.1;
3398 Position = UDim2.new(0,0,1,0);
3399 Size = UDim2.new(1,0,0,1);
3400 });
3401 Create('Frame',{
3402 BorderSizePixel = 0;
3403 BackgroundColor3 = Color3.new(0,0,0);
3404 BackgroundTransparency = 0.1;
3405 Position = UDim2.new(0,0,0,0);
3406 Size = UDim2.new(0,1,1,0);
3407 });
3408 })
3409 SetZIndex(parentHighlight,9)
3410
3411 conDrag = mouseDrag.MouseMoved:connect(function(x,y)
3412 local dragPos = Vector2.new(x,y)
3413 if dragged then
3414 local pos = dragPos - listFrame.AbsolutePosition
3415 local size = listFrame.AbsoluteSize
3416
3417 parentIndex = nil
3418 parentHighlight.Visible = false
3419 if pos.x >= 0 and pos.x <= size.x and pos.y >= 0 and pos.y <= size.y + ENTRY_SIZE*2 then
3420 local i = math.ceil(pos.y/ENTRY_BOUND-2)
3421 local node = TreeList[i + scrollBar.ScrollIndex]
3422 if node and node.Object ~= object and not object:IsAncestorOf(node.Object) then
3423 parentIndex = i
3424 local entry = listEntries[i]
3425 if entry then
3426 parentHighlight.Visible = true
3427 parentHighlight.Position = UDim2.new(0,1,0,entry.AbsolutePosition.y-listFrame.AbsolutePosition.y)
3428 parentHighlight.Size = UDim2.new(0,size.x-4,0,entry.AbsoluteSize.y)
3429 end
3430 end
3431 end
3432
3433 dragGhost.Position = UDim2.new(0,dragPos.x+ghostOffset.x,0,dragPos.y+ghostOffset.y)
3434 elseif (clickPos-dragPos).magnitude > 8 then
3435 dragged = true
3436 SetZIndex(dragGhost,9)
3437 dragGhost.IndentFrame.Transparency = 0.25
3438 dragGhost.IndentFrame.EntryText.TextColor3 = GuiColor.TextSelected
3439 dragGhost.Position = UDim2.new(0,dragPos.x+ghostOffset.x,0,dragPos.y+ghostOffset.y)
3440 dragGhost.Parent = GetScreen(listFrame)
3441 parentHighlight.Parent = listFrame
3442 end
3443 end)
3444
3445 function cancelReparentDrag()
3446 mouseDrag.Parent = nil
3447 conDrag:disconnect()
3448 conUp:disconnect()
3449 conUp2:disconnect()
3450 dragGhost:Destroy()
3451 parentHighlight:Destroy()
3452 function cancelReparentDrag()end
3453 end
3454
3455 local wasSelected = Selection.Selected[object]
3456 if not wasSelected and Option.Selectable then
3457 Selection:Set({object})
3458 end
3459
3460 conUp = mouseDrag.MouseButton1Up:connect(function()
3461 cancelReparentDrag()
3462 if dragged then
3463 if parentIndex then
3464 local parentNode = TreeList[parentIndex + scrollBar.ScrollIndex]
3465 if parentNode then
3466 parentNode.Expanded = true
3467
3468 local parentObj = parentNode.Object
3469 local function parent(a,b)
3470 a.Parent = b
3471 end
3472 if Option.Selectable then
3473 local list = Selection.List
3474 for i = 1,#list do
3475 pcall(parent,list[i],parentObj)
3476 end
3477 else
3478 pcall(parent,object,parentObj)
3479 end
3480 end
3481 end
3482 else
3483 -- do selection click
3484 if wasSelected and Option.Selectable then
3485 Selection:Set({})
3486 end
3487 end
3488 end)