1 | local library = { |
2 | flags = { }, |
3 | items = { } |
4 | } |
5 | |
6 | -- Services |
7 | local players = game:GetService("Players") |
8 | local uis = game:GetService("UserInputService") |
9 | local runservice = game:GetService("RunService") |
10 | local tweenservice = game:GetService("TweenService") |
11 | local marketplaceservice = game:GetService("MarketplaceService") |
12 | local textservice = game:GetService("TextService") |
13 | local coregui = game:GetService("CoreGui") |
14 | local httpservice = game:GetService("HttpService") |
15 | |
16 | local player = players.LocalPlayer |
17 | local mouse = player:GetMouse() |
18 | local camera = game.Workspace.CurrentCamera |
19 | |
20 | library.theme = { |
21 | fontsize = 15, |
22 | titlesize = 18, |
23 | font = Enum.Font.Code, |
24 | background = "rbxassetid://5553946656", |
25 | tilesize = 90, |
26 | cursor = true, |
27 | cursorimg = "https://t0.rbxcdn.com/42f66da98c40252ee151326a82aab51f", |
28 | backgroundcolor = Color3.fromRGB(20, 20, 20), |
29 | tabstextcolor = Color3.fromRGB(240, 240, 240), |
30 | bordercolor = Color3.fromRGB(60, 60, 60), |
31 | accentcolor = Color3.fromRGB(28, 56, 139), |
32 | accentcolor2 = Color3.fromRGB(16, 31, 78), |
33 | outlinecolor = Color3.fromRGB(60, 60, 60), |
34 | outlinecolor2 = Color3.fromRGB(0, 0, 0), |
35 | sectorcolor = Color3.fromRGB(30, 30, 30), |
36 | toptextcolor = Color3.fromRGB(255, 255, 255), |
37 | topheight = 48, |
38 | topcolor = Color3.fromRGB(30, 30, 30), |
39 | topcolor2 = Color3.fromRGB(30, 30, 30), |
40 | buttoncolor = Color3.fromRGB(49, 49, 49), |
41 | buttoncolor2 = Color3.fromRGB(39, 39, 39), |
42 | itemscolor = Color3.fromRGB(200, 200, 200), |
43 | itemscolor2 = Color3.fromRGB(210, 210, 210) |
44 | } |
45 | |
46 | function library:CreateWatermark(name, position) |
47 | local gamename = marketplaceservice:GetProductInfo(game.PlaceId).Name |
48 | local watermark = { } |
49 | watermark.Visible = true |
50 | watermark.text = " " .. name:gsub("{game}", gamename):gsub("{fps}", "0 FPS") .. " " |
51 | |
52 | watermark.main = Instance.new("ScreenGui", coregui) |
53 | watermark.main.Name = "Watermark" |
54 | if syn then |
55 | syn.protect_gui(watermark.main) |
56 | end |
57 | |
58 | if getgenv().watermark then |
59 | getgenv().watermark:Remove() |
60 | end |
61 | getgenv().watermark = watermark.main |
62 | |
63 | watermark.mainbar = Instance.new("Frame", watermark.main) |
64 | watermark.mainbar.Name = "Main" |
65 | watermark.mainbar.BorderColor3 = Color3.fromRGB(80, 80, 80) |
66 | watermark.mainbar.Visible = watermark.Visible |
67 | watermark.mainbar.BorderSizePixel = 0 |
68 | watermark.mainbar.ZIndex = 5 |
69 | watermark.mainbar.Position = UDim2.new(0, position and position.X or 10, 0, position and position.Y or 10) |
70 | watermark.mainbar.Size = UDim2.new(0, 0, 0, 25) |
71 | |
72 | watermark.Gradient = Instance.new("UIGradient", watermark.mainbar) |
73 | watermark.Gradient.Rotation = 90 |
74 | watermark.Gradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, Color3.fromRGB(40, 40, 40)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(10, 10, 10)) }) |
75 | |
76 | watermark.Outline = Instance.new("Frame", watermark.mainbar) |
77 | watermark.Outline.Name = "outline" |
78 | watermark.Outline.ZIndex = 4 |
79 | watermark.Outline.BorderSizePixel = 0 |
80 | watermark.Outline.Visible = watermark.Visible |
81 | watermark.Outline.BackgroundColor3 = library.theme.outlinecolor |
82 | watermark.Outline.Position = UDim2.fromOffset(-1, -1) |
83 | |
84 | watermark.BlackOutline = Instance.new("Frame", watermark.mainbar) |
85 | watermark.BlackOutline.Name = "blackline" |
86 | watermark.BlackOutline.ZIndex = 3 |
87 | watermark.BlackOutline.BorderSizePixel = 0 |
88 | watermark.BlackOutline.BackgroundColor3 = library.theme.outlinecolor2 |
89 | watermark.BlackOutline.Visible = watermark.Visible |
90 | watermark.BlackOutline.Position = UDim2.fromOffset(-2, -2) |
91 | |
92 | watermark.label = Instance.new("TextLabel", watermark.mainbar) |
93 | watermark.label.Name = "FPSLabel" |
94 | watermark.label.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
95 | watermark.label.BackgroundTransparency = 1.000 |
96 | watermark.label.Position = UDim2.new(0, 0, 0, 0) |
97 | watermark.label.Size = UDim2.new(0, 238, 0, 25) |
98 | watermark.label.Font = library.theme.font |
99 | watermark.label.ZIndex = 6 |
100 | watermark.label.Visible = watermark.Visible |
101 | watermark.label.Text = watermark.text |
102 | watermark.label.TextColor3 = Color3.fromRGB(255, 255, 255) |
103 | watermark.label.TextSize = 15 |
104 | watermark.label.TextStrokeTransparency = 0.000 |
105 | watermark.label.TextXAlignment = Enum.TextXAlignment.Left |
106 | watermark.label.Size = UDim2.new(0, watermark.label.TextBounds.X+10, 0, 25) |
107 | |
108 | watermark.topbar = Instance.new("Frame", watermark.mainbar) |
109 | watermark.topbar.Name = "TopBar" |
110 | watermark.topbar.ZIndex = 6 |
111 | watermark.topbar.BackgroundColor3 = library.theme.accentcolor |
112 | watermark.topbar.BorderSizePixel = 0 |
113 | watermark.topbar.Visible = watermark.Visible |
114 | watermark.topbar.Size = UDim2.new(0, 0, 0, 1) |
115 | |
116 | watermark.mainbar.Size = UDim2.new(0, watermark.label.TextBounds.X, 0, 25) |
117 | watermark.topbar.Size = UDim2.new(0, watermark.label.TextBounds.X+6, 0, 1) |
118 | watermark.Outline.Size = watermark.mainbar.Size + UDim2.fromOffset(2, 2) |
119 | watermark.BlackOutline.Size = watermark.mainbar.Size + UDim2.fromOffset(4, 4) |
120 | |
121 | watermark.mainbar.Size = UDim2.new(0, watermark.label.TextBounds.X+4, 0, 25) |
122 | watermark.label.Size = UDim2.new(0, watermark.label.TextBounds.X+4, 0, 25) |
123 | watermark.topbar.Size = UDim2.new(0, watermark.label.TextBounds.X+6, 0, 1) |
124 | watermark.Outline.Size = watermark.mainbar.Size + UDim2.fromOffset(2, 2) |
125 | watermark.BlackOutline.Size = watermark.mainbar.Size + UDim2.fromOffset(4, 4) |
126 | |
127 | local startTime, counter, oldfps = os.clock(), 0, nil |
128 | runservice.Heartbeat:Connect(function() |
129 | watermark.label.Visible = watermark.Visible |
130 | watermark.mainbar.Visible = watermark.Visible |
131 | watermark.topbar.Visible = watermark.Visible |
132 | watermark.Outline.Visible = watermark.Visible |
133 | watermark.BlackOutline.Visible = watermark.Visible |
134 | |
135 | if not name:find("{fps}") then |
136 | watermark.label.Text = " " .. name:gsub("{game}", gamename):gsub("{fps}", "0 FPS") .. " " |
137 | end |
138 | |
139 | if name:find("{fps}") then |
140 | local currentTime = os.clock() |
141 | counter = counter + 1 |
142 | if currentTime - startTime >= 1 then |
143 | local fps = math.floor(counter / (currentTime - startTime)) |
144 | counter = 0 |
145 | startTime = currentTime |
146 | |
147 | if fps ~= oldfps then |
148 | watermark.label.Text = " " .. name:gsub("{game}", gamename):gsub("{fps}", fps .. " FPS") .. " " |
149 | |
150 | watermark.label.Size = UDim2.new(0, watermark.label.TextBounds.X+10, 0, 25) |
151 | watermark.mainbar.Size = UDim2.new(0, watermark.label.TextBounds.X, 0, 25) |
152 | watermark.topbar.Size = UDim2.new(0, watermark.label.TextBounds.X, 0, 1) |
153 | |
154 | watermark.Outline.Size = watermark.mainbar.Size + UDim2.fromOffset(2, 2) |
155 | watermark.BlackOutline.Size = watermark.mainbar.Size + UDim2.fromOffset(4, 4) |
156 | end |
157 | oldfps = fps |
158 | end |
159 | end |
160 | end) |
161 | |
162 | watermark.mainbar.MouseEnter:Connect(function() |
163 | tweenservice:Create(watermark.mainbar, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { BackgroundTransparency = 1, Active = false }):Play() |
164 | tweenservice:Create(watermark.topbar, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { BackgroundTransparency = 1, Active = false }):Play() |
165 | tweenservice:Create(watermark.label, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { TextTransparency = 1, Active = false }):Play() |
166 | tweenservice:Create(watermark.Outline, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { BackgroundTransparency = 1, Active = false }):Play() |
167 | tweenservice:Create(watermark.BlackOutline, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { BackgroundTransparency = 1, Active = false }):Play() |
168 | end) |
169 | |
170 | watermark.mainbar.MouseLeave:Connect(function() |
171 | tweenservice:Create(watermark.mainbar, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { BackgroundTransparency = 0, Active = true }):Play() |
172 | tweenservice:Create(watermark.topbar, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { BackgroundTransparency = 0, Active = true }):Play() |
173 | tweenservice:Create(watermark.label, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { TextTransparency = 0, Active = true }):Play() |
174 | tweenservice:Create(watermark.Outline, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { BackgroundTransparency = 0, Active = true }):Play() |
175 | tweenservice:Create(watermark.BlackOutline, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { BackgroundTransparency = 0, Active = true }):Play() |
176 | end) |
177 | |
178 | function watermark:UpdateTheme(theme) |
179 | theme = theme or library.theme |
180 | watermark.Outline.BackgroundColor3 = theme.outlinecolor |
181 | watermark.BlackOutline.BackgroundColor3 = theme.outlinecolor2 |
182 | watermark.label.Font = theme.font |
183 | watermark.topbar.BackgroundColor3 = theme.accentcolor |
184 | end |
185 | |
186 | return watermark |
187 | end |
188 | |
189 | function library:CreateWindow(name, size, hidebutton) |
190 | local window = { } |
191 | |
192 | window.name = name or "" |
193 | window.size = UDim2.fromOffset(size.X, size.Y) or UDim2.fromOffset(492, 598) |
194 | window.hidebutton = hidebutton or Enum.KeyCode.RightShift |
195 | window.theme = library.theme |
196 | |
197 | local updateevent = Instance.new("BindableEvent") |
198 | function window:UpdateTheme(theme) |
199 | updateevent:Fire(theme or library.theme) |
200 | window.theme = (theme or library.theme) |
201 | end |
202 | |
203 | window.Main = Instance.new("ScreenGui", coregui) |
204 | window.Main.Name = name |
205 | window.Main.DisplayOrder = 15 |
206 | if syn then |
207 | syn.protect_gui(window.Main) |
208 | end |
209 | |
210 | if getgenv().uilib then |
211 | getgenv().uilib:Remove() |
212 | end |
213 | getgenv().uilib = window.Main |
214 | |
215 | local dragging, dragInput, dragStart, startPos |
216 | uis.InputChanged:Connect(function(input) |
217 | if input == dragInput and dragging then |
218 | local delta = input.Position - dragStart |
219 | window.Frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) |
220 | end |
221 | end) |
222 | |
223 | local dragstart = function(input) |
224 | if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then |
225 | dragging = true |
226 | dragStart = input.Position |
227 | startPos = window.Frame.Position |
228 | |
229 | input.Changed:Connect(function() |
230 | if input.UserInputState == Enum.UserInputState.End then |
231 | dragging = false |
232 | end |
233 | end) |
234 | end |
235 | end |
236 | |
237 | local dragend = function(input) |
238 | if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then |
239 | dragInput = input |
240 | end |
241 | end |
242 | |
243 | window.Frame = Instance.new("TextButton", window.Main) |
244 | window.Frame.Name = "main" |
245 | window.Frame.Position = UDim2.fromScale(0.5, 0.5) |
246 | window.Frame.BorderSizePixel = 0 |
247 | window.Frame.Size = window.size |
248 | window.Frame.AutoButtonColor = false |
249 | window.Frame.Text = "" |
250 | window.Frame.BackgroundColor3 = window.theme.backgroundcolor |
251 | window.Frame.AnchorPoint = Vector2.new(0.5, 0.5) |
252 | updateevent.Event:Connect(function(theme) |
253 | window.Frame.BackgroundColor3 = theme.backgroundcolor |
254 | end) |
255 | |
256 | uis.InputBegan:Connect(function(key) |
257 | if key.KeyCode == window.hidebutton then |
258 | window.Frame.Visible = not window.Frame.Visible |
259 | end |
260 | end) |
261 | |
262 | local function checkIfGuiInFront(Pos) |
263 | local objects = coregui:GetGuiObjectsAtPosition(Pos.X, Pos.Y) |
264 | for i,v in pairs(objects) do |
265 | if not string.find(v:GetFullName(), window.name) then |
266 | table.remove(objects, i) |
267 | end |
268 | end |
269 | return (#objects ~= 0 and objects[1].AbsolutePosition ~= Pos) |
270 | end |
271 | |
272 | window.BlackOutline = Instance.new("Frame", window.Frame) |
273 | window.BlackOutline.Name = "outline" |
274 | window.BlackOutline.ZIndex = 1 |
275 | window.BlackOutline.Size = window.size + UDim2.fromOffset(2, 2) |
276 | window.BlackOutline.BorderSizePixel = 0 |
277 | window.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2 |
278 | window.BlackOutline.Position = UDim2.fromOffset(-1, -1) |
279 | updateevent.Event:Connect(function(theme) |
280 | window.BlackOutline.BackgroundColor3 = theme.outlinecolor2 |
281 | end) |
282 | |
283 | window.Outline = Instance.new("Frame", window.Frame) |
284 | window.Outline.Name = "outline" |
285 | window.Outline.ZIndex = 0 |
286 | window.Outline.Size = window.size + UDim2.fromOffset(4, 4) |
287 | window.Outline.BorderSizePixel = 0 |
288 | window.Outline.BackgroundColor3 = window.theme.outlinecolor |
289 | window.Outline.Position = UDim2.fromOffset(-2, -2) |
290 | updateevent.Event:Connect(function(theme) |
291 | window.Outline.BackgroundColor3 = theme.outlinecolor |
292 | end) |
293 | |
294 | window.BlackOutline2 = Instance.new("Frame", window.Frame) |
295 | window.BlackOutline2.Name = "outline" |
296 | window.BlackOutline2.ZIndex = -1 |
297 | window.BlackOutline2.Size = window.size + UDim2.fromOffset(6, 6) |
298 | window.BlackOutline2.BorderSizePixel = 0 |
299 | window.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
300 | window.BlackOutline2.Position = UDim2.fromOffset(-3, -3) |
301 | updateevent.Event:Connect(function(theme) |
302 | window.BlackOutline2.BackgroundColor3 = theme.outlinecolor2 |
303 | end) |
304 | |
305 | window.TopBar = Instance.new("Frame", window.Frame) |
306 | window.TopBar.Name = "top" |
307 | window.TopBar.Size = UDim2.fromOffset(window.size.X.Offset, window.theme.topheight) |
308 | window.TopBar.BorderSizePixel = 0 |
309 | window.TopBar.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
310 | window.TopBar.InputBegan:Connect(dragstart) |
311 | window.TopBar.InputChanged:Connect(dragend) |
312 | updateevent.Event:Connect(function(theme) |
313 | window.TopBar.Size = UDim2.fromOffset(window.size.X.Offset, theme.topheight) |
314 | end) |
315 | |
316 | window.TopGradient = Instance.new("UIGradient", window.TopBar) |
317 | window.TopGradient.Rotation = 90 |
318 | window.TopGradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, window.theme.topcolor), ColorSequenceKeypoint.new(1.00, window.theme.topcolor2) }) |
319 | updateevent.Event:Connect(function(theme) |
320 | window.TopGradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, theme.topcolor), ColorSequenceKeypoint.new(1.00, theme.topcolor2) }) |
321 | end) |
322 | |
323 | window.NameLabel = Instance.new("TextLabel", window.TopBar) |
324 | window.NameLabel.TextColor3 = window.theme.toptextcolor |
325 | window.NameLabel.Text = window.name |
326 | window.NameLabel.TextXAlignment = Enum.TextXAlignment.Left |
327 | window.NameLabel.Font = window.theme.font |
328 | window.NameLabel.Name = "title" |
329 | window.NameLabel.Position = UDim2.fromOffset(4, -2) |
330 | window.NameLabel.BackgroundTransparency = 1 |
331 | window.NameLabel.Size = UDim2.fromOffset(190, window.TopBar.AbsoluteSize.Y / 2 - 2) |
332 | window.NameLabel.TextSize = window.theme.titlesize |
333 | updateevent.Event:Connect(function(theme) |
334 | window.NameLabel.TextColor3 = theme.toptextcolor |
335 | window.NameLabel.Font = theme.font |
336 | window.NameLabel.TextSize = theme.titlesize |
337 | end) |
338 | |
339 | window.Line2 = Instance.new("Frame", window.TopBar) |
340 | window.Line2.Name = "line" |
341 | window.Line2.Position = UDim2.fromOffset(0, window.TopBar.AbsoluteSize.Y / 2.1) |
342 | window.Line2.Size = UDim2.fromOffset(window.size.X.Offset, 1) |
343 | window.Line2.BorderSizePixel = 0 |
344 | window.Line2.BackgroundColor3 = window.theme.accentcolor |
345 | updateevent.Event:Connect(function(theme) |
346 | window.Line2.BackgroundColor3 = theme.accentcolor |
347 | end) |
348 | |
349 | window.TabList = Instance.new("Frame", window.TopBar) |
350 | window.TabList.Name = "tablist" |
351 | window.TabList.BackgroundTransparency = 1 |
352 | window.TabList.Position = UDim2.fromOffset(0, window.TopBar.AbsoluteSize.Y / 2 + 1) |
353 | window.TabList.Size = UDim2.fromOffset(window.size.X.Offset, window.TopBar.AbsoluteSize.Y / 2) |
354 | window.TabList.BorderSizePixel = 0 |
355 | window.TabList.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
356 | |
357 | window.TabList.InputBegan:Connect(dragstart) |
358 | window.TabList.InputChanged:Connect(dragend) |
359 | |
360 | window.BlackLine = Instance.new("Frame", window.Frame) |
361 | window.BlackLine.Name = "blackline" |
362 | window.BlackLine.Size = UDim2.fromOffset(window.size.X.Offset, 1) |
363 | window.BlackLine.BorderSizePixel = 0 |
364 | window.BlackLine.ZIndex = 9 |
365 | window.BlackLine.BackgroundColor3 = window.theme.outlinecolor2 |
366 | window.BlackLine.Position = UDim2.fromOffset(0, window.TopBar.AbsoluteSize.Y) |
367 | updateevent.Event:Connect(function(theme) |
368 | window.BlackLine.BackgroundColor3 = theme.outlinecolor2 |
369 | end) |
370 | |
371 | window.BackgroundImage = Instance.new("ImageLabel", window.Frame) |
372 | window.BackgroundImage.Name = "background" |
373 | window.BackgroundImage.BorderSizePixel = 0 |
374 | window.BackgroundImage.ScaleType = Enum.ScaleType.Tile |
375 | window.BackgroundImage.Position = window.BlackLine.Position + UDim2.fromOffset(0, 1) |
376 | window.BackgroundImage.Size = UDim2.fromOffset(window.size.X.Offset, window.size.Y.Offset - window.TopBar.AbsoluteSize.Y - 1) |
377 | window.BackgroundImage.Image = window.theme.background or "" |
378 | window.BackgroundImage.ImageTransparency = window.BackgroundImage.Image ~= "" and 0 or 1 |
379 | window.BackgroundImage.ImageColor3 = Color3.new() |
380 | window.BackgroundImage.BackgroundColor3 = window.theme.backgroundcolor |
381 | window.BackgroundImage.TileSize = UDim2.new(0, window.theme.tilesize, 0, window.theme.tilesize) |
382 | updateevent.Event:Connect(function(theme) |
383 | window.BackgroundImage.Image = theme.background or "" |
384 | window.BackgroundImage.ImageTransparency = window.BackgroundImage.Image ~= "" and 0 or 1 |
385 | window.BackgroundImage.BackgroundColor3 = theme.backgroundcolor |
386 | window.BackgroundImage.TileSize = UDim2.new(0, theme.tilesize, 0, theme.tilesize) |
387 | end) |
388 | |
389 | window.Line = Instance.new("Frame", window.Frame) |
390 | window.Line.Name = "line" |
391 | window.Line.Position = UDim2.fromOffset(0, 0) |
392 | window.Line.Size = UDim2.fromOffset(60, 1) |
393 | window.Line.BorderSizePixel = 0 |
394 | window.Line.BackgroundColor3 = window.theme.accentcolor |
395 | updateevent.Event:Connect(function(theme) |
396 | window.Line.BackgroundColor3 = theme.accentcolor |
397 | end) |
398 | |
399 | window.ListLayout = Instance.new("UIListLayout", window.TabList) |
400 | window.ListLayout.FillDirection = Enum.FillDirection.Horizontal |
401 | window.ListLayout.SortOrder = Enum.SortOrder.LayoutOrder |
402 | |
403 | window.OpenedColorPickers = { } |
404 | window.Tabs = { } |
405 | |
406 | function window:CreateTab(name) |
407 | local tab = { } |
408 | tab.name = name or "" |
409 | |
410 | local textservice = game:GetService("TextService") |
411 | local size = textservice:GetTextSize(tab.name, window.theme.fontsize, window.theme.font, Vector2.new(200,300)) |
412 | |
413 | tab.TabButton = Instance.new("TextButton", window.TabList) |
414 | tab.TabButton.TextColor3 = window.theme.tabstextcolor |
415 | tab.TabButton.Text = tab.name |
416 | tab.TabButton.AutoButtonColor = false |
417 | tab.TabButton.Font = window.theme.font |
418 | tab.TabButton.TextYAlignment = Enum.TextYAlignment.Center |
419 | tab.TabButton.BackgroundTransparency = 1 |
420 | tab.TabButton.BorderSizePixel = 0 |
421 | tab.TabButton.Size = UDim2.fromOffset(size.X + 15, window.TabList.AbsoluteSize.Y - 1) |
422 | tab.TabButton.Name = tab.name |
423 | tab.TabButton.TextSize = window.theme.fontsize |
424 | updateevent.Event:Connect(function(theme) |
425 | local size = textservice:GetTextSize(tab.name, theme.fontsize, theme.font, Vector2.new(200,300)) |
426 | tab.TabButton.TextColor3 = tab.TabButton.Name == "SelectedTab" and theme.accentcolor or theme.tabstextcolor |
427 | tab.TabButton.Font = theme.font |
428 | tab.TabButton.Size = UDim2.fromOffset(size.X + 15, window.TabList.AbsoluteSize.Y - 1) |
429 | tab.TabButton.TextSize = theme.fontsize |
430 | end) |
431 | |
432 | tab.Left = Instance.new("ScrollingFrame", window.Frame) |
433 | tab.Left.Name = "leftside" |
434 | tab.Left.BorderSizePixel = 0 |
435 | tab.Left.Size = UDim2.fromOffset(window.size.X.Offset / 2, window.size.Y.Offset - (window.TopBar.AbsoluteSize.Y + 1)) |
436 | tab.Left.BackgroundTransparency = 1 |
437 | tab.Left.Visible = false |
438 | tab.Left.ScrollBarThickness = 0 |
439 | tab.Left.ScrollingDirection = "Y" |
440 | tab.Left.Position = window.BlackLine.Position + UDim2.fromOffset(0, 1) |
441 | |
442 | tab.LeftListLayout = Instance.new("UIListLayout", tab.Left) |
443 | tab.LeftListLayout.FillDirection = Enum.FillDirection.Vertical |
444 | tab.LeftListLayout.SortOrder = Enum.SortOrder.LayoutOrder |
445 | tab.LeftListLayout.Padding = UDim.new(0, 12) |
446 | |
447 | tab.LeftListPadding = Instance.new("UIPadding", tab.Left) |
448 | tab.LeftListPadding.PaddingTop = UDim.new(0, 12) |
449 | tab.LeftListPadding.PaddingLeft = UDim.new(0, 12) |
450 | tab.LeftListPadding.PaddingRight = UDim.new(0, 12) |
451 | |
452 | tab.Right = Instance.new("ScrollingFrame", window.Frame) |
453 | tab.Right.Name = "rightside" |
454 | tab.Right.ScrollBarThickness = 0 |
455 | tab.Right.ScrollingDirection = "Y" |
456 | tab.Right.Visible = false |
457 | tab.Right.BorderSizePixel = 0 |
458 | tab.Right.Size = UDim2.fromOffset(window.size.X.Offset / 2, window.size.Y.Offset - (window.TopBar.AbsoluteSize.Y + 1)) |
459 | tab.Right.BackgroundTransparency = 1 |
460 | tab.Right.Position = tab.Left.Position + UDim2.fromOffset(tab.Left.AbsoluteSize.X, 0) |
461 | |
462 | tab.RightListLayout = Instance.new("UIListLayout", tab.Right) |
463 | tab.RightListLayout.FillDirection = Enum.FillDirection.Vertical |
464 | tab.RightListLayout.SortOrder = Enum.SortOrder.LayoutOrder |
465 | tab.RightListLayout.Padding = UDim.new(0, 12) |
466 | |
467 | tab.RightListPadding = Instance.new("UIPadding", tab.Right) |
468 | tab.RightListPadding.PaddingTop = UDim.new(0, 12) |
469 | tab.RightListPadding.PaddingLeft = UDim.new(0, 6) |
470 | tab.RightListPadding.PaddingRight = UDim.new(0, 12) |
471 | |
472 | local block = false |
473 | function tab:SelectTab() |
474 | repeat |
475 | wait() |
476 | until block == false |
477 | |
478 | block = true |
479 | for i,v in pairs(window.Tabs) do |
480 | if v ~= tab then |
481 | v.TabButton.TextColor3 = Color3.fromRGB(230, 230, 230) |
482 | v.TabButton.Name = "Tab" |
483 | v.Left.Visible = false |
484 | v.Right.Visible = false |
485 | end |
486 | end |
487 | |
488 | tab.TabButton.TextColor3 = window.theme.accentcolor |
489 | tab.TabButton.Name = "SelectedTab" |
490 | tab.Right.Visible = true |
491 | tab.Left.Visible = true |
492 | window.Line:TweenSizeAndPosition(UDim2.fromOffset(size.X + 15, 1), UDim2.new(0, (tab.TabButton.AbsolutePosition.X - window.Frame.AbsolutePosition.X), 0, 0) + (window.BlackLine.Position - UDim2.fromOffset(0, 1)), Enum.EasingDirection.In, Enum.EasingStyle.Sine, 0.15) |
493 | wait(0.2) |
494 | block = false |
495 | end |
496 | |
497 | if #window.Tabs == 0 then |
498 | tab:SelectTab() |
499 | end |
500 | |
501 | tab.TabButton.MouseButton1Down:Connect(function() |
502 | tab:SelectTab() |
503 | end) |
504 | |
505 | tab.SectorsLeft = { } |
506 | tab.SectorsRight = { } |
507 | |
508 | function tab:CreateSector(name,side) |
509 | local sector = { } |
510 | sector.name = name or "" |
511 | sector.side = side:lower() or "left" |
512 | |
513 | sector.Main = Instance.new("Frame", sector.side == "left" and tab.Left or tab.Right) |
514 | sector.Main.Name = sector.name:gsub(" ", "") .. "Sector" |
515 | sector.Main.BorderSizePixel = 0 |
516 | sector.Main.ZIndex = 4 |
517 | sector.Main.Size = UDim2.fromOffset(window.size.X.Offset / 2 - 17, 20) |
518 | sector.Main.BackgroundColor3 = window.theme.sectorcolor |
519 | --sector.Main.Position = sector.side == "left" and UDim2.new(0, 11, 0, 12) or UDim2.new(0, window.size.X.Offset - sector.Main.AbsoluteSize.X - 11, 0, 12) |
520 | updateevent.Event:Connect(function(theme) |
521 | sector.Main.BackgroundColor3 = theme.sectorcolor |
522 | end) |
523 | |
524 | sector.Line = Instance.new("Frame", sector.Main) |
525 | sector.Line.Name = "line" |
526 | sector.Line.ZIndex = 4 |
527 | sector.Line.Size = UDim2.fromOffset(sector.Main.Size.X.Offset + 4, 1) |
528 | sector.Line.BorderSizePixel = 0 |
529 | sector.Line.Position = UDim2.fromOffset(-2, -2) |
530 | sector.Line.BackgroundColor3 = window.theme.accentcolor |
531 | updateevent.Event:Connect(function(theme) |
532 | sector.Line.BackgroundColor3 = theme.accentcolor |
533 | end) |
534 | |
535 | sector.BlackOutline = Instance.new("Frame", sector.Main) |
536 | sector.BlackOutline.Name = "outline" |
537 | sector.BlackOutline.ZIndex = 3 |
538 | sector.BlackOutline.Size = sector.Main.Size + UDim2.fromOffset(2, 2) |
539 | sector.BlackOutline.BorderSizePixel = 0 |
540 | sector.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2 |
541 | sector.BlackOutline.Position = UDim2.fromOffset(-1, -1) |
542 | sector.Main:GetPropertyChangedSignal("Size"):Connect(function() |
543 | sector.BlackOutline.Size = sector.Main.Size + UDim2.fromOffset(2, 2) |
544 | end) |
545 | updateevent.Event:Connect(function(theme) |
546 | sector.BlackOutline.BackgroundColor3 = theme.outlinecolor2 |
547 | end) |
548 | |
549 | |
550 | sector.Outline = Instance.new("Frame", sector.Main) |
551 | sector.Outline.Name = "outline" |
552 | sector.Outline.ZIndex = 2 |
553 | sector.Outline.Size = sector.Main.Size + UDim2.fromOffset(4, 4) |
554 | sector.Outline.BorderSizePixel = 0 |
555 | sector.Outline.BackgroundColor3 = window.theme.outlinecolor |
556 | sector.Outline.Position = UDim2.fromOffset(-2, -2) |
557 | sector.Main:GetPropertyChangedSignal("Size"):Connect(function() |
558 | sector.Outline.Size = sector.Main.Size + UDim2.fromOffset(4, 4) |
559 | end) |
560 | updateevent.Event:Connect(function(theme) |
561 | sector.Outline.BackgroundColor3 = theme.outlinecolor |
562 | end) |
563 | |
564 | sector.BlackOutline2 = Instance.new("Frame", sector.Main) |
565 | sector.BlackOutline2.Name = "outline" |
566 | sector.BlackOutline2.ZIndex = 1 |
567 | sector.BlackOutline2.Size = sector.Main.Size + UDim2.fromOffset(6, 6) |
568 | sector.BlackOutline2.BorderSizePixel = 0 |
569 | sector.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
570 | sector.BlackOutline2.Position = UDim2.fromOffset(-3, -3) |
571 | sector.Main:GetPropertyChangedSignal("Size"):Connect(function() |
572 | sector.BlackOutline2.Size = sector.Main.Size + UDim2.fromOffset(6, 6) |
573 | end) |
574 | updateevent.Event:Connect(function(theme) |
575 | sector.BlackOutline2.BackgroundColor3 = theme.outlinecolor2 |
576 | end) |
577 | |
578 | local size = textservice:GetTextSize(sector.name, 15, window.theme.font, Vector2.new(2000, 2000)) |
579 | sector.Label = Instance.new("TextLabel", sector.Main) |
580 | sector.Label.AnchorPoint = Vector2.new(0,0.5) |
581 | sector.Label.Position = UDim2.fromOffset(12, -1) |
582 | sector.Label.Size = UDim2.fromOffset(math.clamp(textservice:GetTextSize(sector.name, 15, window.theme.font, Vector2.new(200,300)).X + 13, 0, sector.Main.Size.X.Offset), size.Y) |
583 | sector.Label.BackgroundTransparency = 1 |
584 | sector.Label.BorderSizePixel = 0 |
585 | sector.Label.ZIndex = 6 |
586 | sector.Label.Text = sector.name |
587 | sector.Label.TextColor3 = Color3.new(1,1,2552/255) |
588 | sector.Label.TextStrokeTransparency = 1 |
589 | sector.Label.Font = window.theme.font |
590 | sector.Label.TextSize = 15 |
591 | updateevent.Event:Connect(function(theme) |
592 | local size = textservice:GetTextSize(sector.name, 15, theme.font, Vector2.new(2000, 2000)) |
593 | sector.Label.Size = UDim2.fromOffset(math.clamp(textservice:GetTextSize(sector.name, 15, theme.font, Vector2.new(200,300)).X + 13, 0, sector.Main.Size.X.Offset), size.Y) |
594 | sector.Label.Font = theme.font |
595 | end) |
596 | |
597 | sector.LabelBackFrame = Instance.new("Frame", sector.Main) |
598 | sector.LabelBackFrame.Name = "labelframe" |
599 | sector.LabelBackFrame.ZIndex = 5 |
600 | sector.LabelBackFrame.Size = UDim2.fromOffset(sector.Label.Size.X.Offset, 10) |
601 | sector.LabelBackFrame.BorderSizePixel = 0 |
602 | sector.LabelBackFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) |
603 | sector.LabelBackFrame.Position = UDim2.fromOffset(sector.Label.Position.X.Offset, sector.BlackOutline2.Position.Y.Offset) |
604 | |
605 | sector.Items = Instance.new("Frame", sector.Main) |
606 | sector.Items.Name = "items" |
607 | sector.Items.ZIndex = 2 |
608 | sector.Items.BackgroundTransparency = 1 |
609 | sector.Items.Size = UDim2.fromOffset(170, 140) |
610 | sector.Items.AutomaticSize = Enum.AutomaticSize.Y |
611 | sector.Items.BorderSizePixel = 0 |
612 | |
613 | sector.ListLayout = Instance.new("UIListLayout", sector.Items) |
614 | sector.ListLayout.FillDirection = Enum.FillDirection.Vertical |
615 | sector.ListLayout.SortOrder = Enum.SortOrder.LayoutOrder |
616 | sector.ListLayout.Padding = UDim.new(0, 12) |
617 | |
618 | sector.ListPadding = Instance.new("UIPadding", sector.Items) |
619 | sector.ListPadding.PaddingTop = UDim.new(0, 15) |
620 | sector.ListPadding.PaddingLeft = UDim.new(0, 6) |
621 | sector.ListPadding.PaddingRight = UDim.new(0, 6) |
622 | |
623 | table.insert(sector.side:lower() == "left" and tab.SectorsLeft or tab.SectorsRight, sector) |
624 | |
625 | function sector:FixSize() |
626 | sector.Main.Size = UDim2.fromOffset(window.size.X.Offset / 2 - 17, sector.ListLayout.AbsoluteContentSize.Y + 22) |
627 | local sizeleft, sizeright = 0, 0 |
628 | for i,v in pairs(tab.SectorsLeft) do |
629 | sizeleft = sizeleft + v.Main.AbsoluteSize.Y |
630 | end |
631 | for i,v in pairs(tab.SectorsRight) do |
632 | sizeright = sizeright + v.Main.AbsoluteSize.Y |
633 | end |
634 | |
635 | tab.Left.CanvasSize = UDim2.fromOffset(tab.Left.AbsoluteSize.X, sizeleft + ((#tab.SectorsLeft - 1) * tab.LeftListPadding.PaddingTop.Offset) + 20) |
636 | tab.Right.CanvasSize = UDim2.fromOffset(tab.Right.AbsoluteSize.X, sizeright + ((#tab.SectorsRight - 1) * tab.RightListPadding.PaddingTop.Offset) + 20) |
637 | end |
638 | |
639 | function sector:AddButton(text, callback) |
640 | local button = { } |
641 | button.text = text or "" |
642 | button.callback = callback or function() end |
643 | |
644 | button.Main = Instance.new("TextButton", sector.Items) |
645 | button.Main.BorderSizePixel = 0 |
646 | button.Main.Text = "" |
647 | button.Main.AutoButtonColor = false |
648 | button.Main.Name = "button" |
649 | button.Main.ZIndex = 5 |
650 | button.Main.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 12, 14) |
651 | button.Main.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
652 | |
653 | button.Gradient = Instance.new("UIGradient", button.Main) |
654 | button.Gradient.Rotation = 90 |
655 | button.Gradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, window.theme.buttoncolor), ColorSequenceKeypoint.new(1.00, window.theme.buttoncolor2) }) |
656 | updateevent.Event:Connect(function(theme) |
657 | button.Gradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, theme.buttoncolor), ColorSequenceKeypoint.new(1.00, theme.buttoncolor2) }) |
658 | end) |
659 | |
660 | button.BlackOutline2 = Instance.new("Frame", button.Main) |
661 | button.BlackOutline2.Name = "blackline" |
662 | button.BlackOutline2.ZIndex = 4 |
663 | button.BlackOutline2.Size = button.Main.Size + UDim2.fromOffset(6, 6) |
664 | button.BlackOutline2.BorderSizePixel = 0 |
665 | button.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
666 | button.BlackOutline2.Position = UDim2.fromOffset(-3, -3) |
667 | updateevent.Event:Connect(function(theme) |
668 | button.BlackOutline2.BackgroundColor3 = theme.outlinecolor2 |
669 | end) |
670 | |
671 | button.Outline = Instance.new("Frame", button.Main) |
672 | button.Outline.Name = "blackline" |
673 | button.Outline.ZIndex = 4 |
674 | button.Outline.Size = button.Main.Size + UDim2.fromOffset(4, 4) |
675 | button.Outline.BorderSizePixel = 0 |
676 | button.Outline.BackgroundColor3 = window.theme.outlinecolor |
677 | button.Outline.Position = UDim2.fromOffset(-2, -2) |
678 | updateevent.Event:Connect(function(theme) |
679 | button.Outline.BackgroundColor3 = theme.outlinecolor |
680 | end) |
681 | |
682 | button.BlackOutline = Instance.new("Frame", button.Main) |
683 | button.BlackOutline.Name = "blackline" |
684 | button.BlackOutline.ZIndex = 4 |
685 | button.BlackOutline.Size = button.Main.Size + UDim2.fromOffset(2, 2) |
686 | button.BlackOutline.BorderSizePixel = 0 |
687 | button.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2 |
688 | button.BlackOutline.Position = UDim2.fromOffset(-1, -1) |
689 | updateevent.Event:Connect(function(theme) |
690 | button.BlackOutline.BackgroundColor3 = theme.outlinecolor2 |
691 | end) |
692 | |
693 | button.Label = Instance.new("TextLabel", button.Main) |
694 | button.Label.Name = "Label" |
695 | button.Label.BackgroundTransparency = 1 |
696 | button.Label.Position = UDim2.new(0, -1, 0, 0) |
697 | button.Label.ZIndex = 5 |
698 | button.Label.Size = button.Main.Size |
699 | button.Label.Font = window.theme.font |
700 | button.Label.Text = button.text |
701 | button.Label.TextColor3 = window.theme.itemscolor2 |
702 | button.Label.TextSize = 15 |
703 | button.Label.TextStrokeTransparency = 1 |
704 | button.Label.TextXAlignment = Enum.TextXAlignment.Center |
705 | button.Main.MouseButton1Down:Connect(button.callback) |
706 | updateevent.Event:Connect(function(theme) |
707 | button.Label.Font = theme.font |
708 | button.Label.TextColor3 = theme.itemscolor |
709 | end) |
710 | |
711 | button.BlackOutline2.MouseEnter:Connect(function() |
712 | button.BlackOutline2.BackgroundColor3 = window.theme.accentcolor |
713 | end) |
714 | |
715 | button.BlackOutline2.MouseLeave:Connect(function() |
716 | button.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
717 | end) |
718 | |
719 | sector:FixSize() |
720 | return button |
721 | end |
722 | |
723 | function sector:AddLabel(text) |
724 | local label = { } |
725 | |
726 | label.Main = Instance.new("TextLabel", sector.Items) |
727 | label.Main.Name = "Label" |
728 | label.Main.BackgroundTransparency = 1 |
729 | label.Main.Position = UDim2.new(0, -1, 0, 0) |
730 | label.Main.ZIndex = 4 |
731 | label.Main.AutomaticSize = Enum.AutomaticSize.XY |
732 | label.Main.Font = window.theme.font |
733 | label.Main.Text = text |
734 | label.Main.TextColor3 = window.theme.itemscolor |
735 | label.Main.TextSize = 15 |
736 | label.Main.TextStrokeTransparency = 1 |
737 | label.Main.TextXAlignment = Enum.TextXAlignment.Left |
738 | updateevent.Event:Connect(function(theme) |
739 | label.Main.Font = theme.font |
740 | label.Main.TextColor3 = theme.itemscolor |
741 | end) |
742 | |
743 | function label:Set(value) |
744 | label.Main.Text = value |
745 | end |
746 | |
747 | sector:FixSize() |
748 | return label |
749 | end |
750 | |
751 | function sector:AddToggle(text, default, callback, flag) |
752 | local toggle = { } |
753 | toggle.text = text or "" |
754 | toggle.default = default or false |
755 | toggle.callback = callback or function(value) end |
756 | toggle.flag = flag or text or "" |
757 | |
758 | toggle.value = toggle.default |
759 | |
760 | toggle.Main = Instance.new("TextButton", sector.Items) |
761 | toggle.Main.Name = "toggle" |
762 | toggle.Main.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
763 | toggle.Main.BorderColor3 = window.theme.outlinecolor |
764 | toggle.Main.BorderSizePixel = 0 |
765 | toggle.Main.Size = UDim2.fromOffset(8, 8) |
766 | toggle.Main.AutoButtonColor = false |
767 | toggle.Main.ZIndex = 5 |
768 | toggle.Main.Font = Enum.Font.SourceSans |
769 | toggle.Main.Text = "" |
770 | toggle.Main.TextColor3 = Color3.fromRGB(0, 0, 0) |
771 | toggle.Main.TextSize = 15 |
772 | updateevent.Event:Connect(function(theme) |
773 | toggle.Main.BorderColor3 = theme.outlinecolor |
774 | end) |
775 | |
776 | toggle.BlackOutline2 = Instance.new("Frame", toggle.Main) |
777 | toggle.BlackOutline2.Name = "blackline" |
778 | toggle.BlackOutline2.ZIndex = 4 |
779 | toggle.BlackOutline2.Size = toggle.Main.Size + UDim2.fromOffset(6, 6) |
780 | toggle.BlackOutline2.BorderSizePixel = 0 |
781 | toggle.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
782 | toggle.BlackOutline2.Position = UDim2.fromOffset(-3, -3) |
783 | updateevent.Event:Connect(function(theme) |
784 | toggle.BlackOutline2.BackgroundColor3 = theme.outlinecolor2 |
785 | end) |
786 | |
787 | toggle.Outline = Instance.new("Frame", toggle.Main) |
788 | toggle.Outline.Name = "blackline" |
789 | toggle.Outline.ZIndex = 4 |
790 | toggle.Outline.Size = toggle.Main.Size + UDim2.fromOffset(4, 4) |
791 | toggle.Outline.BorderSizePixel = 0 |
792 | toggle.Outline.BackgroundColor3 = window.theme.outlinecolor |
793 | toggle.Outline.Position = UDim2.fromOffset(-2, -2) |
794 | updateevent.Event:Connect(function(theme) |
795 | toggle.Outline.BackgroundColor3 = theme.outlinecolor |
796 | end) |
797 | |
798 | toggle.BlackOutline = Instance.new("Frame", toggle.Main) |
799 | toggle.BlackOutline.Name = "blackline" |
800 | toggle.BlackOutline.ZIndex = 4 |
801 | toggle.BlackOutline.Size = toggle.Main.Size + UDim2.fromOffset(2, 2) |
802 | toggle.BlackOutline.BorderSizePixel = 0 |
803 | toggle.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2 |
804 | toggle.BlackOutline.Position = UDim2.fromOffset(-1, -1) |
805 | updateevent.Event:Connect(function(theme) |
806 | toggle.BlackOutline.BackgroundColor3 = theme.outlinecolor2 |
807 | end) |
808 | |
809 | toggle.Gradient = Instance.new("UIGradient", toggle.Main) |
810 | toggle.Gradient.Rotation = (22.5 * 13) |
811 | toggle.Gradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, Color3.fromRGB(30, 30, 30)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(45, 45, 45)) }) |
812 | |
813 | toggle.Label = Instance.new("TextButton", toggle.Main) |
814 | toggle.Label.Name = "Label" |
815 | toggle.Label.AutoButtonColor = false |
816 | toggle.Label.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
817 | toggle.Label.BackgroundTransparency = 1 |
818 | toggle.Label.Position = UDim2.fromOffset(toggle.Main.AbsoluteSize.X + 10, -2) |
819 | toggle.Label.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 71, toggle.BlackOutline.Size.Y.Offset) |
820 | toggle.Label.Font = window.theme.font |
821 | toggle.Label.ZIndex = 5 |
822 | toggle.Label.Text = toggle.text |
823 | toggle.Label.TextColor3 = window.theme.itemscolor |
824 | toggle.Label.TextSize = 15 |
825 | toggle.Label.TextStrokeTransparency = 1 |
826 | toggle.Label.TextXAlignment = Enum.TextXAlignment.Left |
827 | updateevent.Event:Connect(function(theme) |
828 | toggle.Label.Font = theme.font |
829 | toggle.Label.TextColor3 = toggle.value and window.theme.itemscolor2 or theme.itemscolor |
830 | end) |
831 | |
832 | toggle.CheckedFrame = Instance.new("Frame", toggle.Main) |
833 | toggle.CheckedFrame.ZIndex = 5 |
834 | toggle.CheckedFrame.BorderSizePixel = 0 |
835 | toggle.CheckedFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- Color3.fromRGB(204, 0, 102) |
836 | toggle.CheckedFrame.Size = toggle.Main.Size |
837 | |
838 | toggle.Gradient2 = Instance.new("UIGradient", toggle.CheckedFrame) |
839 | toggle.Gradient2.Rotation = (22.5 * 13) |
840 | toggle.Gradient2.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, window.theme.accentcolor2), ColorSequenceKeypoint.new(1.00, window.theme.accentcolor) }) |
841 | updateevent.Event:Connect(function(theme) |
842 | toggle.Gradient2.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, theme.accentcolor2), ColorSequenceKeypoint.new(1.00, theme.accentcolor) }) |
843 | end) |
844 | |
845 | toggle.Items = Instance.new("Frame", toggle.Main) |
846 | toggle.Items.Name = "\n" |
847 | toggle.Items.ZIndex = 4 |
848 | toggle.Items.Size = UDim2.fromOffset(60, toggle.BlackOutline.AbsoluteSize.Y) |
849 | toggle.Items.BorderSizePixel = 0 |
850 | toggle.Items.BackgroundTransparency = 1 |
851 | toggle.Items.BackgroundColor3 = Color3.new(0, 0, 0) |
852 | toggle.Items.Position = UDim2.fromOffset(sector.Main.Size.X.Offset - 71, 0) |
853 | |
854 | toggle.ListLayout = Instance.new("UIListLayout", toggle.Items) |
855 | toggle.ListLayout.FillDirection = Enum.FillDirection.Horizontal |
856 | toggle.ListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Right |
857 | toggle.ListLayout.SortOrder = Enum.SortOrder.LayoutOrder |
858 | toggle.ListLayout.Padding = UDim.new(0.04, 6) |
859 | |
860 | if toggle.flag and toggle.flag ~= "" then |
861 | library.flags[toggle.flag] = toggle.default or false |
862 | end |
863 | |
864 | function toggle:Set(value) |
865 | if value then |
866 | toggle.Label.TextColor3 = window.theme.itemscolor2 |
867 | else |
868 | toggle.Label.TextColor3 = window.theme.itemscolor |
869 | end |
870 | |
871 | toggle.value = value |
872 | toggle.CheckedFrame.Visible = value |
873 | if toggle.flag and toggle.flag ~= "" then |
874 | library.flags[toggle.flag] = toggle.value |
875 | end |
876 | pcall(toggle.callback, value) |
877 | end |
878 | function toggle:Get() |
879 | return toggle.value |
880 | end |
881 | toggle:Set(toggle.default) |
882 | |
883 | function toggle:AddKeybind(default, flag) |
884 | local keybind = { } |
885 | |
886 | keybind.default = default or "None" |
887 | keybind.value = keybind.default |
888 | keybind.flag = flag or ( (toggle.text or "") .. tostring(#toggle.Items:GetChildren())) |
889 | |
890 | local shorter_keycodes = { |
891 | ["LeftShift"] = "LSHIFT", |
892 | ["RightShift"] = "RSHIFT", |
893 | ["LeftControl"] = "LCTRL", |
894 | ["RightControl"] = "RCTRL", |
895 | ["LeftAlt"] = "LALT", |
896 | ["RightAlt"] = "RALT" |
897 | } |
898 | |
899 | local text = keybind.default == "None" and "[None]" or "[" .. (shorter_keycodes[keybind.default.Name] or keybind.default.Name) .. "]" |
900 | local size = textservice:GetTextSize(text, 15, window.theme.font, Vector2.new(2000, 2000)) |
901 | |
902 | keybind.Main = Instance.new("TextButton", toggle.Items) |
903 | keybind.Main.Name = "keybind" |
904 | keybind.Main.BackgroundTransparency = 1 |
905 | keybind.Main.BorderSizePixel = 0 |
906 | keybind.Main.ZIndex = 5 |
907 | keybind.Main.Size = UDim2.fromOffset(size.X + 2, size.Y - 7) |
908 | keybind.Main.Text = text |
909 | keybind.Main.Font = window.theme.font |
910 | keybind.Main.TextColor3 = Color3.fromRGB(136, 136, 136) |
911 | keybind.Main.TextSize = 15 |
912 | keybind.Main.TextXAlignment = Enum.TextXAlignment.Right |
913 | keybind.Main.MouseButton1Down:Connect(function() |
914 | keybind.Main.Text = "[...]" |
915 | keybind.Main.TextColor3 = window.theme.accentcolor |
916 | end) |
917 | updateevent.Event:Connect(function(theme) |
918 | keybind.Main.Font = theme.font |
919 | if keybind.Main.Text == "[...]" then |
920 | keybind.Main.TextColor3 = theme.accentcolor |
921 | else |
922 | keybind.Main.TextColor3 = Color3.fromRGB(136, 136, 136) |
923 | end |
924 | end) |
925 | |
926 | if keybind.flag and keybind.flag ~= "" then |
927 | library.flags[keybind.flag] = keybind.default |
928 | end |
929 | function keybind:Set(key) |
930 | if key == "None" then |
931 | keybind.Main.Text = "[" .. key .. "]" |
932 | keybind.value = key |
933 | if keybind.flag and keybind.flag ~= "" then |
934 | library.flags[keybind.flag] = key |
935 | end |
936 | end |
937 | keybind.Main.Text = "[" .. (shorter_keycodes[key.Name] or key.Name) .. "]" |
938 | keybind.value = key |
939 | if keybind.flag and keybind.flag ~= "" then |
940 | library.flags[keybind.flag] = keybind.value |
941 | end |
942 | end |
943 | |
944 | function keybind:Get() |
945 | return keybind.value |
946 | end |
947 | |
948 | uis.InputBegan:Connect(function(input, gameProcessed) |
949 | if not gameProcessed then |
950 | if keybind.Main.Text == "[...]" then |
951 | keybind.Main.TextColor3 = Color3.fromRGB(136, 136, 136) |
952 | if input.UserInputType == Enum.UserInputType.Keyboard then |
953 | keybind:Set(input.KeyCode) |
954 | else |
955 | keybind:Set("None") |
956 | end |
957 | else |
958 | if keybind.value ~= "None" and input.KeyCode == keybind.value then |
959 | toggle:Set(not toggle.CheckedFrame.Visible) |
960 | end |
961 | end |
962 | end |
963 | end) |
964 | |
965 | table.insert(library.items, keybind) |
966 | return keybind |
967 | end |
968 | |
969 | function toggle:AddDropdown(items, default, multichoice, callback, flag) |
970 | local dropdown = { } |
971 | |
972 | dropdown.defaultitems = items or { } |
973 | dropdown.default = default |
974 | dropdown.callback = callback or function() end |
975 | dropdown.multichoice = multichoice or false |
976 | dropdown.values = { } |
977 | dropdown.flag = flag or ( (toggle.text or "") .. tostring(#(sector.Items:GetChildren())) .. "a") |
978 | |
979 | dropdown.Main = Instance.new("TextButton", sector.Items) |
980 | dropdown.Main.Name = "dropdown" |
981 | dropdown.Main.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
982 | dropdown.Main.BorderSizePixel = 0 |
983 | dropdown.Main.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 12, 16) |
984 | dropdown.Main.Position = UDim2.fromOffset(0, 0) |
985 | dropdown.Main.ZIndex = 5 |
986 | dropdown.Main.AutoButtonColor = false |
987 | dropdown.Main.Font = window.theme.font |
988 | dropdown.Main.Text = "" |
989 | dropdown.Main.TextColor3 = Color3.fromRGB(255, 255, 255) |
990 | dropdown.Main.TextSize = 15 |
991 | dropdown.Main.TextXAlignment = Enum.TextXAlignment.Left |
992 | updateevent.Event:Connect(function(theme) |
993 | dropdown.Main.Font = theme.font |
994 | end) |
995 | |
996 | dropdown.Gradient = Instance.new("UIGradient", dropdown.Main) |
997 | dropdown.Gradient.Rotation = 90 |
998 | dropdown.Gradient.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(49, 49, 49)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(39, 39, 39))} |
999 | |
1000 | dropdown.SelectedLabel = Instance.new("TextLabel", dropdown.Main) |
1001 | dropdown.SelectedLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
1002 | dropdown.SelectedLabel.BackgroundTransparency = 1 |
1003 | dropdown.SelectedLabel.Position = UDim2.fromOffset(5, 2) |
1004 | dropdown.SelectedLabel.Size = UDim2.fromOffset(130, 13) |
1005 | dropdown.SelectedLabel.Font = window.theme.font |
1006 | dropdown.SelectedLabel.Text = toggle.text |
1007 | dropdown.SelectedLabel.ZIndex = 5 |
1008 | dropdown.SelectedLabel.TextColor3 = Color3.fromRGB(255, 255, 255) |
1009 | dropdown.SelectedLabel.TextSize = 15 |
1010 | dropdown.SelectedLabel.TextStrokeTransparency = 1 |
1011 | dropdown.SelectedLabel.TextXAlignment = Enum.TextXAlignment.Left |
1012 | updateevent.Event:Connect(function(theme) |
1013 | dropdown.SelectedLabel.Font = theme.font |
1014 | end) |
1015 | |
1016 | dropdown.Nav = Instance.new("ImageButton", dropdown.Main) |
1017 | dropdown.Nav.Name = "navigation" |
1018 | dropdown.Nav.BackgroundTransparency = 1 |
1019 | dropdown.Nav.LayoutOrder = 10 |
1020 | dropdown.Nav.Position = UDim2.fromOffset(sector.Main.Size.X.Offset - 26, 5) |
1021 | dropdown.Nav.Rotation = 90 |
1022 | dropdown.Nav.ZIndex = 5 |
1023 | dropdown.Nav.Size = UDim2.fromOffset(8, 8) |
1024 | dropdown.Nav.Image = "rbxassetid://4918373417" |
1025 | dropdown.Nav.ImageColor3 = Color3.fromRGB(210, 210, 210) |
1026 | |
1027 | dropdown.BlackOutline2 = Instance.new("Frame", dropdown.Main) |
1028 | dropdown.BlackOutline2.Name = "blackline" |
1029 | dropdown.BlackOutline2.ZIndex = 4 |
1030 | dropdown.BlackOutline2.Size = dropdown.Main.Size + UDim2.fromOffset(6, 6) |
1031 | dropdown.BlackOutline2.BorderSizePixel = 0 |
1032 | dropdown.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
1033 | dropdown.BlackOutline2.Position = UDim2.fromOffset(-3, -3) |
1034 | updateevent.Event:Connect(function(theme) |
1035 | dropdown.BlackOutline2.BackgroundColor3 = theme.outlinecolor2 |
1036 | end) |
1037 | |
1038 | dropdown.Outline = Instance.new("Frame", dropdown.Main) |
1039 | dropdown.Outline.Name = "blackline" |
1040 | dropdown.Outline.ZIndex = 4 |
1041 | dropdown.Outline.Size = dropdown.Main.Size + UDim2.fromOffset(4, 4) |
1042 | dropdown.Outline.BorderSizePixel = 0 |
1043 | dropdown.Outline.BackgroundColor3 = window.theme.outlinecolor |
1044 | dropdown.Outline.Position = UDim2.fromOffset(-2, -2) |
1045 | updateevent.Event:Connect(function(theme) |
1046 | dropdown.Outline.BackgroundColor3 = theme.outlinecolor |
1047 | end) |
1048 | |
1049 | dropdown.BlackOutline = Instance.new("Frame", dropdown.Main) |
1050 | dropdown.BlackOutline.Name = "blackline444" |
1051 | dropdown.BlackOutline.ZIndex = 4 |
1052 | dropdown.BlackOutline.Size = dropdown.Main.Size + UDim2.fromOffset(2, 2) |
1053 | dropdown.BlackOutline.BorderSizePixel = 0 |
1054 | dropdown.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2 |
1055 | dropdown.BlackOutline.Position = UDim2.fromOffset(-1, -1) |
1056 | updateevent.Event:Connect(function(theme) |
1057 | dropdown.BlackOutline.BackgroundColor3 = theme.outlinecolor2 |
1058 | end) |
1059 | |
1060 | dropdown.ItemsFrame = Instance.new("ScrollingFrame", dropdown.Main) |
1061 | dropdown.ItemsFrame.Name = "itemsframe" |
1062 | dropdown.ItemsFrame.BorderSizePixel = 0 |
1063 | dropdown.ItemsFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40) |
1064 | dropdown.ItemsFrame.Position = UDim2.fromOffset(0, dropdown.Main.Size.Y.Offset + 8) |
1065 | dropdown.ItemsFrame.ScrollBarThickness = 2 |
1066 | dropdown.ItemsFrame.ZIndex = 8 |
1067 | dropdown.ItemsFrame.ScrollingDirection = "Y" |
1068 | dropdown.ItemsFrame.Visible = false |
1069 | dropdown.ItemsFrame.Size = UDim2.new(0, 0, 0, 0) |
1070 | dropdown.ItemsFrame.CanvasSize = UDim2.fromOffset(dropdown.Main.AbsoluteSize.X, 0) |
1071 | |
1072 | dropdown.ListLayout = Instance.new("UIListLayout", dropdown.ItemsFrame) |
1073 | dropdown.ListLayout.FillDirection = Enum.FillDirection.Vertical |
1074 | dropdown.ListLayout.SortOrder = Enum.SortOrder.LayoutOrder |
1075 | |
1076 | dropdown.ListPadding = Instance.new("UIPadding", dropdown.ItemsFrame) |
1077 | dropdown.ListPadding.PaddingTop = UDim.new(0, 2) |
1078 | dropdown.ListPadding.PaddingBottom = UDim.new(0, 2) |
1079 | dropdown.ListPadding.PaddingLeft = UDim.new(0, 2) |
1080 | dropdown.ListPadding.PaddingRight = UDim.new(0, 2) |
1081 | |
1082 | dropdown.BlackOutline2Items = Instance.new("Frame", dropdown.Main) |
1083 | dropdown.BlackOutline2Items.Name = "blackline3" |
1084 | dropdown.BlackOutline2Items.ZIndex = 7 |
1085 | dropdown.BlackOutline2Items.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(6, 6) |
1086 | dropdown.BlackOutline2Items.BorderSizePixel = 0 |
1087 | dropdown.BlackOutline2Items.BackgroundColor3 = window.theme.outlinecolor2 |
1088 | dropdown.BlackOutline2Items.Position = dropdown.ItemsFrame.Position + UDim2.fromOffset(-3, -3) |
1089 | dropdown.BlackOutline2Items.Visible = false |
1090 | updateevent.Event:Connect(function(theme) |
1091 | dropdown.BlackOutline2Items.BackgroundColor3 = theme.outlinecolor2 |
1092 | end) |
1093 | |
1094 | dropdown.OutlineItems = Instance.new("Frame", dropdown.Main) |
1095 | dropdown.OutlineItems.Name = "blackline8" |
1096 | dropdown.OutlineItems.ZIndex = 7 |
1097 | dropdown.OutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(4, 4) |
1098 | dropdown.OutlineItems.BorderSizePixel = 0 |
1099 | dropdown.OutlineItems.BackgroundColor3 = window.theme.outlinecolor |
1100 | dropdown.OutlineItems.Position = dropdown.ItemsFrame.Position + UDim2.fromOffset(-2, -2) |
1101 | dropdown.OutlineItems.Visible = false |
1102 | updateevent.Event:Connect(function(theme) |
1103 | dropdown.OutlineItems.BackgroundColor3 = theme.outlinecolor |
1104 | end) |
1105 | |
1106 | dropdown.BlackOutlineItems = Instance.new("Frame", dropdown.Main) |
1107 | dropdown.BlackOutlineItems.Name = "blackline3" |
1108 | dropdown.BlackOutlineItems.ZIndex = 7 |
1109 | dropdown.BlackOutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(-2, -2) |
1110 | dropdown.BlackOutlineItems.BorderSizePixel = 0 |
1111 | dropdown.BlackOutlineItems.BackgroundColor3 = window.theme.outlinecolor2 |
1112 | dropdown.BlackOutlineItems.Position = dropdown.ItemsFrame.Position + UDim2.fromOffset(-1, -1) |
1113 | dropdown.BlackOutlineItems.Visible = false |
1114 | updateevent.Event:Connect(function(theme) |
1115 | dropdown.BlackOutlineItems.BackgroundColor3 = theme.outlinecolor2 |
1116 | end) |
1117 | |
1118 | dropdown.IgnoreBackButtons = Instance.new("TextButton", dropdown.Main) |
1119 | dropdown.IgnoreBackButtons.BackgroundTransparency = 1 |
1120 | dropdown.IgnoreBackButtons.BorderSizePixel = 0 |
1121 | dropdown.IgnoreBackButtons.Position = UDim2.fromOffset(0, dropdown.Main.Size.Y.Offset + 8) |
1122 | dropdown.IgnoreBackButtons.Size = UDim2.new(0, 0, 0, 0) |
1123 | dropdown.IgnoreBackButtons.ZIndex = 7 |
1124 | dropdown.IgnoreBackButtons.Text = "" |
1125 | dropdown.IgnoreBackButtons.Visible = false |
1126 | dropdown.IgnoreBackButtons.AutoButtonColor = false |
1127 | |
1128 | if dropdown.flag and dropdown.flag ~= "" then |
1129 | library.flags[dropdown.flag] = dropdown.multichoice and { dropdown.default or dropdown.defaultitems[1] or "" } or (dropdown.default or dropdown.defaultitems[1] or "") |
1130 | end |
1131 | |
1132 | function dropdown:isSelected(item) |
1133 | for i, v in pairs(dropdown.values) do |
1134 | if v == item then |
1135 | return true |
1136 | end |
1137 | end |
1138 | return false |
1139 | end |
1140 | |
1141 | function dropdown:updateText(text) |
1142 | if #text >= 27 then |
1143 | text = text:sub(1, 25) .. ".." |
1144 | end |
1145 | dropdown.SelectedLabel.Text = text |
1146 | end |
1147 | |
1148 | dropdown.Changed = Instance.new("BindableEvent") |
1149 | function dropdown:Set(value) |
1150 | if type(value) == "table" then |
1151 | dropdown.values = value |
1152 | dropdown:updateText(table.concat(value, ", ")) |
1153 | pcall(dropdown.callback, value) |
1154 | else |
1155 | dropdown:updateText(value) |
1156 | dropdown.values = { value } |
1157 | pcall(dropdown.callback, value) |
1158 | end |
1159 | |
1160 | dropdown.Changed:Fire(value) |
1161 | if dropdown.flag and dropdown.flag ~= "" then |
1162 | library.flags[dropdown.flag] = dropdown.multichoice and dropdown.values or dropdown.values[1] |
1163 | end |
1164 | end |
1165 | |
1166 | function dropdown:Get() |
1167 | return dropdown.multichoice and dropdown.values or dropdown.values[1] |
1168 | end |
1169 | |
1170 | dropdown.items = { } |
1171 | function dropdown:Add(v) |
1172 | local Item = Instance.new("TextButton", dropdown.ItemsFrame) |
1173 | Item.BackgroundColor3 = Color3.fromRGB(40, 40, 40) |
1174 | Item.TextColor3 = Color3.fromRGB(255, 255, 255) |
1175 | Item.BorderSizePixel = 0 |
1176 | Item.Position = UDim2.fromOffset(0, 0) |
1177 | Item.Size = UDim2.fromOffset(dropdown.Main.Size.X.Offset - 4, 20) |
1178 | Item.ZIndex = 9 |
1179 | Item.Text = v |
1180 | Item.Name = v |
1181 | Item.AutoButtonColor = false |
1182 | Item.Font = window.theme.font |
1183 | Item.TextSize = 15 |
1184 | Item.TextXAlignment = Enum.TextXAlignment.Left |
1185 | Item.TextStrokeTransparency = 1 |
1186 | dropdown.ItemsFrame.CanvasSize = dropdown.ItemsFrame.CanvasSize + UDim2.fromOffset(0, Item.AbsoluteSize.Y) |
1187 | |
1188 | Item.MouseButton1Down:Connect(function() |
1189 | if dropdown.multichoice then |
1190 | if dropdown:isSelected(v) then |
1191 | for i2, v2 in pairs(dropdown.values) do |
1192 | if v2 == v then |
1193 | table.remove(dropdown.values, i2) |
1194 | end |
1195 | end |
1196 | dropdown:Set(dropdown.values) |
1197 | else |
1198 | table.insert(dropdown.values, v) |
1199 | dropdown:Set(dropdown.values) |
1200 | end |
1201 | |
1202 | return |
1203 | else |
1204 | dropdown.Nav.Rotation = 90 |
1205 | dropdown.ItemsFrame.Visible = false |
1206 | dropdown.ItemsFrame.Active = false |
1207 | dropdown.OutlineItems.Visible = false |
1208 | dropdown.BlackOutlineItems.Visible = false |
1209 | dropdown.BlackOutline2Items.Visible = false |
1210 | dropdown.IgnoreBackButtons.Visible = false |
1211 | dropdown.IgnoreBackButtons.Active = false |
1212 | end |
1213 | |
1214 | dropdown:Set(v) |
1215 | return |
1216 | end) |
1217 | |
1218 | runservice.RenderStepped:Connect(function() |
1219 | if dropdown.multichoice and dropdown:isSelected(v) or dropdown.values[1] == v then |
1220 | Item.BackgroundColor3 = Color3.fromRGB(64, 64, 64) |
1221 | Item.TextColor3 = window.theme.accentcolor |
1222 | Item.Text = " " .. v |
1223 | else |
1224 | Item.BackgroundColor3 = Color3.fromRGB(40, 40, 40) |
1225 | Item.TextColor3 = Color3.fromRGB(255, 255, 255) |
1226 | Item.Text = v |
1227 | end |
1228 | end) |
1229 | |
1230 | table.insert(dropdown.items, v) |
1231 | dropdown.ItemsFrame.Size = UDim2.fromOffset(dropdown.Main.Size.X.Offset, math.clamp(#dropdown.items * Item.AbsoluteSize.Y, 20, 156) + 4) |
1232 | dropdown.ItemsFrame.CanvasSize = UDim2.fromOffset(dropdown.ItemsFrame.AbsoluteSize.X, (#dropdown.items * Item.AbsoluteSize.Y) + 4) |
1233 | |
1234 | dropdown.OutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(4, 4) |
1235 | dropdown.BlackOutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(2, 2) |
1236 | dropdown.BlackOutline2Items.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(6, 6) |
1237 | dropdown.IgnoreBackButtons.Size = dropdown.ItemsFrame.Size |
1238 | end |
1239 | |
1240 | function dropdown:Remove(value) |
1241 | local item = dropdown.ItemsFrame:FindFirstChild(value) |
1242 | if item then |
1243 | for i,v in pairs(dropdown.items) do |
1244 | if v == value then |
1245 | table.remove(dropdown.items, i) |
1246 | end |
1247 | end |
1248 | |
1249 | dropdown.ItemsFrame.Size = UDim2.fromOffset(dropdown.Main.Size.X.Offset, math.clamp(#dropdown.items * item.AbsoluteSize.Y, 20, 156) + 4) |
1250 | dropdown.ItemsFrame.CanvasSize = UDim2.fromOffset(dropdown.ItemsFrame.AbsoluteSize.X, (#dropdown.items * item.AbsoluteSize.Y) + 4) |
1251 | |
1252 | dropdown.OutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(2, 2) |
1253 | dropdown.BlackOutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(4, 4) |
1254 | dropdown.BlackOutline2Items.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(6, 6) |
1255 | dropdown.IgnoreBackButtons.Size = dropdown.ItemsFrame.Size |
1256 | |
1257 | item:Remove() |
1258 | end |
1259 | end |
1260 | |
1261 | for i,v in pairs(dropdown.defaultitems) do |
1262 | dropdown:Add(v) |
1263 | end |
1264 | |
1265 | if dropdown.default then |
1266 | dropdown:Set(dropdown.default) |
1267 | end |
1268 | |
1269 | local MouseButton1Down = function() |
1270 | if dropdown.Nav.Rotation == 90 then |
1271 | tweenservice:Create(dropdown.Nav, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { Rotation = -90 }):Play() |
1272 | if dropdown.items and #dropdown.items ~= 0 then |
1273 | dropdown.ItemsFrame.ScrollingEnabled = true |
1274 | sector.Main.Parent.ScrollingEnabled = false |
1275 | dropdown.ItemsFrame.Visible = true |
1276 | dropdown.ItemsFrame.Active = true |
1277 | dropdown.IgnoreBackButtons.Visible = true |
1278 | dropdown.IgnoreBackButtons.Active = true |
1279 | dropdown.OutlineItems.Visible = true |
1280 | dropdown.BlackOutlineItems.Visible = true |
1281 | dropdown.BlackOutline2Items.Visible = true |
1282 | end |
1283 | else |
1284 | tweenservice:Create(dropdown.Nav, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { Rotation = 90 }):Play() |
1285 | dropdown.ItemsFrame.ScrollingEnabled = false |
1286 | sector.Main.Parent.ScrollingEnabled = true |
1287 | dropdown.ItemsFrame.Visible = false |
1288 | dropdown.ItemsFrame.Active = false |
1289 | dropdown.IgnoreBackButtons.Visible = false |
1290 | dropdown.IgnoreBackButtons.Active = false |
1291 | dropdown.OutlineItems.Visible = false |
1292 | dropdown.BlackOutlineItems.Visible = false |
1293 | dropdown.BlackOutline2Items.Visible = false |
1294 | end |
1295 | end |
1296 | |
1297 | dropdown.Main.MouseButton1Down:Connect(MouseButton1Down) |
1298 | dropdown.Nav.MouseButton1Down:Connect(MouseButton1Down) |
1299 | |
1300 | dropdown.BlackOutline2.MouseEnter:Connect(function() |
1301 | dropdown.BlackOutline2.BackgroundColor3 = window.theme.accentcolor |
1302 | end) |
1303 | dropdown.BlackOutline2.MouseLeave:Connect(function() |
1304 | dropdown.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
1305 | end) |
1306 | |
1307 | sector:FixSize() |
1308 | table.insert(library.items, dropdown) |
1309 | return dropdown |
1310 | end |
1311 | |
1312 | function toggle:AddTextbox(default, callback, flag) |
1313 | local textbox = { } |
1314 | textbox.callback = callback or function() end |
1315 | textbox.default = default |
1316 | textbox.value = "" |
1317 | textbox.flag = flag or ( (toggle.text or "") .. tostring(#(sector.Items:GetChildren())) .. "a") |
1318 | |
1319 | textbox.Holder = Instance.new("Frame", sector.Items) |
1320 | textbox.Holder.Name = "holder" |
1321 | textbox.Holder.ZIndex = 5 |
1322 | textbox.Holder.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 12, 14) |
1323 | textbox.Holder.BorderSizePixel = 0 |
1324 | textbox.Holder.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
1325 | |
1326 | textbox.Gradient = Instance.new("UIGradient", textbox.Holder) |
1327 | textbox.Gradient.Rotation = 90 |
1328 | textbox.Gradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, Color3.fromRGB(49, 49, 49)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(39, 39, 39)) }) |
1329 | |
1330 | textbox.Main = Instance.new("TextBox", textbox.Holder) |
1331 | textbox.Main.PlaceholderText = "" |
1332 | textbox.Main.Text = "" |
1333 | textbox.Main.BackgroundTransparency = 1 |
1334 | textbox.Main.Font = window.theme.font |
1335 | textbox.Main.Name = "textbox" |
1336 | textbox.Main.MultiLine = false |
1337 | textbox.Main.ClearTextOnFocus = false |
1338 | textbox.Main.ZIndex = 5 |
1339 | textbox.Main.TextScaled = true |
1340 | textbox.Main.Size = textbox.Holder.Size |
1341 | textbox.Main.TextSize = 15 |
1342 | textbox.Main.TextColor3 = Color3.fromRGB(255, 255, 255) |
1343 | textbox.Main.BorderSizePixel = 0 |
1344 | textbox.Main.BackgroundColor3 = Color3.fromRGB(30, 30, 30) |
1345 | textbox.Main.TextXAlignment = Enum.TextXAlignment.Left |
1346 | |
1347 | if textbox.flag and textbox.flag ~= "" then |
1348 | library.flags[textbox.flag] = textbox.default or "" |
1349 | end |
1350 | |
1351 | function textbox:Set(text) |
1352 | textbox.value = text |
1353 | textbox.Main.Text = text |
1354 | if textbox.flag and textbox.flag ~= "" then |
1355 | library.flags[textbox.flag] = text |
1356 | end |
1357 | pcall(textbox.callback, text) |
1358 | end |
1359 | updateevent.Event:Connect(function(theme) |
1360 | textbox.Main.Font = theme.font |
1361 | end) |
1362 | |
1363 | function textbox:Get() |
1364 | return textbox.value |
1365 | end |
1366 | |
1367 | if textbox.default then |
1368 | textbox:Set(textbox.default) |
1369 | end |
1370 | |
1371 | textbox.Main.FocusLost:Connect(function() |
1372 | textbox:Set(textbox.Main.Text) |
1373 | end) |
1374 | |
1375 | textbox.BlackOutline2 = Instance.new("Frame", textbox.Main) |
1376 | textbox.BlackOutline2.Name = "blackline" |
1377 | textbox.BlackOutline2.ZIndex = 4 |
1378 | textbox.BlackOutline2.Size = textbox.Main.Size + UDim2.fromOffset(6, 6) |
1379 | textbox.BlackOutline2.BorderSizePixel = 0 |
1380 | textbox.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
1381 | textbox.BlackOutline2.Position = UDim2.fromOffset(-3, -3) |
1382 | updateevent.Event:Connect(function(theme) |
1383 | textbox.BlackOutline2.BackgroundColor3 = theme.outlinecolor2 |
1384 | end) |
1385 | |
1386 | textbox.Outline = Instance.new("Frame", textbox.Main) |
1387 | textbox.Outline.Name = "blackline" |
1388 | textbox.Outline.ZIndex = 4 |
1389 | textbox.Outline.Size = textbox.Main.Size + UDim2.fromOffset(4, 4) |
1390 | textbox.Outline.BorderSizePixel = 0 |
1391 | textbox.Outline.BackgroundColor3 = window.theme.outlinecolor |
1392 | textbox.Outline.Position = UDim2.fromOffset(-2, -2) |
1393 | updateevent.Event:Connect(function(theme) |
1394 | textbox.Outline.BackgroundColor3 = theme.outlinecolor |
1395 | end) |
1396 | |
1397 | textbox.BlackOutline = Instance.new("Frame", textbox.Main) |
1398 | textbox.BlackOutline.Name = "blackline" |
1399 | textbox.BlackOutline.ZIndex = 4 |
1400 | textbox.BlackOutline.Size = textbox.Main.Size + UDim2.fromOffset(2, 2) |
1401 | textbox.BlackOutline.BorderSizePixel = 0 |
1402 | textbox.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2 |
1403 | textbox.BlackOutline.Position = UDim2.fromOffset(-1, -1) |
1404 | updateevent.Event:Connect(function(theme) |
1405 | textbox.BlackOutline.BackgroundColor3 = theme.outlinecolor2 |
1406 | end) |
1407 | |
1408 | textbox.BlackOutline2.MouseEnter:Connect(function() |
1409 | textbox.BlackOutline2.BackgroundColor3 = window.theme.accentcolor |
1410 | end) |
1411 | textbox.BlackOutline2.MouseLeave:Connect(function() |
1412 | textbox.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
1413 | end) |
1414 | |
1415 | sector:FixSize() |
1416 | table.insert(library.items, textbox) |
1417 | return textbox |
1418 | end |
1419 | |
1420 | function toggle:AddColorpicker(default, callback, flag) |
1421 | local colorpicker = { } |
1422 | |
1423 | colorpicker.callback = callback or function() end |
1424 | colorpicker.default = default or Color3.fromRGB(255, 255, 255) |
1425 | colorpicker.value = colorpicker.default |
1426 | colorpicker.flag = flag or ( (toggle.text or "") .. tostring(#toggle.Items:GetChildren())) |
1427 | |
1428 | colorpicker.Main = Instance.new("Frame", toggle.Items) |
1429 | colorpicker.Main.ZIndex = 6 |
1430 | colorpicker.Main.BorderSizePixel = 0 |
1431 | colorpicker.Main.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
1432 | colorpicker.Main.Size = UDim2.fromOffset(16, 10) |
1433 | |
1434 | colorpicker.Gradient = Instance.new("UIGradient", colorpicker.Main) |
1435 | colorpicker.Gradient.Rotation = 90 |
1436 | |
1437 | local clr = Color3.new(math.clamp(colorpicker.value.R / 1.7, 0, 1), math.clamp(colorpicker.value.G / 1.7, 0, 1), math.clamp(colorpicker.value.B / 1.7, 0, 1)) |
1438 | colorpicker.Gradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, colorpicker.value), ColorSequenceKeypoint.new(1.00, clr) }) |
1439 | |
1440 | colorpicker.BlackOutline2 = Instance.new("Frame", colorpicker.Main) |
1441 | colorpicker.BlackOutline2.Name = "blackline" |
1442 | colorpicker.BlackOutline2.ZIndex = 4 |
1443 | colorpicker.BlackOutline2.Size = colorpicker.Main.Size + UDim2.fromOffset(6, 6) |
1444 | colorpicker.BlackOutline2.BorderSizePixel = 0 |
1445 | colorpicker.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
1446 | colorpicker.BlackOutline2.Position = UDim2.fromOffset(-3, -3) |
1447 | updateevent.Event:Connect(function(theme) |
1448 | if window.OpenedColorPickers[colorpicker.MainPicker] then |
1449 | colorpicker.BlackOutline2.BackgroundColor3 = theme.accentcolor |
1450 | else |
1451 | colorpicker.BlackOutline2.BackgroundColor3 = theme.outlinecolor2 |
1452 | end |
1453 | end) |
1454 | |
1455 | colorpicker.Outline = Instance.new("Frame", colorpicker.Main) |
1456 | colorpicker.Outline.Name = "blackline" |
1457 | colorpicker.Outline.ZIndex = 4 |
1458 | colorpicker.Outline.Size = colorpicker.Main.Size + UDim2.fromOffset(4, 4) |
1459 | colorpicker.Outline.BorderSizePixel = 0 |
1460 | colorpicker.Outline.BackgroundColor3 = window.theme.outlinecolor |
1461 | colorpicker.Outline.Position = UDim2.fromOffset(-2, -2) |
1462 | updateevent.Event:Connect(function(theme) |
1463 | colorpicker.Outline.BackgroundColor3 = theme.outlinecolor |
1464 | end) |
1465 | |
1466 | colorpicker.BlackOutline = Instance.new("Frame", colorpicker.Main) |
1467 | colorpicker.BlackOutline.Name = "blackline" |
1468 | colorpicker.BlackOutline.ZIndex = 4 |
1469 | colorpicker.BlackOutline.Size = colorpicker.Main.Size + UDim2.fromOffset(2, 2) |
1470 | colorpicker.BlackOutline.BorderSizePixel = 0 |
1471 | colorpicker.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2 |
1472 | colorpicker.BlackOutline.Position = UDim2.fromOffset(-1, -1) |
1473 | updateevent.Event:Connect(function(theme) |
1474 | colorpicker.BlackOutline.BackgroundColor3 = theme.outlinecolor2 |
1475 | end) |
1476 | |
1477 | colorpicker.BlackOutline2.MouseEnter:Connect(function() |
1478 | colorpicker.BlackOutline2.BackgroundColor3 = window.theme.accentcolor |
1479 | end) |
1480 | |
1481 | colorpicker.BlackOutline2.MouseLeave:Connect(function() |
1482 | if not window.OpenedColorPickers[colorpicker.MainPicker] then |
1483 | colorpicker.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
1484 | end |
1485 | end) |
1486 | |
1487 | colorpicker.MainPicker = Instance.new("TextButton", colorpicker.Main) |
1488 | colorpicker.MainPicker.Name = "picker" |
1489 | colorpicker.MainPicker.ZIndex = 100 |
1490 | colorpicker.MainPicker.Visible = false |
1491 | colorpicker.MainPicker.AutoButtonColor = false |
1492 | colorpicker.MainPicker.Text = "" |
1493 | window.OpenedColorPickers[colorpicker.MainPicker] = false |
1494 | colorpicker.MainPicker.Size = UDim2.fromOffset(180, 196) |
1495 | colorpicker.MainPicker.BorderSizePixel = 0 |
1496 | colorpicker.MainPicker.BackgroundColor3 = Color3.fromRGB(40, 40, 40) |
1497 | colorpicker.MainPicker.Rotation = 0.000000000000001 |
1498 | colorpicker.MainPicker.Position = UDim2.fromOffset(-colorpicker.MainPicker.AbsoluteSize.X + colorpicker.Main.AbsoluteSize.X, 17) |
1499 | |
1500 | colorpicker.BlackOutline3 = Instance.new("Frame", colorpicker.MainPicker) |
1501 | colorpicker.BlackOutline3.Name = "blackline" |
1502 | colorpicker.BlackOutline3.ZIndex = 98 |
1503 | colorpicker.BlackOutline3.Size = colorpicker.MainPicker.Size + UDim2.fromOffset(6, 6) |
1504 | colorpicker.BlackOutline3.BorderSizePixel = 0 |
1505 | colorpicker.BlackOutline3.BackgroundColor3 = window.theme.outlinecolor2 |
1506 | colorpicker.BlackOutline3.Position = UDim2.fromOffset(-3, -3) |
1507 | updateevent.Event:Connect(function(theme) |
1508 | colorpicker.BlackOutline3.BackgroundColor3 = theme.outlinecolor2 |
1509 | end) |
1510 | |
1511 | colorpicker.Outline2 = Instance.new("Frame", colorpicker.MainPicker) |
1512 | colorpicker.Outline2.Name = "blackline" |
1513 | colorpicker.Outline2.ZIndex = 98 |
1514 | colorpicker.Outline2.Size = colorpicker.MainPicker.Size + UDim2.fromOffset(4, 4) |
1515 | colorpicker.Outline2.BorderSizePixel = 0 |
1516 | colorpicker.Outline2.BackgroundColor3 = window.theme.outlinecolor |
1517 | colorpicker.Outline2.Position = UDim2.fromOffset(-2, -2) |
1518 | updateevent.Event:Connect(function(theme) |
1519 | colorpicker.Outline2.BackgroundColor3 = theme.outlinecolor |
1520 | end) |
1521 | |
1522 | colorpicker.BlackOutline3 = Instance.new("Frame", colorpicker.MainPicker) |
1523 | colorpicker.BlackOutline3.Name = "blackline" |
1524 | colorpicker.BlackOutline3.ZIndex = 98 |
1525 | colorpicker.BlackOutline3.Size = colorpicker.MainPicker.Size + UDim2.fromOffset(2, 2) |
1526 | colorpicker.BlackOutline3.BorderSizePixel = 0 |
1527 | colorpicker.BlackOutline3.BackgroundColor3 = window.theme.outlinecolor2 |
1528 | colorpicker.BlackOutline3.Position = UDim2.fromOffset(-1, -1) |
1529 | updateevent.Event:Connect(function(theme) |
1530 | colorpicker.BlackOutline3.BackgroundColor3 = theme.outlinecolor2 |
1531 | end) |
1532 | |
1533 | colorpicker.hue = Instance.new("ImageLabel", colorpicker.MainPicker) |
1534 | colorpicker.hue.ZIndex = 101 |
1535 | colorpicker.hue.Position = UDim2.new(0,3,0,3) |
1536 | colorpicker.hue.Size = UDim2.new(0,172,0,172) |
1537 | colorpicker.hue.Image = "rbxassetid://4155801252" |
1538 | colorpicker.hue.ScaleType = Enum.ScaleType.Stretch |
1539 | colorpicker.hue.BackgroundColor3 = Color3.new(1,0,0) |
1540 | colorpicker.hue.BorderColor3 = window.theme.outlinecolor2 |
1541 | updateevent.Event:Connect(function(theme) |
1542 | colorpicker.hue.BorderColor3 = theme.outlinecolor2 |
1543 | end) |
1544 | |
1545 | colorpicker.hueselectorpointer = Instance.new("ImageLabel", colorpicker.MainPicker) |
1546 | colorpicker.hueselectorpointer.ZIndex = 101 |
1547 | colorpicker.hueselectorpointer.BackgroundTransparency = 1 |
1548 | colorpicker.hueselectorpointer.BorderSizePixel = 0 |
1549 | colorpicker.hueselectorpointer.Position = UDim2.new(0, 0, 0, 0) |
1550 | colorpicker.hueselectorpointer.Size = UDim2.new(0, 7, 0, 7) |
1551 | colorpicker.hueselectorpointer.Image = "rbxassetid://6885856475" |
1552 | |
1553 | colorpicker.selector = Instance.new("TextLabel", colorpicker.MainPicker) |
1554 | colorpicker.selector.ZIndex = 100 |
1555 | colorpicker.selector.Position = UDim2.new(0,3,0,181) |
1556 | colorpicker.selector.Size = UDim2.new(0,173,0,10) |
1557 | colorpicker.selector.BackgroundColor3 = Color3.fromRGB(255,255,255) |
1558 | colorpicker.selector.BorderColor3 = window.theme.outlinecolor2 |
1559 | colorpicker.selector.Text = "" |
1560 | updateevent.Event:Connect(function(theme) |
1561 | colorpicker.selector.BorderColor3 = theme.outlinecolor2 |
1562 | end) |
1563 | |
1564 | colorpicker.gradient = Instance.new("UIGradient", colorpicker.selector) |
1565 | colorpicker.gradient.Color = ColorSequence.new({ |
1566 | ColorSequenceKeypoint.new(0, Color3.new(1,0,0)), |
1567 | ColorSequenceKeypoint.new(0.17, Color3.new(1,0,1)), |
1568 | ColorSequenceKeypoint.new(0.33,Color3.new(0,0,1)), |
1569 | ColorSequenceKeypoint.new(0.5,Color3.new(0,1,1)), |
1570 | ColorSequenceKeypoint.new(0.67, Color3.new(0,1,0)), |
1571 | ColorSequenceKeypoint.new(0.83, Color3.new(1,1,0)), |
1572 | ColorSequenceKeypoint.new(1, Color3.new(1,0,0)) |
1573 | }) |
1574 | |
1575 | colorpicker.pointer = Instance.new("Frame", colorpicker.selector) |
1576 | colorpicker.pointer.ZIndex = 101 |
1577 | colorpicker.pointer.BackgroundColor3 = Color3.fromRGB(40, 40, 40) |
1578 | colorpicker.pointer.Position = UDim2.new(0,0,0,0) |
1579 | colorpicker.pointer.Size = UDim2.new(0,2,0,10) |
1580 | colorpicker.pointer.BorderColor3 = Color3.fromRGB(255, 255, 255) |
1581 | |
1582 | if colorpicker.flag and colorpicker.flag ~= "" then |
1583 | library.flags[colorpicker.flag] = colorpicker.default |
1584 | end |
1585 | |
1586 | function colorpicker:RefreshHue() |
1587 | local x = (mouse.X - colorpicker.hue.AbsolutePosition.X) / colorpicker.hue.AbsoluteSize.X |
1588 | local y = (mouse.Y - colorpicker.hue.AbsolutePosition.Y) / colorpicker.hue.AbsoluteSize.Y |
1589 | colorpicker.hueselectorpointer:TweenPosition(UDim2.new(math.clamp(x * colorpicker.hue.AbsoluteSize.X, 0.5, 0.952 * colorpicker.hue.AbsoluteSize.X) / colorpicker.hue.AbsoluteSize.X, 0, math.clamp(y * colorpicker.hue.AbsoluteSize.Y, 0.5, 0.885 * colorpicker.hue.AbsoluteSize.Y) / colorpicker.hue.AbsoluteSize.Y, 0), Enum.EasingDirection.In, Enum.EasingStyle.Sine, 0.05) |
1590 | colorpicker:Set(Color3.fromHSV(colorpicker.color, math.clamp(x * colorpicker.hue.AbsoluteSize.X, 0.5, 1 * colorpicker.hue.AbsoluteSize.X) / colorpicker.hue.AbsoluteSize.X, 1 - (math.clamp(y * colorpicker.hue.AbsoluteSize.Y, 0.5, 1 * colorpicker.hue.AbsoluteSize.Y) / colorpicker.hue.AbsoluteSize.Y))) |
1591 | end |
1592 | |
1593 | function colorpicker:RefreshSelector() |
1594 | local pos = math.clamp((mouse.X - colorpicker.hue.AbsolutePosition.X) / colorpicker.hue.AbsoluteSize.X, 0, 1) |
1595 | colorpicker.color = 1 - pos |
1596 | colorpicker.pointer:TweenPosition(UDim2.new(pos, 0, 0, 0), Enum.EasingDirection.In, Enum.EasingStyle.Sine, 0.05) |
1597 | colorpicker.hue.BackgroundColor3 = Color3.fromHSV(1 - pos, 1, 1) |
1598 | |
1599 | local x = (colorpicker.hueselectorpointer.AbsolutePosition.X - colorpicker.hue.AbsolutePosition.X) / colorpicker.hue.AbsoluteSize.X |
1600 | local y = (colorpicker.hueselectorpointer.AbsolutePosition.Y - colorpicker.hue.AbsolutePosition.Y) / colorpicker.hue.AbsoluteSize.Y |
1601 | colorpicker:Set(Color3.fromHSV(colorpicker.color, math.clamp(x * colorpicker.hue.AbsoluteSize.X, 0.5, 1 * colorpicker.hue.AbsoluteSize.X) / colorpicker.hue.AbsoluteSize.X, 1 - (math.clamp(y * colorpicker.hue.AbsoluteSize.Y, 0.5, 1 * colorpicker.hue.AbsoluteSize.Y) / colorpicker.hue.AbsoluteSize.Y))) |
1602 | end |
1603 | |
1604 | function colorpicker:Set(value) |
1605 | local color = Color3.new(math.clamp(value.r, 0, 1), math.clamp(value.g, 0, 1), math.clamp(value.b, 0, 1)) |
1606 | colorpicker.value = color |
1607 | if colorpicker.flag and colorpicker.flag ~= "" then |
1608 | library.flags[colorpicker.flag] = color |
1609 | end |
1610 | local clr = Color3.new(math.clamp(color.R / 1.7, 0, 1), math.clamp(color.G / 1.7, 0, 1), math.clamp(color.B / 1.7, 0, 1)) |
1611 | colorpicker.Gradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, color), ColorSequenceKeypoint.new(1.00, clr) }) |
1612 | pcall(colorpicker.callback, color) |
1613 | end |
1614 | |
1615 | function colorpicker:Get(value) |
1616 | return colorpicker.value |
1617 | end |
1618 | colorpicker:Set(colorpicker.default) |
1619 | |
1620 | local dragging_selector = false |
1621 | local dragging_hue = false |
1622 | |
1623 | colorpicker.selector.InputBegan:Connect(function(input) |
1624 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
1625 | dragging_selector = true |
1626 | colorpicker:RefreshSelector() |
1627 | end |
1628 | end) |
1629 | |
1630 | colorpicker.selector.InputEnded:Connect(function(input) |
1631 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
1632 | dragging_selector = false |
1633 | colorpicker:RefreshSelector() |
1634 | end |
1635 | end) |
1636 | |
1637 | colorpicker.hue.InputBegan:Connect(function(input) |
1638 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
1639 | dragging_hue = true |
1640 | colorpicker:RefreshHue() |
1641 | end |
1642 | end) |
1643 | |
1644 | colorpicker.hue.InputEnded:Connect(function(input) |
1645 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
1646 | dragging_hue = false |
1647 | colorpicker:RefreshHue() |
1648 | end |
1649 | end) |
1650 | |
1651 | uis.InputChanged:Connect(function(input) |
1652 | if dragging_selector and input.UserInputType == Enum.UserInputType.MouseMovement then |
1653 | colorpicker:RefreshSelector() |
1654 | end |
1655 | if dragging_hue and input.UserInputType == Enum.UserInputType.MouseMovement then |
1656 | colorpicker:RefreshHue() |
1657 | end |
1658 | end) |
1659 | |
1660 | local inputBegan = function(input) |
1661 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
1662 | for i,v in pairs(window.OpenedColorPickers) do |
1663 | if v and i ~= colorpicker.MainPicker then |
1664 | i.Visible = false |
1665 | window.OpenedColorPickers[i] = false |
1666 | end |
1667 | end |
1668 | |
1669 | colorpicker.MainPicker.Visible = not colorpicker.MainPicker.Visible |
1670 | window.OpenedColorPickers[colorpicker.MainPicker] = colorpicker.MainPicker.Visible |
1671 | if window.OpenedColorPickers[colorpicker.MainPicker] then |
1672 | colorpicker.BlackOutline2.BackgroundColor3 = window.theme.accentcolor |
1673 | else |
1674 | colorpicker.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
1675 | end |
1676 | end |
1677 | end |
1678 | |
1679 | colorpicker.Main.InputBegan:Connect(inputBegan) |
1680 | colorpicker.Outline.InputBegan:Connect(inputBegan) |
1681 | colorpicker.BlackOutline2.InputBegan:Connect(inputBegan) |
1682 | table.insert(library.items, colorpicker) |
1683 | return colorpicker |
1684 | end |
1685 | |
1686 | function toggle:AddSlider(min, default, max, decimals, callback, flag) |
1687 | local slider = { } |
1688 | slider.text = text or "" |
1689 | slider.callback = callback or function(value) end |
1690 | slider.min = min or 0 |
1691 | slider.max = max or 100 |
1692 | slider.decimals = decimals or 1 |
1693 | slider.default = default or slider.min |
1694 | slider.flag = flag or ( (toggle.text or "") .. tostring(#toggle.Items:GetChildren())) |
1695 | |
1696 | slider.value = slider.default |
1697 | local dragging = false |
1698 | |
1699 | slider.Main = Instance.new("TextButton", sector.Items) |
1700 | slider.Main.Name = "slider" |
1701 | slider.Main.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
1702 | slider.Main.Position = UDim2.fromOffset(0, 0) |
1703 | slider.Main.BorderSizePixel = 0 |
1704 | slider.Main.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 12, 12) |
1705 | slider.Main.AutoButtonColor = false |
1706 | slider.Main.Text = "" |
1707 | slider.Main.ZIndex = 7 |
1708 | |
1709 | slider.InputLabel = Instance.new("TextLabel", slider.Main) |
1710 | slider.InputLabel.BackgroundTransparency = 1 |
1711 | slider.InputLabel.Size = slider.Main.Size |
1712 | slider.InputLabel.Font = window.theme.font |
1713 | slider.InputLabel.Text = "0" |
1714 | slider.InputLabel.TextColor3 = Color3.fromRGB(240, 240, 240) |
1715 | slider.InputLabel.Position = slider.Main.Position |
1716 | slider.InputLabel.Selectable = false |
1717 | slider.InputLabel.TextSize = 15 |
1718 | slider.InputLabel.ZIndex = 9 |
1719 | slider.InputLabel.TextStrokeTransparency = 1 |
1720 | slider.InputLabel.TextXAlignment = Enum.TextXAlignment.Center |
1721 | updateevent.Event:Connect(function(theme) |
1722 | slider.InputLabel.Font = theme.font |
1723 | slider.InputLabel.TextColor3 = theme.itemscolor |
1724 | end) |
1725 | |
1726 | slider.BlackOutline2 = Instance.new("Frame", slider.Main) |
1727 | slider.BlackOutline2.Name = "blackline" |
1728 | slider.BlackOutline2.ZIndex = 4 |
1729 | slider.BlackOutline2.Size = slider.Main.Size + UDim2.fromOffset(6, 6) |
1730 | slider.BlackOutline2.BorderSizePixel = 0 |
1731 | slider.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
1732 | slider.BlackOutline2.Position = UDim2.fromOffset(-3, -3) |
1733 | updateevent.Event:Connect(function(theme) |
1734 | slider.BlackOutline2.BackgroundColor3 = theme.outlinecolor2 |
1735 | end) |
1736 | |
1737 | slider.Outline = Instance.new("Frame", slider.Main) |
1738 | slider.Outline.Name = "blackline" |
1739 | slider.Outline.ZIndex = 4 |
1740 | slider.Outline.Size = slider.Main.Size + UDim2.fromOffset(4, 4) |
1741 | slider.Outline.BorderSizePixel = 0 |
1742 | slider.Outline.BackgroundColor3 = window.theme.outlinecolor |
1743 | slider.Outline.Position = UDim2.fromOffset(-2, -2) |
1744 | updateevent.Event:Connect(function(theme) |
1745 | slider.Outline.BackgroundColor3 = theme.outlinecolor |
1746 | end) |
1747 | |
1748 | slider.BlackOutline = Instance.new("Frame", slider.Main) |
1749 | slider.BlackOutline.Name = "blackline" |
1750 | slider.BlackOutline.ZIndex = 4 |
1751 | slider.BlackOutline.Size = slider.Main.Size + UDim2.fromOffset(2, 2) |
1752 | slider.BlackOutline.BorderSizePixel = 0 |
1753 | slider.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2 |
1754 | slider.BlackOutline.Position = UDim2.fromOffset(-1, -1) |
1755 | updateevent.Event:Connect(function(theme) |
1756 | slider.BlackOutline.BackgroundColor3 = theme.outlinecolor2 |
1757 | end) |
1758 | |
1759 | slider.Gradient = Instance.new("UIGradient", slider.Main) |
1760 | slider.Gradient.Rotation = 90 |
1761 | slider.Gradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, Color3.fromRGB(49, 49, 49)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(41, 41, 41)) }) |
1762 | |
1763 | slider.SlideBar = Instance.new("Frame", slider.Main) |
1764 | slider.SlideBar.BackgroundColor3 = Color3.fromRGB(255, 255, 255) --Color3.fromRGB(204, 0, 102) |
1765 | slider.SlideBar.ZIndex = 8 |
1766 | slider.SlideBar.BorderSizePixel = 0 |
1767 | slider.SlideBar.Size = UDim2.fromOffset(0, slider.Main.Size.Y.Offset) |
1768 | |
1769 | slider.Gradient2 = Instance.new("UIGradient", slider.SlideBar) |
1770 | slider.Gradient2.Rotation = 90 |
1771 | slider.Gradient2.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, window.theme.accentcolor), ColorSequenceKeypoint.new(1.00, window.theme.accentcolor2) }) |
1772 | updateevent.Event:Connect(function(theme) |
1773 | slider.Gradient2.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, theme.accentcolor), ColorSequenceKeypoint.new(1.00, theme.accentcolor2) }) |
1774 | end) |
1775 | |
1776 | slider.BlackOutline2.MouseEnter:Connect(function() |
1777 | slider.BlackOutline2.BackgroundColor3 = window.theme.accentcolor |
1778 | end) |
1779 | slider.BlackOutline2.MouseLeave:Connect(function() |
1780 | slider.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
1781 | end) |
1782 | |
1783 | if slider.flag and slider.flag ~= "" then |
1784 | library.flags[slider.flag] = slider.default or slider.min or 0 |
1785 | end |
1786 | |
1787 | function slider:Get() |
1788 | return slider.value |
1789 | end |
1790 | |
1791 | function slider:Set(value) |
1792 | slider.value = math.clamp(math.round(value * slider.decimals) / slider.decimals, slider.min, slider.max) |
1793 | local percent = 1 - ((slider.max - slider.value) / (slider.max - slider.min)) |
1794 | if slider.flag and slider.flag ~= "" then |
1795 | library.flags[slider.flag] = slider.value |
1796 | end |
1797 | slider.SlideBar:TweenSize(UDim2.fromOffset(percent * slider.Main.AbsoluteSize.X, slider.Main.AbsoluteSize.Y), Enum.EasingDirection.In, Enum.EasingStyle.Sine, 0.05) |
1798 | slider.InputLabel.Text = slider.value |
1799 | pcall(slider.callback, slider.value) |
1800 | end |
1801 | slider:Set(slider.default) |
1802 | |
1803 | function slider:Refresh() |
1804 | local mousePos = camera:WorldToViewportPoint(mouse.Hit.p) |
1805 | local percent = math.clamp(mousePos.X - slider.SlideBar.AbsolutePosition.X, 0, slider.Main.AbsoluteSize.X) / slider.Main.AbsoluteSize.X |
1806 | local value = math.floor((slider.min + (slider.max - slider.min) * percent) * slider.decimals) / slider.decimals |
1807 | value = math.clamp(value, slider.min, slider.max) |
1808 | slider:Set(value) |
1809 | end |
1810 | |
1811 | slider.SlideBar.InputBegan:Connect(function(input) |
1812 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
1813 | dragging = true |
1814 | slider:Refresh() |
1815 | end |
1816 | end) |
1817 | |
1818 | slider.SlideBar.InputEnded:Connect(function(input) |
1819 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
1820 | dragging = false |
1821 | end |
1822 | end) |
1823 | |
1824 | slider.Main.InputBegan:Connect(function(input) |
1825 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
1826 | dragging = true |
1827 | slider:Refresh() |
1828 | end |
1829 | end) |
1830 | |
1831 | slider.Main.InputEnded:Connect(function(input) |
1832 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
1833 | dragging = false |
1834 | end |
1835 | end) |
1836 | |
1837 | uis.InputChanged:Connect(function(input) |
1838 | if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then |
1839 | slider:Refresh() |
1840 | end |
1841 | end) |
1842 | |
1843 | sector:FixSize() |
1844 | table.insert(library.items, slider) |
1845 | return slider |
1846 | end |
1847 | |
1848 | toggle.Main.MouseButton1Down:Connect(function() |
1849 | toggle:Set(not toggle.CheckedFrame.Visible) |
1850 | end) |
1851 | toggle.Label.InputBegan:Connect(function(input) |
1852 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
1853 | toggle:Set(not toggle.CheckedFrame.Visible) |
1854 | end |
1855 | end) |
1856 | |
1857 | local MouseEnter = function() |
1858 | toggle.BlackOutline2.BackgroundColor3 = window.theme.accentcolor |
1859 | end |
1860 | local MouseLeave = function() |
1861 | toggle.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
1862 | end |
1863 | |
1864 | toggle.Label.MouseEnter:Connect(MouseEnter) |
1865 | toggle.Label.MouseLeave:Connect(MouseLeave) |
1866 | toggle.BlackOutline2.MouseEnter:Connect(MouseEnter) |
1867 | toggle.BlackOutline2.MouseLeave:Connect(MouseLeave) |
1868 | |
1869 | sector:FixSize() |
1870 | table.insert(library.items, toggle) |
1871 | return toggle |
1872 | end |
1873 | |
1874 | function sector:AddTextbox(text, default, callback, flag) |
1875 | local textbox = { } |
1876 | textbox.text = text or "" |
1877 | textbox.callback = callback or function() end |
1878 | textbox.default = default |
1879 | textbox.value = "" |
1880 | textbox.flag = flag or text or "" |
1881 | |
1882 | textbox.Label = Instance.new("TextButton", sector.Items) |
1883 | textbox.Label.Name = "Label" |
1884 | textbox.Label.AutoButtonColor = false |
1885 | textbox.Label.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
1886 | textbox.Label.BackgroundTransparency = 1 |
1887 | textbox.Label.Position = UDim2.fromOffset(sector.Main.Size.X.Offset, 0) |
1888 | textbox.Label.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 12, 0) |
1889 | textbox.Label.Font = window.theme.font |
1890 | textbox.Label.ZIndex = 5 |
1891 | textbox.Label.Text = textbox.text |
1892 | textbox.Label.TextColor3 = window.theme.itemscolor |
1893 | textbox.Label.TextSize = 15 |
1894 | textbox.Label.TextStrokeTransparency = 1 |
1895 | textbox.Label.TextXAlignment = Enum.TextXAlignment.Left |
1896 | updateevent.Event:Connect(function(theme) |
1897 | textbox.Label.Font = theme.font |
1898 | end) |
1899 | |
1900 | textbox.Holder = Instance.new("Frame", sector.Items) |
1901 | textbox.Holder.Name = "holder" |
1902 | textbox.Holder.ZIndex = 5 |
1903 | textbox.Holder.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 12, 14) |
1904 | textbox.Holder.BorderSizePixel = 0 |
1905 | textbox.Holder.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
1906 | |
1907 | textbox.Gradient = Instance.new("UIGradient", textbox.Holder) |
1908 | textbox.Gradient.Rotation = 90 |
1909 | textbox.Gradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, Color3.fromRGB(49, 49, 49)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(39, 39, 39)) }) |
1910 | |
1911 | textbox.Main = Instance.new("TextBox", textbox.Holder) |
1912 | textbox.Main.PlaceholderText = textbox.text |
1913 | textbox.Main.PlaceholderColor3 = Color3.fromRGB(190, 190, 190) |
1914 | textbox.Main.Text = "" |
1915 | textbox.Main.BackgroundTransparency = 1 |
1916 | textbox.Main.Font = window.theme.font |
1917 | textbox.Main.Name = "textbox" |
1918 | textbox.Main.MultiLine = false |
1919 | textbox.Main.ClearTextOnFocus = false |
1920 | textbox.Main.ZIndex = 5 |
1921 | textbox.Main.TextScaled = true |
1922 | textbox.Main.Size = textbox.Holder.Size |
1923 | textbox.Main.TextSize = 15 |
1924 | textbox.Main.TextColor3 = Color3.fromRGB(255, 255, 255) |
1925 | textbox.Main.BorderSizePixel = 0 |
1926 | textbox.Main.BackgroundColor3 = Color3.fromRGB(30, 30, 30) |
1927 | textbox.Main.TextXAlignment = Enum.TextXAlignment.Left |
1928 | |
1929 | if textbox.flag and textbox.flag ~= "" then |
1930 | library.flags[textbox.flag] = textbox.default or "" |
1931 | end |
1932 | |
1933 | function textbox:Set(text) |
1934 | textbox.value = text |
1935 | textbox.Main.Text = text |
1936 | if textbox.flag and textbox.flag ~= "" then |
1937 | library.flags[textbox.flag] = text |
1938 | end |
1939 | pcall(textbox.callback, text) |
1940 | end |
1941 | updateevent.Event:Connect(function(theme) |
1942 | textbox.Main.Font = theme.font |
1943 | end) |
1944 | |
1945 | function textbox:Get() |
1946 | return textbox.value |
1947 | end |
1948 | |
1949 | if textbox.default then |
1950 | textbox:Set(textbox.default) |
1951 | end |
1952 | |
1953 | textbox.Main.FocusLost:Connect(function() |
1954 | textbox:Set(textbox.Main.Text) |
1955 | end) |
1956 | |
1957 | textbox.BlackOutline2 = Instance.new("Frame", textbox.Main) |
1958 | textbox.BlackOutline2.Name = "blackline" |
1959 | textbox.BlackOutline2.ZIndex = 4 |
1960 | textbox.BlackOutline2.Size = textbox.Main.Size + UDim2.fromOffset(6, 6) |
1961 | textbox.BlackOutline2.BorderSizePixel = 0 |
1962 | textbox.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
1963 | textbox.BlackOutline2.Position = UDim2.fromOffset(-3, -3) |
1964 | updateevent.Event:Connect(function(theme) |
1965 | textbox.BlackOutline2.BackgroundColor3 = theme.outlinecolor2 |
1966 | end) |
1967 | |
1968 | textbox.Outline = Instance.new("Frame", textbox.Main) |
1969 | textbox.Outline.Name = "blackline" |
1970 | textbox.Outline.ZIndex = 4 |
1971 | textbox.Outline.Size = textbox.Main.Size + UDim2.fromOffset(4, 4) |
1972 | textbox.Outline.BorderSizePixel = 0 |
1973 | textbox.Outline.BackgroundColor3 = window.theme.outlinecolor |
1974 | textbox.Outline.Position = UDim2.fromOffset(-2, -2) |
1975 | updateevent.Event:Connect(function(theme) |
1976 | textbox.Outline.BackgroundColor3 = theme.outlinecolor |
1977 | end) |
1978 | |
1979 | textbox.BlackOutline = Instance.new("Frame", textbox.Main) |
1980 | textbox.BlackOutline.Name = "blackline" |
1981 | textbox.BlackOutline.ZIndex = 4 |
1982 | textbox.BlackOutline.Size = textbox.Main.Size + UDim2.fromOffset(2, 2) |
1983 | textbox.BlackOutline.BorderSizePixel = 0 |
1984 | textbox.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2 |
1985 | textbox.BlackOutline.Position = UDim2.fromOffset(-1, -1) |
1986 | updateevent.Event:Connect(function(theme) |
1987 | textbox.BlackOutline.BackgroundColor3 = theme.outlinecolor2 |
1988 | end) |
1989 | |
1990 | textbox.BlackOutline2.MouseEnter:Connect(function() |
1991 | textbox.BlackOutline2.BackgroundColor3 = window.theme.accentcolor |
1992 | end) |
1993 | textbox.BlackOutline2.MouseLeave:Connect(function() |
1994 | textbox.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
1995 | end) |
1996 | |
1997 | sector:FixSize() |
1998 | table.insert(library.items, textbox) |
1999 | return textbox |
2000 | end |
2001 | |
2002 | function sector:AddSlider(text, min, default, max, decimals, callback, flag) |
2003 | local slider = { } |
2004 | slider.text = text or "" |
2005 | slider.callback = callback or function(value) end |
2006 | slider.min = min or 0 |
2007 | slider.max = max or 100 |
2008 | slider.decimals = decimals or 1 |
2009 | slider.default = default or slider.min |
2010 | slider.flag = flag or text or "" |
2011 | |
2012 | slider.value = slider.default |
2013 | local dragging = false |
2014 | |
2015 | slider.MainBack = Instance.new("Frame", sector.Items) |
2016 | slider.MainBack.Name = "MainBack" |
2017 | slider.MainBack.ZIndex = 7 |
2018 | slider.MainBack.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 12, 25) |
2019 | slider.MainBack.BorderSizePixel = 0 |
2020 | slider.MainBack.BackgroundTransparency = 1 |
2021 | |
2022 | slider.Label = Instance.new("TextLabel", slider.MainBack) |
2023 | slider.Label.BackgroundTransparency = 1 |
2024 | slider.Label.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 12, 6) |
2025 | slider.Label.Font = window.theme.font |
2026 | slider.Label.Text = slider.text .. ":" |
2027 | slider.Label.TextColor3 = window.theme.itemscolor |
2028 | slider.Label.Position = UDim2.fromOffset(0, 0) |
2029 | slider.Label.TextSize = 15 |
2030 | slider.Label.ZIndex = 4 |
2031 | slider.Label.TextStrokeTransparency = 1 |
2032 | slider.Label.TextXAlignment = Enum.TextXAlignment.Left |
2033 | updateevent.Event:Connect(function(theme) |
2034 | slider.Label.Font = theme.font |
2035 | slider.Label.TextColor3 = theme.itemscolor |
2036 | end) |
2037 | |
2038 | local size = textservice:GetTextSize(slider.Label.Text, slider.Label.TextSize, slider.Label.Font, Vector2.new(200,300)) |
2039 | slider.InputLabel = Instance.new("TextBox", slider.MainBack) |
2040 | slider.InputLabel.BackgroundTransparency = 1 |
2041 | slider.InputLabel.ClearTextOnFocus = false |
2042 | slider.InputLabel.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - size.X - 15, 12) |
2043 | slider.InputLabel.Font = window.theme.font |
2044 | slider.InputLabel.Text = "0" |
2045 | slider.InputLabel.TextColor3 = window.theme.itemscolor |
2046 | slider.InputLabel.Position = UDim2.fromOffset(size.X + 3, -3) |
2047 | slider.InputLabel.TextSize = 15 |
2048 | slider.InputLabel.ZIndex = 4 |
2049 | slider.InputLabel.TextStrokeTransparency = 1 |
2050 | slider.InputLabel.TextXAlignment = Enum.TextXAlignment.Left |
2051 | updateevent.Event:Connect(function(theme) |
2052 | slider.InputLabel.Font = theme.font |
2053 | slider.InputLabel.TextColor3 = theme.itemscolor |
2054 | |
2055 | local size = textservice:GetTextSize(slider.Label.Text, slider.Label.TextSize, slider.Label.Font, Vector2.new(200,300)) |
2056 | slider.InputLabel.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - size.X - 15, 12) |
2057 | end) |
2058 | |
2059 | slider.Main = Instance.new("TextButton", slider.MainBack) |
2060 | slider.Main.Name = "slider" |
2061 | slider.Main.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
2062 | slider.Main.Position = UDim2.fromOffset(0, 15) |
2063 | slider.Main.BorderSizePixel = 0 |
2064 | slider.Main.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 12, 12) |
2065 | slider.Main.AutoButtonColor = false |
2066 | slider.Main.Text = "" |
2067 | slider.Main.ZIndex = 5 |
2068 | |
2069 | slider.BlackOutline2 = Instance.new("Frame", slider.Main) |
2070 | slider.BlackOutline2.Name = "blackline" |
2071 | slider.BlackOutline2.ZIndex = 4 |
2072 | slider.BlackOutline2.Size = slider.Main.Size + UDim2.fromOffset(6, 6) |
2073 | slider.BlackOutline2.BorderSizePixel = 0 |
2074 | slider.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
2075 | slider.BlackOutline2.Position = UDim2.fromOffset(-3, -3) |
2076 | updateevent.Event:Connect(function(theme) |
2077 | slider.BlackOutline2.BackgroundColor3 = theme.outlinecolor2 |
2078 | end) |
2079 | |
2080 | slider.Outline = Instance.new("Frame", slider.Main) |
2081 | slider.Outline.Name = "blackline" |
2082 | slider.Outline.ZIndex = 4 |
2083 | slider.Outline.Size = slider.Main.Size + UDim2.fromOffset(4, 4) |
2084 | slider.Outline.BorderSizePixel = 0 |
2085 | slider.Outline.BackgroundColor3 = window.theme.outlinecolor |
2086 | slider.Outline.Position = UDim2.fromOffset(-2, -2) |
2087 | updateevent.Event:Connect(function(theme) |
2088 | slider.Outline.BackgroundColor3 = theme.outlinecolor |
2089 | end) |
2090 | |
2091 | slider.BlackOutline = Instance.new("Frame", slider.Main) |
2092 | slider.BlackOutline.Name = "blackline" |
2093 | slider.BlackOutline.ZIndex = 4 |
2094 | slider.BlackOutline.Size = slider.Main.Size + UDim2.fromOffset(2, 2) |
2095 | slider.BlackOutline.BorderSizePixel = 0 |
2096 | slider.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2 |
2097 | slider.BlackOutline.Position = UDim2.fromOffset(-1, -1) |
2098 | updateevent.Event:Connect(function(theme) |
2099 | slider.BlackOutline.BackgroundColor3 = theme.outlinecolor2 |
2100 | end) |
2101 | |
2102 | slider.Gradient = Instance.new("UIGradient", slider.Main) |
2103 | slider.Gradient.Rotation = 90 |
2104 | slider.Gradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, Color3.fromRGB(49, 49, 49)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(41, 41, 41)) }) |
2105 | |
2106 | slider.SlideBar = Instance.new("Frame", slider.Main) |
2107 | slider.SlideBar.BackgroundColor3 = Color3.fromRGB(255, 255, 255) --Color3.fromRGB(204, 0, 102) |
2108 | slider.SlideBar.ZIndex = 5 |
2109 | slider.SlideBar.BorderSizePixel = 0 |
2110 | slider.SlideBar.Size = UDim2.fromOffset(0, slider.Main.Size.Y.Offset) |
2111 | |
2112 | slider.Gradient2 = Instance.new("UIGradient", slider.SlideBar) |
2113 | slider.Gradient2.Rotation = 90 |
2114 | slider.Gradient2.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, window.theme.accentcolor), ColorSequenceKeypoint.new(1.00, window.theme.accentcolor2) }) |
2115 | updateevent.Event:Connect(function(theme) |
2116 | slider.Gradient2.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, theme.accentcolor), ColorSequenceKeypoint.new(1.00, theme.accentcolor2) }) |
2117 | end) |
2118 | |
2119 | slider.BlackOutline2.MouseEnter:Connect(function() |
2120 | slider.BlackOutline2.BackgroundColor3 = window.theme.accentcolor |
2121 | end) |
2122 | slider.BlackOutline2.MouseLeave:Connect(function() |
2123 | slider.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
2124 | end) |
2125 | |
2126 | if slider.flag and slider.flag ~= "" then |
2127 | library.flags[slider.flag] = slider.default or slider.min or 0 |
2128 | end |
2129 | |
2130 | function slider:Get() |
2131 | return slider.value |
2132 | end |
2133 | |
2134 | function slider:Set(value) |
2135 | slider.value = math.clamp(math.round(value * slider.decimals) / slider.decimals, slider.min, slider.max) |
2136 | local percent = 1 - ((slider.max - slider.value) / (slider.max - slider.min)) |
2137 | if slider.flag and slider.flag ~= "" then |
2138 | library.flags[slider.flag] = slider.value |
2139 | end |
2140 | slider.SlideBar:TweenSize(UDim2.fromOffset(percent * slider.Main.AbsoluteSize.X, slider.Main.AbsoluteSize.Y), Enum.EasingDirection.In, Enum.EasingStyle.Sine, 0.05) |
2141 | slider.InputLabel.Text = slider.value |
2142 | pcall(slider.callback, slider.value) |
2143 | end |
2144 | slider:Set(slider.default) |
2145 | |
2146 | slider.InputLabel.FocusLost:Connect(function(Return) |
2147 | if not Return then |
2148 | return |
2149 | end |
2150 | if (slider.InputLabel.Text:match("^%d+$")) then |
2151 | slider:Set(tonumber(slider.InputLabel.Text)) |
2152 | else |
2153 | slider.InputLabel.Text = tostring(slider.value) |
2154 | end |
2155 | end) |
2156 | |
2157 | function slider:Refresh() |
2158 | local mousePos = camera:WorldToViewportPoint(mouse.Hit.p) |
2159 | local percent = math.clamp(mousePos.X - slider.SlideBar.AbsolutePosition.X, 0, slider.Main.AbsoluteSize.X) / slider.Main.AbsoluteSize.X |
2160 | local value = math.floor((slider.min + (slider.max - slider.min) * percent) * slider.decimals) / slider.decimals |
2161 | value = math.clamp(value, slider.min, slider.max) |
2162 | slider:Set(value) |
2163 | end |
2164 | |
2165 | slider.SlideBar.InputBegan:Connect(function(input) |
2166 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
2167 | dragging = true |
2168 | slider:Refresh() |
2169 | end |
2170 | end) |
2171 | |
2172 | slider.SlideBar.InputEnded:Connect(function(input) |
2173 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
2174 | dragging = false |
2175 | end |
2176 | end) |
2177 | |
2178 | slider.Main.InputBegan:Connect(function(input) |
2179 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
2180 | dragging = true |
2181 | slider:Refresh() |
2182 | end |
2183 | end) |
2184 | |
2185 | slider.Main.InputEnded:Connect(function(input) |
2186 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
2187 | dragging = false |
2188 | end |
2189 | end) |
2190 | |
2191 | uis.InputChanged:Connect(function(input) |
2192 | if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then |
2193 | slider:Refresh() |
2194 | end |
2195 | end) |
2196 | |
2197 | sector:FixSize() |
2198 | table.insert(library.items, slider) |
2199 | return slider |
2200 | end |
2201 | |
2202 | function sector:AddColorpicker(text, default, callback, flag) |
2203 | local colorpicker = { } |
2204 | |
2205 | colorpicker.text = text or "" |
2206 | colorpicker.callback = callback or function() end |
2207 | colorpicker.default = default or Color3.fromRGB(255, 255, 255) |
2208 | colorpicker.value = colorpicker.default |
2209 | colorpicker.flag = flag or text or "" |
2210 | |
2211 | colorpicker.Label = Instance.new("TextLabel", sector.Items) |
2212 | colorpicker.Label.BackgroundTransparency = 1 |
2213 | colorpicker.Label.Size = UDim2.fromOffset(156, 10) |
2214 | colorpicker.Label.ZIndex = 4 |
2215 | colorpicker.Label.Font = window.theme.font |
2216 | colorpicker.Label.Text = colorpicker.text |
2217 | colorpicker.Label.TextColor3 = window.theme.itemscolor |
2218 | colorpicker.Label.TextSize = 15 |
2219 | colorpicker.Label.TextStrokeTransparency = 1 |
2220 | colorpicker.Label.TextXAlignment = Enum.TextXAlignment.Left |
2221 | updateevent.Event:Connect(function(theme) |
2222 | colorpicker.Label.Font = theme.font |
2223 | colorpicker.Label.TextColor3 = theme.itemscolor |
2224 | end) |
2225 | |
2226 | colorpicker.Main = Instance.new("Frame", colorpicker.Label) |
2227 | colorpicker.Main.ZIndex = 6 |
2228 | colorpicker.Main.BorderSizePixel = 0 |
2229 | colorpicker.Main.Position = UDim2.fromOffset(sector.Main.Size.X.Offset - 29, 0) |
2230 | colorpicker.Main.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
2231 | colorpicker.Main.Size = UDim2.fromOffset(16, 10) |
2232 | |
2233 | colorpicker.Gradient = Instance.new("UIGradient", colorpicker.Main) |
2234 | colorpicker.Gradient.Rotation = 90 |
2235 | |
2236 | local clr = Color3.new(math.clamp(colorpicker.value.R / 1.7, 0, 1), math.clamp(colorpicker.value.G / 1.7, 0, 1), math.clamp(colorpicker.value.B / 1.7, 0, 1)) |
2237 | colorpicker.Gradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, colorpicker.value), ColorSequenceKeypoint.new(1.00, clr) }) |
2238 | |
2239 | colorpicker.BlackOutline2 = Instance.new("Frame", colorpicker.Main) |
2240 | colorpicker.BlackOutline2.Name = "blackline" |
2241 | colorpicker.BlackOutline2.ZIndex = 4 |
2242 | colorpicker.BlackOutline2.Size = colorpicker.Main.Size + UDim2.fromOffset(6, 6) |
2243 | colorpicker.BlackOutline2.BorderSizePixel = 0 |
2244 | colorpicker.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
2245 | colorpicker.BlackOutline2.Position = UDim2.fromOffset(-3, -3) |
2246 | updateevent.Event:Connect(function(theme) |
2247 | colorpicker.BlackOutline2.BackgroundColor3 = window.OpenedColorPickers[colorpicker.MainPicker] and theme.accentcolor or theme.outlinecolor2 |
2248 | end) |
2249 | |
2250 | colorpicker.Outline = Instance.new("Frame", colorpicker.Main) |
2251 | colorpicker.Outline.Name = "blackline" |
2252 | colorpicker.Outline.ZIndex = 4 |
2253 | colorpicker.Outline.Size = colorpicker.Main.Size + UDim2.fromOffset(4, 4) |
2254 | colorpicker.Outline.BorderSizePixel = 0 |
2255 | colorpicker.Outline.BackgroundColor3 = window.theme.outlinecolor |
2256 | colorpicker.Outline.Position = UDim2.fromOffset(-2, -2) |
2257 | updateevent.Event:Connect(function(theme) |
2258 | colorpicker.Outline.BackgroundColor3 = theme.outlinecolor |
2259 | end) |
2260 | |
2261 | colorpicker.BlackOutline = Instance.new("Frame", colorpicker.Main) |
2262 | colorpicker.BlackOutline.Name = "blackline" |
2263 | colorpicker.BlackOutline.ZIndex = 4 |
2264 | colorpicker.BlackOutline.Size = colorpicker.Main.Size + UDim2.fromOffset(2, 2) |
2265 | colorpicker.BlackOutline.BorderSizePixel = 0 |
2266 | colorpicker.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2 |
2267 | colorpicker.BlackOutline.Position = UDim2.fromOffset(-1, -1) |
2268 | updateevent.Event:Connect(function(theme) |
2269 | colorpicker.BlackOutline.BackgroundColor3 = theme.outlinecolor2 |
2270 | end) |
2271 | |
2272 | colorpicker.BlackOutline2.MouseEnter:Connect(function() |
2273 | colorpicker.BlackOutline2.BackgroundColor3 = window.theme.accentcolor |
2274 | end) |
2275 | colorpicker.BlackOutline2.MouseLeave:Connect(function() |
2276 | if not window.OpenedColorPickers[colorpicker.MainPicker] then |
2277 | colorpicker.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
2278 | end |
2279 | end) |
2280 | |
2281 | colorpicker.MainPicker = Instance.new("TextButton", colorpicker.Main) |
2282 | colorpicker.MainPicker.Name = "picker" |
2283 | colorpicker.MainPicker.ZIndex = 100 |
2284 | colorpicker.MainPicker.Visible = false |
2285 | colorpicker.MainPicker.AutoButtonColor = false |
2286 | colorpicker.MainPicker.Text = "" |
2287 | window.OpenedColorPickers[colorpicker.MainPicker] = false |
2288 | colorpicker.MainPicker.Size = UDim2.fromOffset(180, 196) |
2289 | colorpicker.MainPicker.BorderSizePixel = 0 |
2290 | colorpicker.MainPicker.BackgroundColor3 = Color3.fromRGB(40, 40, 40) |
2291 | colorpicker.MainPicker.Rotation = 0.000000000000001 |
2292 | colorpicker.MainPicker.Position = UDim2.fromOffset(-colorpicker.MainPicker.AbsoluteSize.X + colorpicker.Main.AbsoluteSize.X, 15) |
2293 | |
2294 | colorpicker.BlackOutline3 = Instance.new("Frame", colorpicker.MainPicker) |
2295 | colorpicker.BlackOutline3.Name = "blackline" |
2296 | colorpicker.BlackOutline3.ZIndex = 98 |
2297 | colorpicker.BlackOutline3.Size = colorpicker.MainPicker.Size + UDim2.fromOffset(6, 6) |
2298 | colorpicker.BlackOutline3.BorderSizePixel = 0 |
2299 | colorpicker.BlackOutline3.BackgroundColor3 = window.theme.outlinecolor2 |
2300 | colorpicker.BlackOutline3.Position = UDim2.fromOffset(-3, -3) |
2301 | updateevent.Event:Connect(function(theme) |
2302 | colorpicker.BlackOutline3.BackgroundColor3 = theme.outlinecolor2 |
2303 | end) |
2304 | |
2305 | colorpicker.Outline2 = Instance.new("Frame", colorpicker.MainPicker) |
2306 | colorpicker.Outline2.Name = "blackline" |
2307 | colorpicker.Outline2.ZIndex = 98 |
2308 | colorpicker.Outline2.Size = colorpicker.MainPicker.Size + UDim2.fromOffset(4, 4) |
2309 | colorpicker.Outline2.BorderSizePixel = 0 |
2310 | colorpicker.Outline2.BackgroundColor3 = window.theme.outlinecolor |
2311 | colorpicker.Outline2.Position = UDim2.fromOffset(-2, -2) |
2312 | updateevent.Event:Connect(function(theme) |
2313 | colorpicker.Outline2.BackgroundColor3 = theme.outlinecolor |
2314 | end) |
2315 | |
2316 | colorpicker.BlackOutline3 = Instance.new("Frame", colorpicker.MainPicker) |
2317 | colorpicker.BlackOutline3.Name = "blackline" |
2318 | colorpicker.BlackOutline3.ZIndex = 98 |
2319 | colorpicker.BlackOutline3.Size = colorpicker.MainPicker.Size + UDim2.fromOffset(2, 2) |
2320 | colorpicker.BlackOutline3.BorderSizePixel = 0 |
2321 | colorpicker.BlackOutline3.BackgroundColor3 = window.theme.outlinecolor2 |
2322 | colorpicker.BlackOutline3.Position = UDim2.fromOffset(-1, -1) |
2323 | updateevent.Event:Connect(function(theme) |
2324 | colorpicker.BlackOutline3.BackgroundColor3 = theme.outlinecolor2 |
2325 | end) |
2326 | |
2327 | colorpicker.hue = Instance.new("ImageLabel", colorpicker.MainPicker) |
2328 | colorpicker.hue.ZIndex = 101 |
2329 | colorpicker.hue.Position = UDim2.new(0,3,0,3) |
2330 | colorpicker.hue.Size = UDim2.new(0,172,0,172) |
2331 | colorpicker.hue.Image = "rbxassetid://4155801252" |
2332 | colorpicker.hue.ScaleType = Enum.ScaleType.Stretch |
2333 | colorpicker.hue.BackgroundColor3 = Color3.new(1,0,0) |
2334 | colorpicker.hue.BorderColor3 = window.theme.outlinecolor2 |
2335 | updateevent.Event:Connect(function(theme) |
2336 | colorpicker.hue.BorderColor3 = theme.outlinecolor2 |
2337 | end) |
2338 | |
2339 | colorpicker.hueselectorpointer = Instance.new("ImageLabel", colorpicker.MainPicker) |
2340 | colorpicker.hueselectorpointer.ZIndex = 101 |
2341 | colorpicker.hueselectorpointer.BackgroundTransparency = 1 |
2342 | colorpicker.hueselectorpointer.BorderSizePixel = 0 |
2343 | colorpicker.hueselectorpointer.Position = UDim2.new(0, 0, 0, 0) |
2344 | colorpicker.hueselectorpointer.Size = UDim2.new(0, 7, 0, 7) |
2345 | colorpicker.hueselectorpointer.Image = "rbxassetid://6885856475" |
2346 | |
2347 | colorpicker.selector = Instance.new("TextLabel", colorpicker.MainPicker) |
2348 | colorpicker.selector.ZIndex = 100 |
2349 | colorpicker.selector.Position = UDim2.new(0,3,0,181) |
2350 | colorpicker.selector.Size = UDim2.new(0,173,0,10) |
2351 | colorpicker.selector.BackgroundColor3 = Color3.fromRGB(255,255,255) |
2352 | colorpicker.selector.BorderColor3 = window.theme.outlinecolor2 |
2353 | colorpicker.selector.Text = "" |
2354 | updateevent.Event:Connect(function(theme) |
2355 | colorpicker.selector.BorderColor3 = theme.outlinecolor2 |
2356 | end) |
2357 | |
2358 | colorpicker.gradient = Instance.new("UIGradient", colorpicker.selector) |
2359 | colorpicker.gradient.Color = ColorSequence.new({ |
2360 | ColorSequenceKeypoint.new(0, Color3.new(1,0,0)), |
2361 | ColorSequenceKeypoint.new(0.17, Color3.new(1,0,1)), |
2362 | ColorSequenceKeypoint.new(0.33,Color3.new(0,0,1)), |
2363 | ColorSequenceKeypoint.new(0.5,Color3.new(0,1,1)), |
2364 | ColorSequenceKeypoint.new(0.67, Color3.new(0,1,0)), |
2365 | ColorSequenceKeypoint.new(0.83, Color3.new(1,1,0)), |
2366 | ColorSequenceKeypoint.new(1, Color3.new(1,0,0)) |
2367 | }) |
2368 | |
2369 | colorpicker.pointer = Instance.new("Frame", colorpicker.selector) |
2370 | colorpicker.pointer.ZIndex = 101 |
2371 | colorpicker.pointer.BackgroundColor3 = Color3.fromRGB(40, 40, 40) |
2372 | colorpicker.pointer.Position = UDim2.new(0,0,0,0) |
2373 | colorpicker.pointer.Size = UDim2.new(0,2,0,10) |
2374 | colorpicker.pointer.BorderColor3 = Color3.fromRGB(255, 255, 255) |
2375 | |
2376 | if colorpicker.flag and colorpicker.flag ~= "" then |
2377 | library.flags[colorpicker.flag] = colorpicker.default |
2378 | end |
2379 | |
2380 | function colorpicker:RefreshSelector() |
2381 | local pos = math.clamp((mouse.X - colorpicker.hue.AbsolutePosition.X) / colorpicker.hue.AbsoluteSize.X, 0, 1) |
2382 | colorpicker.color = 1 - pos |
2383 | colorpicker.pointer:TweenPosition(UDim2.new(pos, 0, 0, 0), Enum.EasingDirection.In, Enum.EasingStyle.Sine, 0.05) |
2384 | colorpicker.hue.BackgroundColor3 = Color3.fromHSV(1 - pos, 1, 1) |
2385 | end |
2386 | |
2387 | function colorpicker:RefreshHue() |
2388 | local x = (mouse.X - colorpicker.hue.AbsolutePosition.X) / colorpicker.hue.AbsoluteSize.X |
2389 | local y = (mouse.Y - colorpicker.hue.AbsolutePosition.Y) / colorpicker.hue.AbsoluteSize.Y |
2390 | colorpicker.hueselectorpointer:TweenPosition(UDim2.new(math.clamp(x * colorpicker.hue.AbsoluteSize.X, 0.5, 0.952 * colorpicker.hue.AbsoluteSize.X) / colorpicker.hue.AbsoluteSize.X, 0, math.clamp(y * colorpicker.hue.AbsoluteSize.Y, 0.5, 0.885 * colorpicker.hue.AbsoluteSize.Y) / colorpicker.hue.AbsoluteSize.Y, 0), Enum.EasingDirection.In, Enum.EasingStyle.Sine, 0.05) |
2391 | colorpicker:Set(Color3.fromHSV(colorpicker.color, math.clamp(x * colorpicker.hue.AbsoluteSize.X, 0.5, 1 * colorpicker.hue.AbsoluteSize.X) / colorpicker.hue.AbsoluteSize.X, 1 - (math.clamp(y * colorpicker.hue.AbsoluteSize.Y, 0.5, 1 * colorpicker.hue.AbsoluteSize.Y) / colorpicker.hue.AbsoluteSize.Y))) |
2392 | end |
2393 | |
2394 | function colorpicker:Set(value) |
2395 | local color = Color3.new(math.clamp(value.r, 0, 1), math.clamp(value.g, 0, 1), math.clamp(value.b, 0, 1)) |
2396 | colorpicker.value = color |
2397 | if colorpicker.flag and colorpicker.flag ~= "" then |
2398 | library.flags[colorpicker.flag] = color |
2399 | end |
2400 | local clr = Color3.new(math.clamp(color.R / 1.7, 0, 1), math.clamp(color.G / 1.7, 0, 1), math.clamp(color.B / 1.7, 0, 1)) |
2401 | colorpicker.Gradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, color), ColorSequenceKeypoint.new(1.00, clr) }) |
2402 | pcall(colorpicker.callback, color) |
2403 | end |
2404 | function colorpicker:Get() |
2405 | return colorpicker.value |
2406 | end |
2407 | colorpicker:Set(colorpicker.default) |
2408 | |
2409 | function colorpicker:AddDropdown(items, default, multichoice, callback, flag) |
2410 | local dropdown = { } |
2411 | |
2412 | dropdown.defaultitems = items or { } |
2413 | dropdown.default = default |
2414 | dropdown.callback = callback or function() end |
2415 | dropdown.multichoice = multichoice or false |
2416 | dropdown.values = { } |
2417 | dropdown.flag = flag or ((colorpicker.text or "") .. tostring( #(sector.Items:GetChildren()) )) |
2418 | |
2419 | dropdown.Main = Instance.new("TextButton", sector.Items) |
2420 | dropdown.Main.Name = "dropdown" |
2421 | dropdown.Main.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
2422 | dropdown.Main.BorderSizePixel = 0 |
2423 | dropdown.Main.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 12, 16) |
2424 | dropdown.Main.Position = UDim2.fromOffset(0, 0) |
2425 | dropdown.Main.ZIndex = 5 |
2426 | dropdown.Main.AutoButtonColor = false |
2427 | dropdown.Main.Font = window.theme.font |
2428 | dropdown.Main.Text = "" |
2429 | dropdown.Main.TextColor3 = Color3.fromRGB(255, 255, 255) |
2430 | dropdown.Main.TextSize = 15 |
2431 | dropdown.Main.TextXAlignment = Enum.TextXAlignment.Left |
2432 | updateevent.Event:Connect(function(theme) |
2433 | dropdown.Main.Font = theme.font |
2434 | end) |
2435 | |
2436 | dropdown.Gradient = Instance.new("UIGradient", dropdown.Main) |
2437 | dropdown.Gradient.Rotation = 90 |
2438 | dropdown.Gradient.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(49, 49, 49)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(39, 39, 39))} |
2439 | |
2440 | dropdown.SelectedLabel = Instance.new("TextLabel", dropdown.Main) |
2441 | dropdown.SelectedLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
2442 | dropdown.SelectedLabel.BackgroundTransparency = 1 |
2443 | dropdown.SelectedLabel.Position = UDim2.fromOffset(5, 2) |
2444 | dropdown.SelectedLabel.Size = UDim2.fromOffset(130, 13) |
2445 | dropdown.SelectedLabel.Font = window.theme.font |
2446 | dropdown.SelectedLabel.Text = colorpicker.text |
2447 | dropdown.SelectedLabel.ZIndex = 5 |
2448 | dropdown.SelectedLabel.TextColor3 = Color3.fromRGB(255, 255, 255) |
2449 | dropdown.SelectedLabel.TextSize = 15 |
2450 | dropdown.SelectedLabel.TextStrokeTransparency = 1 |
2451 | dropdown.SelectedLabel.TextXAlignment = Enum.TextXAlignment.Left |
2452 | updateevent.Event:Connect(function(theme) |
2453 | dropdown.SelectedLabel.Font = theme.font |
2454 | end) |
2455 | |
2456 | dropdown.Nav = Instance.new("ImageButton", dropdown.Main) |
2457 | dropdown.Nav.Name = "navigation" |
2458 | dropdown.Nav.BackgroundTransparency = 1 |
2459 | dropdown.Nav.LayoutOrder = 10 |
2460 | dropdown.Nav.Position = UDim2.fromOffset(sector.Main.Size.X.Offset - 26, 5) |
2461 | dropdown.Nav.Rotation = 90 |
2462 | dropdown.Nav.ZIndex = 5 |
2463 | dropdown.Nav.Size = UDim2.fromOffset(8, 8) |
2464 | dropdown.Nav.Image = "rbxassetid://4918373417" |
2465 | dropdown.Nav.ImageColor3 = Color3.fromRGB(210, 210, 210) |
2466 | |
2467 | dropdown.BlackOutline2 = Instance.new("Frame", dropdown.Main) |
2468 | dropdown.BlackOutline2.Name = "blackline" |
2469 | dropdown.BlackOutline2.ZIndex = 4 |
2470 | dropdown.BlackOutline2.Size = dropdown.Main.Size + UDim2.fromOffset(6, 6) |
2471 | dropdown.BlackOutline2.BorderSizePixel = 0 |
2472 | dropdown.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
2473 | dropdown.BlackOutline2.Position = UDim2.fromOffset(-3, -3) |
2474 | updateevent.Event:Connect(function(theme) |
2475 | dropdown.BlackOutline2.BackgroundColor3 = theme.outlinecolor2 |
2476 | end) |
2477 | |
2478 | dropdown.Outline = Instance.new("Frame", dropdown.Main) |
2479 | dropdown.Outline.Name = "blackline" |
2480 | dropdown.Outline.ZIndex = 4 |
2481 | dropdown.Outline.Size = dropdown.Main.Size + UDim2.fromOffset(4, 4) |
2482 | dropdown.Outline.BorderSizePixel = 0 |
2483 | dropdown.Outline.BackgroundColor3 = window.theme.outlinecolor |
2484 | dropdown.Outline.Position = UDim2.fromOffset(-2, -2) |
2485 | updateevent.Event:Connect(function(theme) |
2486 | dropdown.Outline.BackgroundColor3 = theme.outlinecolor |
2487 | end) |
2488 | |
2489 | dropdown.BlackOutline = Instance.new("Frame", dropdown.Main) |
2490 | dropdown.BlackOutline.Name = "blackline" |
2491 | dropdown.BlackOutline.ZIndex = 4 |
2492 | dropdown.BlackOutline.Size = dropdown.Main.Size + UDim2.fromOffset(2, 2) |
2493 | dropdown.BlackOutline.BorderSizePixel = 0 |
2494 | dropdown.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2 |
2495 | dropdown.BlackOutline.Position = UDim2.fromOffset(-1, -1) |
2496 | updateevent.Event:Connect(function(theme) |
2497 | dropdown.BlackOutline.BackgroundColor3 = theme.outlinecolor2 |
2498 | end) |
2499 | |
2500 | dropdown.ItemsFrame = Instance.new("ScrollingFrame", dropdown.Main) |
2501 | dropdown.ItemsFrame.Name = "itemsframe" |
2502 | dropdown.ItemsFrame.BorderSizePixel = 0 |
2503 | dropdown.ItemsFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40) |
2504 | dropdown.ItemsFrame.Position = UDim2.fromOffset(0, dropdown.Main.Size.Y.Offset + 8) |
2505 | dropdown.ItemsFrame.ScrollBarThickness = 2 |
2506 | dropdown.ItemsFrame.ZIndex = 8 |
2507 | dropdown.ItemsFrame.ScrollingDirection = "Y" |
2508 | dropdown.ItemsFrame.Visible = false |
2509 | dropdown.ItemsFrame.CanvasSize = UDim2.fromOffset(dropdown.Main.AbsoluteSize.X, 0) |
2510 | |
2511 | dropdown.ListLayout = Instance.new("UIListLayout", dropdown.ItemsFrame) |
2512 | dropdown.ListLayout.FillDirection = Enum.FillDirection.Vertical |
2513 | dropdown.ListLayout.SortOrder = Enum.SortOrder.LayoutOrder |
2514 | |
2515 | dropdown.ListPadding = Instance.new("UIPadding", dropdown.ItemsFrame) |
2516 | dropdown.ListPadding.PaddingTop = UDim.new(0, 2) |
2517 | dropdown.ListPadding.PaddingBottom = UDim.new(0, 2) |
2518 | dropdown.ListPadding.PaddingLeft = UDim.new(0, 2) |
2519 | dropdown.ListPadding.PaddingRight = UDim.new(0, 2) |
2520 | |
2521 | dropdown.BlackOutline2Items = Instance.new("Frame", dropdown.Main) |
2522 | dropdown.BlackOutline2Items.Name = "blackline" |
2523 | dropdown.BlackOutline2Items.ZIndex = 7 |
2524 | dropdown.BlackOutline2Items.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(6, 6) |
2525 | dropdown.BlackOutline2Items.BorderSizePixel = 0 |
2526 | dropdown.BlackOutline2Items.BackgroundColor3 = window.theme.outlinecolor2 |
2527 | dropdown.BlackOutline2Items.Position = dropdown.ItemsFrame.Position + UDim2.fromOffset(-3, -3) |
2528 | dropdown.BlackOutline2Items.Visible = false |
2529 | updateevent.Event:Connect(function(theme) |
2530 | dropdown.BlackOutline2Items.BackgroundColor3 = theme.outlinecolor2 |
2531 | end) |
2532 | |
2533 | dropdown.OutlineItems = Instance.new("Frame", dropdown.Main) |
2534 | dropdown.OutlineItems.Name = "blackline" |
2535 | dropdown.OutlineItems.ZIndex = 7 |
2536 | dropdown.OutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(4, 4) |
2537 | dropdown.OutlineItems.BorderSizePixel = 0 |
2538 | dropdown.OutlineItems.BackgroundColor3 = window.theme.outlinecolor |
2539 | dropdown.OutlineItems.Position = dropdown.ItemsFrame.Position + UDim2.fromOffset(-2, -2) |
2540 | dropdown.OutlineItems.Visible = false |
2541 | updateevent.Event:Connect(function(theme) |
2542 | dropdown.OutlineItems.BackgroundColor3 = theme.outlinecolor |
2543 | end) |
2544 | |
2545 | dropdown.BlackOutlineItems = Instance.new("Frame", dropdown.Main) |
2546 | dropdown.BlackOutlineItems.Name = "blackline" |
2547 | dropdown.BlackOutlineItems.ZIndex = 7 |
2548 | dropdown.BlackOutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(-2, -2) |
2549 | dropdown.BlackOutlineItems.BorderSizePixel = 0 |
2550 | dropdown.BlackOutlineItems.BackgroundColor3 = window.theme.outlinecolor2 |
2551 | dropdown.BlackOutlineItems.Position = dropdown.ItemsFrame.Position + UDim2.fromOffset(-1, -1) |
2552 | dropdown.BlackOutlineItems.Visible = false |
2553 | updateevent.Event:Connect(function(theme) |
2554 | dropdown.BlackOutlineItems.BackgroundColor3 = theme.outlinecolor2 |
2555 | end) |
2556 | |
2557 | dropdown.IgnoreBackButtons = Instance.new("TextButton", dropdown.Main) |
2558 | dropdown.IgnoreBackButtons.BackgroundTransparency = 1 |
2559 | dropdown.IgnoreBackButtons.BorderSizePixel = 0 |
2560 | dropdown.IgnoreBackButtons.Position = UDim2.fromOffset(0, dropdown.Main.Size.Y.Offset + 8) |
2561 | dropdown.IgnoreBackButtons.Size = UDim2.new(0, 0, 0, 0) |
2562 | dropdown.IgnoreBackButtons.ZIndex = 7 |
2563 | dropdown.IgnoreBackButtons.Text = "" |
2564 | dropdown.IgnoreBackButtons.Visible = false |
2565 | dropdown.IgnoreBackButtons.AutoButtonColor = false |
2566 | |
2567 | if dropdown.flag and dropdown.flag ~= "" then |
2568 | library.flags[dropdown.flag] = dropdown.multichoice and { dropdown.default or dropdown.defaultitems[1] or "" } or (dropdown.default or dropdown.defaultitems[1] or "") |
2569 | end |
2570 | |
2571 | function dropdown:isSelected(item) |
2572 | for i, v in pairs(dropdown.values) do |
2573 | if v == item then |
2574 | return true |
2575 | end |
2576 | end |
2577 | return false |
2578 | end |
2579 | |
2580 | function dropdown:updateText(text) |
2581 | if #text >= 27 then |
2582 | text = text:sub(1, 25) .. ".." |
2583 | end |
2584 | dropdown.SelectedLabel.Text = text |
2585 | end |
2586 | |
2587 | dropdown.Changed = Instance.new("BindableEvent") |
2588 | function dropdown:Set(value) |
2589 | if type(value) == "table" then |
2590 | dropdown.values = value |
2591 | dropdown:updateText(table.concat(value, ", ")) |
2592 | pcall(dropdown.callback, value) |
2593 | else |
2594 | dropdown:updateText(value) |
2595 | dropdown.values = { value } |
2596 | pcall(dropdown.callback, value) |
2597 | end |
2598 | |
2599 | dropdown.Changed:Fire(value) |
2600 | if dropdown.flag and dropdown.flag ~= "" then |
2601 | library.flags[dropdown.flag] = dropdown.multichoice and dropdown.values or dropdown.values[1] |
2602 | end |
2603 | end |
2604 | |
2605 | function dropdown:Get() |
2606 | return dropdown.multichoice and dropdown.values or dropdown.values[1] |
2607 | end |
2608 | |
2609 | dropdown.items = { } |
2610 | function dropdown:Add(v) |
2611 | local Item = Instance.new("TextButton", dropdown.ItemsFrame) |
2612 | Item.BackgroundColor3 = Color3.fromRGB(40, 40, 40) |
2613 | Item.TextColor3 = Color3.fromRGB(255, 255, 255) |
2614 | Item.BorderSizePixel = 0 |
2615 | Item.Position = UDim2.fromOffset(0, 0) |
2616 | Item.Size = UDim2.fromOffset(dropdown.Main.Size.X.Offset - 4, 20) |
2617 | Item.ZIndex = 9 |
2618 | Item.Text = v |
2619 | Item.Name = v |
2620 | Item.AutoButtonColor = false |
2621 | Item.Font = window.theme.font |
2622 | Item.TextSize = 15 |
2623 | Item.TextXAlignment = Enum.TextXAlignment.Left |
2624 | Item.TextStrokeTransparency = 1 |
2625 | dropdown.ItemsFrame.CanvasSize = dropdown.ItemsFrame.CanvasSize + UDim2.fromOffset(0, Item.AbsoluteSize.Y) |
2626 | |
2627 | Item.MouseButton1Down:Connect(function() |
2628 | if dropdown.multichoice then |
2629 | if dropdown:isSelected(v) then |
2630 | for i2, v2 in pairs(dropdown.values) do |
2631 | if v2 == v then |
2632 | table.remove(dropdown.values, i2) |
2633 | end |
2634 | end |
2635 | dropdown:Set(dropdown.values) |
2636 | else |
2637 | table.insert(dropdown.values, v) |
2638 | dropdown:Set(dropdown.values) |
2639 | end |
2640 | |
2641 | return |
2642 | else |
2643 | dropdown.Nav.Rotation = 90 |
2644 | dropdown.ItemsFrame.Visible = false |
2645 | dropdown.ItemsFrame.Active = false |
2646 | dropdown.OutlineItems.Visible = false |
2647 | dropdown.BlackOutlineItems.Visible = false |
2648 | dropdown.BlackOutline2Items.Visible = false |
2649 | dropdown.IgnoreBackButtons.Visible = false |
2650 | dropdown.IgnoreBackButtons.Active = false |
2651 | end |
2652 | |
2653 | dropdown:Set(v) |
2654 | return |
2655 | end) |
2656 | |
2657 | runservice.RenderStepped:Connect(function() |
2658 | if dropdown.multichoice and dropdown:isSelected(v) or dropdown.values[1] == v then |
2659 | Item.BackgroundColor3 = Color3.fromRGB(64, 64, 64) |
2660 | Item.TextColor3 = window.theme.accentcolor |
2661 | Item.Text = " " .. v |
2662 | else |
2663 | Item.BackgroundColor3 = Color3.fromRGB(40, 40, 40) |
2664 | Item.TextColor3 = Color3.fromRGB(255, 255, 255) |
2665 | Item.Text = v |
2666 | end |
2667 | end) |
2668 | |
2669 | table.insert(dropdown.items, v) |
2670 | dropdown.ItemsFrame.Size = UDim2.fromOffset(dropdown.Main.Size.X.Offset, math.clamp(#dropdown.items * Item.AbsoluteSize.Y, 20, 156) + 4) |
2671 | dropdown.ItemsFrame.CanvasSize = UDim2.fromOffset(dropdown.ItemsFrame.AbsoluteSize.X, (#dropdown.items * Item.AbsoluteSize.Y) + 4) |
2672 | |
2673 | dropdown.OutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(4, 4) |
2674 | dropdown.BlackOutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(2, 2) |
2675 | dropdown.BlackOutline2Items.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(6, 6) |
2676 | dropdown.IgnoreBackButtons.Size = dropdown.ItemsFrame.Size |
2677 | end |
2678 | |
2679 | function dropdown:Remove(value) |
2680 | local item = dropdown.ItemsFrame:FindFirstChild(value) |
2681 | if item then |
2682 | for i,v in pairs(dropdown.items) do |
2683 | if v == value then |
2684 | table.remove(dropdown.items, i) |
2685 | end |
2686 | end |
2687 | |
2688 | dropdown.ItemsFrame.Size = UDim2.fromOffset(dropdown.Main.Size.X.Offset, math.clamp(#dropdown.items * item.AbsoluteSize.Y, 20, 156) + 4) |
2689 | dropdown.ItemsFrame.CanvasSize = UDim2.fromOffset(dropdown.ItemsFrame.AbsoluteSize.X, (#dropdown.items * item.AbsoluteSize.Y) + 4) |
2690 | |
2691 | dropdown.OutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(2, 2) |
2692 | dropdown.BlackOutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(4, 4) |
2693 | dropdown.BlackOutline2Items.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(6, 6) |
2694 | dropdown.IgnoreBackButtons.Size = dropdown.ItemsFrame.Size |
2695 | |
2696 | item:Remove() |
2697 | end |
2698 | end |
2699 | |
2700 | for i,v in pairs(dropdown.defaultitems) do |
2701 | dropdown:Add(v) |
2702 | end |
2703 | |
2704 | if dropdown.default then |
2705 | dropdown:Set(dropdown.default) |
2706 | end |
2707 | |
2708 | local MouseButton1Down = function() |
2709 | if dropdown.Nav.Rotation == 90 then |
2710 | dropdown.ItemsFrame.ScrollingEnabled = true |
2711 | sector.Main.Parent.ScrollingEnabled = false |
2712 | tweenservice:Create(dropdown.Nav, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { Rotation = -90 }):Play() |
2713 | dropdown.ItemsFrame.Visible = true |
2714 | dropdown.ItemsFrame.Active = true |
2715 | dropdown.IgnoreBackButtons.Visible = true |
2716 | dropdown.IgnoreBackButtons.Active = true |
2717 | dropdown.OutlineItems.Visible = true |
2718 | dropdown.BlackOutlineItems.Visible = true |
2719 | dropdown.BlackOutline2Items.Visible = true |
2720 | else |
2721 | dropdown.ItemsFrame.ScrollingEnabled = false |
2722 | sector.Main.Parent.ScrollingEnabled = true |
2723 | tweenservice:Create(dropdown.Nav, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { Rotation = 90 }):Play() |
2724 | dropdown.ItemsFrame.Visible = false |
2725 | dropdown.ItemsFrame.Active = false |
2726 | dropdown.IgnoreBackButtons.Visible = false |
2727 | dropdown.IgnoreBackButtons.Active = false |
2728 | dropdown.OutlineItems.Visible = false |
2729 | dropdown.BlackOutlineItems.Visible = false |
2730 | dropdown.BlackOutline2Items.Visible = false |
2731 | end |
2732 | end |
2733 | |
2734 | dropdown.Main.MouseButton1Down:Connect(MouseButton1Down) |
2735 | dropdown.Nav.MouseButton1Down:Connect(MouseButton1Down) |
2736 | |
2737 | dropdown.BlackOutline2.MouseEnter:Connect(function() |
2738 | dropdown.BlackOutline2.BackgroundColor3 = window.theme.accentcolor |
2739 | end) |
2740 | dropdown.BlackOutline2.MouseLeave:Connect(function() |
2741 | dropdown.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
2742 | end) |
2743 | |
2744 | sector:FixSize() |
2745 | table.insert(library.items, dropdown) |
2746 | return dropdown |
2747 | end |
2748 | |
2749 | local dragging_selector = false |
2750 | local dragging_hue = false |
2751 | |
2752 | colorpicker.selector.InputBegan:Connect(function(input) |
2753 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
2754 | dragging_selector = true |
2755 | colorpicker:RefreshSelector() |
2756 | end |
2757 | end) |
2758 | |
2759 | colorpicker.selector.InputEnded:Connect(function(input) |
2760 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
2761 | dragging_selector = false |
2762 | colorpicker:RefreshSelector() |
2763 | end |
2764 | end) |
2765 | |
2766 | colorpicker.hue.InputBegan:Connect(function(input) |
2767 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
2768 | dragging_hue = true |
2769 | colorpicker:RefreshHue() |
2770 | end |
2771 | end) |
2772 | |
2773 | colorpicker.hue.InputEnded:Connect(function(input) |
2774 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
2775 | dragging_hue = false |
2776 | colorpicker:RefreshHue() |
2777 | end |
2778 | end) |
2779 | |
2780 | uis.InputChanged:Connect(function(input) |
2781 | if dragging_selector and input.UserInputType == Enum.UserInputType.MouseMovement then |
2782 | colorpicker:RefreshSelector() |
2783 | end |
2784 | if dragging_hue and input.UserInputType == Enum.UserInputType.MouseMovement then |
2785 | colorpicker:RefreshHue() |
2786 | end |
2787 | end) |
2788 | |
2789 | local inputBegan = function(input) |
2790 | if input.UserInputType == Enum.UserInputType.MouseButton1 then |
2791 | for i,v in pairs(window.OpenedColorPickers) do |
2792 | if v and i ~= colorpicker.MainPicker then |
2793 | i.Visible = false |
2794 | window.OpenedColorPickers[i] = false |
2795 | end |
2796 | end |
2797 | |
2798 | colorpicker.MainPicker.Visible = not colorpicker.MainPicker.Visible |
2799 | window.OpenedColorPickers[colorpicker.MainPicker] = colorpicker.MainPicker.Visible |
2800 | if window.OpenedColorPickers[colorpicker.MainPicker] then |
2801 | colorpicker.BlackOutline2.BackgroundColor3 = window.theme.accentcolor |
2802 | else |
2803 | colorpicker.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
2804 | end |
2805 | end |
2806 | end |
2807 | |
2808 | colorpicker.Main.InputBegan:Connect(inputBegan) |
2809 | colorpicker.Outline.InputBegan:Connect(inputBegan) |
2810 | colorpicker.BlackOutline2.InputBegan:Connect(inputBegan) |
2811 | |
2812 | sector:FixSize() |
2813 | table.insert(library.items, colorpicker) |
2814 | return colorpicker |
2815 | end |
2816 | |
2817 | function sector:AddKeybind(text,default,newkeycallback,callback,flag) |
2818 | local keybind = { } |
2819 | |
2820 | keybind.text = text or "" |
2821 | keybind.default = default or "None" |
2822 | keybind.callback = callback or function() end |
2823 | keybind.newkeycallback = newkeycallback or function(key) end |
2824 | keybind.flag = flag or text or "" |
2825 | |
2826 | keybind.value = keybind.default |
2827 | |
2828 | keybind.Main = Instance.new("TextLabel", sector.Items) |
2829 | keybind.Main.BackgroundTransparency = 1 |
2830 | keybind.Main.Size = UDim2.fromOffset(156, 10) |
2831 | keybind.Main.ZIndex = 4 |
2832 | keybind.Main.Font = window.theme.font |
2833 | keybind.Main.Text = keybind.text |
2834 | keybind.Main.TextColor3 = window.theme.itemscolor |
2835 | keybind.Main.TextSize = 15 |
2836 | keybind.Main.TextStrokeTransparency = 1 |
2837 | keybind.Main.TextXAlignment = Enum.TextXAlignment.Left |
2838 | updateevent.Event:Connect(function(theme) |
2839 | keybind.Main.Font = theme.font |
2840 | keybind.Main.TextColor3 = theme.itemscolor |
2841 | end) |
2842 | |
2843 | keybind.Bind = Instance.new("TextButton", keybind.Main) |
2844 | keybind.Bind.Name = "keybind" |
2845 | keybind.Bind.BackgroundTransparency = 1 |
2846 | keybind.Bind.BorderColor3 = window.theme.outlinecolor |
2847 | keybind.Bind.ZIndex = 5 |
2848 | keybind.Bind.BorderSizePixel = 0 |
2849 | keybind.Bind.Position = UDim2.fromOffset(sector.Main.Size.X.Offset - 10, 0) |
2850 | keybind.Bind.Font = window.theme.font |
2851 | keybind.Bind.TextColor3 = Color3.fromRGB(136, 136, 136) |
2852 | keybind.Bind.TextSize = 15 |
2853 | keybind.Bind.TextXAlignment = Enum.TextXAlignment.Right |
2854 | keybind.Bind.MouseButton1Down:Connect(function() |
2855 | keybind.Bind.Text = "[...]" |
2856 | keybind.Bind.TextColor3 = window.theme.accentcolor |
2857 | end) |
2858 | updateevent.Event:Connect(function(theme) |
2859 | keybind.Bind.BorderColor3 = theme.outlinecolor |
2860 | keybind.Bind.Font = theme.font |
2861 | end) |
2862 | |
2863 | if keybind.flag and keybind.flag ~= "" then |
2864 | library.flags[keybind.flag] = keybind.default |
2865 | end |
2866 | |
2867 | local shorter_keycodes = { |
2868 | ["LeftShift"] = "LSHIFT", |
2869 | ["RightShift"] = "RSHIFT", |
2870 | ["LeftControl"] = "LCTRL", |
2871 | ["RightControl"] = "RCTRL", |
2872 | ["LeftAlt"] = "LALT", |
2873 | ["RightAlt"] = "RALT" |
2874 | } |
2875 | |
2876 | function keybind:Set(value) |
2877 | if value == "None" then |
2878 | keybind.value = value |
2879 | keybind.Bind.Text = "[" .. value .. "]" |
2880 | |
2881 | local size = textservice:GetTextSize(keybind.Bind.Text, keybind.Bind.TextSize, keybind.Bind.Font, Vector2.new(2000, 2000)) |
2882 | keybind.Bind.Size = UDim2.fromOffset(size.X, size.Y) |
2883 | keybind.Bind.Position = UDim2.fromOffset(sector.Main.Size.X.Offset - 10 - keybind.Bind.AbsoluteSize.X, 0) |
2884 | if keybind.flag and keybind.flag ~= "" then |
2885 | library.flags[keybind.flag] = value |
2886 | end |
2887 | pcall(keybind.newkeycallback, value) |
2888 | end |
2889 | |
2890 | keybind.value = value |
2891 | keybind.Bind.Text = "[" .. (shorter_keycodes[value.Name or value] or (value.Name or value)) .. "]" |
2892 | |
2893 | local size = textservice:GetTextSize(keybind.Bind.Text, keybind.Bind.TextSize, keybind.Bind.Font, Vector2.new(2000, 2000)) |
2894 | keybind.Bind.Size = UDim2.fromOffset(size.X, size.Y) |
2895 | keybind.Bind.Position = UDim2.fromOffset(sector.Main.Size.X.Offset - 10 - keybind.Bind.AbsoluteSize.X, 0) |
2896 | if keybind.flag and keybind.flag ~= "" then |
2897 | library.flags[keybind.flag] = value |
2898 | end |
2899 | pcall(keybind.newkeycallback, value) |
2900 | end |
2901 | keybind:Set(keybind.default and keybind.default or "None") |
2902 | |
2903 | function keybind:Get() |
2904 | return keybind.value |
2905 | end |
2906 | |
2907 | uis.InputBegan:Connect(function(input, gameProcessed) |
2908 | if not gameProcessed then |
2909 | if keybind.Bind.Text == "[...]" then |
2910 | keybind.Bind.TextColor3 = Color3.fromRGB(136, 136, 136) |
2911 | if input.UserInputType == Enum.UserInputType.Keyboard then |
2912 | keybind:Set(input.KeyCode) |
2913 | else |
2914 | keybind:Set("None") |
2915 | end |
2916 | else |
2917 | if keybind.value ~= "None" and input.KeyCode == keybind.value then |
2918 | pcall(keybind.callback) |
2919 | end |
2920 | end |
2921 | end |
2922 | end) |
2923 | |
2924 | sector:FixSize() |
2925 | table.insert(library.items, keybind) |
2926 | return keybind |
2927 | end |
2928 | |
2929 | function sector:AddDropdown(text, items, default, multichoice, callback, flag) |
2930 | local dropdown = { } |
2931 | |
2932 | dropdown.text = text or "" |
2933 | dropdown.defaultitems = items or { } |
2934 | dropdown.default = default |
2935 | dropdown.callback = callback or function() end |
2936 | dropdown.multichoice = multichoice or false |
2937 | dropdown.values = { } |
2938 | dropdown.flag = flag or text or "" |
2939 | |
2940 | dropdown.MainBack = Instance.new("Frame", sector.Items) |
2941 | dropdown.MainBack.Name = "backlabel" |
2942 | dropdown.MainBack.ZIndex = 7 |
2943 | dropdown.MainBack.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 12, 34) |
2944 | dropdown.MainBack.BorderSizePixel = 0 |
2945 | dropdown.MainBack.BackgroundTransparency = 1 |
2946 | |
2947 | dropdown.Label = Instance.new("TextLabel", dropdown.MainBack) |
2948 | dropdown.Label.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
2949 | dropdown.Label.BackgroundTransparency = 1 |
2950 | dropdown.Label.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 12, 10) |
2951 | dropdown.Label.Position = UDim2.fromOffset(0, 0) |
2952 | dropdown.Label.Font = window.theme.font |
2953 | dropdown.Label.Text = dropdown.text |
2954 | dropdown.Label.ZIndex = 4 |
2955 | dropdown.Label.TextColor3 = window.theme.itemscolor |
2956 | dropdown.Label.TextSize = 15 |
2957 | dropdown.Label.TextStrokeTransparency = 1 |
2958 | dropdown.Label.TextXAlignment = Enum.TextXAlignment.Left |
2959 | |
2960 | updateevent.Event:Connect(function(theme) |
2961 | dropdown.Label.Font = theme.font |
2962 | dropdown.Label.TextColor3 = theme.itemscolor |
2963 | end) |
2964 | |
2965 | dropdown.Main = Instance.new("TextButton", dropdown.MainBack) |
2966 | dropdown.Main.Name = "dropdown" |
2967 | dropdown.Main.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
2968 | dropdown.Main.BorderSizePixel = 0 |
2969 | dropdown.Main.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 12, 16) |
2970 | dropdown.Main.Position = UDim2.fromOffset(0, 17) |
2971 | dropdown.Main.ZIndex = 5 |
2972 | dropdown.Main.AutoButtonColor = false |
2973 | dropdown.Main.Font = window.theme.font |
2974 | dropdown.Main.Text = "" |
2975 | dropdown.Main.TextColor3 = Color3.fromRGB(255, 255, 255) |
2976 | dropdown.Main.TextSize = 15 |
2977 | dropdown.Main.TextXAlignment = Enum.TextXAlignment.Left |
2978 | updateevent.Event:Connect(function(theme) |
2979 | dropdown.Main.Font = theme.font |
2980 | end) |
2981 | |
2982 | dropdown.Gradient = Instance.new("UIGradient", dropdown.Main) |
2983 | dropdown.Gradient.Rotation = 90 |
2984 | dropdown.Gradient.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(49, 49, 49)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(39, 39, 39))} |
2985 | |
2986 | dropdown.SelectedLabel = Instance.new("TextLabel", dropdown.Main) |
2987 | dropdown.SelectedLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255) |
2988 | dropdown.SelectedLabel.BackgroundTransparency = 1 |
2989 | dropdown.SelectedLabel.Position = UDim2.fromOffset(5, 2) |
2990 | dropdown.SelectedLabel.Size = UDim2.fromOffset(130, 13) |
2991 | dropdown.SelectedLabel.Font = window.theme.font |
2992 | dropdown.SelectedLabel.Text = dropdown.text |
2993 | dropdown.SelectedLabel.ZIndex = 5 |
2994 | dropdown.SelectedLabel.TextColor3 = Color3.fromRGB(255, 255, 255) |
2995 | dropdown.SelectedLabel.TextSize = 15 |
2996 | dropdown.SelectedLabel.TextStrokeTransparency = 1 |
2997 | dropdown.SelectedLabel.TextXAlignment = Enum.TextXAlignment.Left |
2998 | updateevent.Event:Connect(function(theme) |
2999 | dropdown.SelectedLabel.Font = theme.font |
3000 | end) |
3001 | |
3002 | dropdown.Nav = Instance.new("ImageButton", dropdown.Main) |
3003 | dropdown.Nav.Name = "navigation" |
3004 | dropdown.Nav.BackgroundTransparency = 1 |
3005 | dropdown.Nav.LayoutOrder = 10 |
3006 | dropdown.Nav.Position = UDim2.fromOffset(sector.Main.Size.X.Offset - 26, 5) |
3007 | dropdown.Nav.Rotation = 90 |
3008 | dropdown.Nav.ZIndex = 5 |
3009 | dropdown.Nav.Size = UDim2.fromOffset(8, 8) |
3010 | dropdown.Nav.Image = "rbxassetid://4918373417" |
3011 | dropdown.Nav.ImageColor3 = Color3.fromRGB(210, 210, 210) |
3012 | |
3013 | dropdown.BlackOutline2 = Instance.new("Frame", dropdown.Main) |
3014 | dropdown.BlackOutline2.Name = "blackline" |
3015 | dropdown.BlackOutline2.ZIndex = 4 |
3016 | dropdown.BlackOutline2.Size = dropdown.Main.Size + UDim2.fromOffset(6, 6) |
3017 | dropdown.BlackOutline2.BorderSizePixel = 0 |
3018 | dropdown.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
3019 | dropdown.BlackOutline2.Position = UDim2.fromOffset(-3, -3) |
3020 | updateevent.Event:Connect(function(theme) |
3021 | dropdown.BlackOutline2.BackgroundColor3 = theme.outlinecolor2 |
3022 | end) |
3023 | |
3024 | dropdown.Outline = Instance.new("Frame", dropdown.Main) |
3025 | dropdown.Outline.Name = "blackline" |
3026 | dropdown.Outline.ZIndex = 4 |
3027 | dropdown.Outline.Size = dropdown.Main.Size + UDim2.fromOffset(4, 4) |
3028 | dropdown.Outline.BorderSizePixel = 0 |
3029 | dropdown.Outline.BackgroundColor3 = window.theme.outlinecolor |
3030 | dropdown.Outline.Position = UDim2.fromOffset(-2, -2) |
3031 | updateevent.Event:Connect(function(theme) |
3032 | dropdown.Outline.BackgroundColor3 = theme.outlinecolor |
3033 | end) |
3034 | |
3035 | dropdown.BlackOutline = Instance.new("Frame", dropdown.Main) |
3036 | dropdown.BlackOutline.Name = "blackline" |
3037 | dropdown.BlackOutline.ZIndex = 4 |
3038 | dropdown.BlackOutline.Size = dropdown.Main.Size + UDim2.fromOffset(2, 2) |
3039 | dropdown.BlackOutline.BorderSizePixel = 0 |
3040 | dropdown.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2 |
3041 | dropdown.BlackOutline.Position = UDim2.fromOffset(-1, -1) |
3042 | updateevent.Event:Connect(function(theme) |
3043 | dropdown.BlackOutline.BackgroundColor3 = theme.outlinecolor2 |
3044 | end) |
3045 | |
3046 | dropdown.ItemsFrame = Instance.new("ScrollingFrame", dropdown.Main) |
3047 | dropdown.ItemsFrame.Name = "itemsframe" |
3048 | dropdown.ItemsFrame.BorderSizePixel = 0 |
3049 | dropdown.ItemsFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40) |
3050 | dropdown.ItemsFrame.Position = UDim2.fromOffset(0, dropdown.Main.Size.Y.Offset + 8) |
3051 | dropdown.ItemsFrame.ScrollBarThickness = 2 |
3052 | dropdown.ItemsFrame.ZIndex = 8 |
3053 | dropdown.ItemsFrame.ScrollingDirection = "Y" |
3054 | dropdown.ItemsFrame.Visible = false |
3055 | dropdown.ItemsFrame.CanvasSize = UDim2.fromOffset(dropdown.Main.AbsoluteSize.X, 0) |
3056 | |
3057 | dropdown.ListLayout = Instance.new("UIListLayout", dropdown.ItemsFrame) |
3058 | dropdown.ListLayout.FillDirection = Enum.FillDirection.Vertical |
3059 | dropdown.ListLayout.SortOrder = Enum.SortOrder.LayoutOrder |
3060 | |
3061 | dropdown.ListPadding = Instance.new("UIPadding", dropdown.ItemsFrame) |
3062 | dropdown.ListPadding.PaddingTop = UDim.new(0, 2) |
3063 | dropdown.ListPadding.PaddingBottom = UDim.new(0, 2) |
3064 | dropdown.ListPadding.PaddingLeft = UDim.new(0, 2) |
3065 | dropdown.ListPadding.PaddingRight = UDim.new(0, 2) |
3066 | |
3067 | dropdown.BlackOutline2Items = Instance.new("Frame", dropdown.Main) |
3068 | dropdown.BlackOutline2Items.Name = "blackline" |
3069 | dropdown.BlackOutline2Items.ZIndex = 7 |
3070 | dropdown.BlackOutline2Items.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(6, 6) |
3071 | dropdown.BlackOutline2Items.BorderSizePixel = 0 |
3072 | dropdown.BlackOutline2Items.BackgroundColor3 = window.theme.outlinecolor2 |
3073 | dropdown.BlackOutline2Items.Position = dropdown.ItemsFrame.Position + UDim2.fromOffset(-3, -3) |
3074 | dropdown.BlackOutline2Items.Visible = false |
3075 | updateevent.Event:Connect(function(theme) |
3076 | dropdown.BlackOutline2Items.BackgroundColor3 = theme.outlinecolor2 |
3077 | end) |
3078 | |
3079 | dropdown.OutlineItems = Instance.new("Frame", dropdown.Main) |
3080 | dropdown.OutlineItems.Name = "blackline" |
3081 | dropdown.OutlineItems.ZIndex = 7 |
3082 | dropdown.OutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(4, 4) |
3083 | dropdown.OutlineItems.BorderSizePixel = 0 |
3084 | dropdown.OutlineItems.BackgroundColor3 = window.theme.outlinecolor |
3085 | dropdown.OutlineItems.Position = dropdown.ItemsFrame.Position + UDim2.fromOffset(-2, -2) |
3086 | dropdown.OutlineItems.Visible = false |
3087 | updateevent.Event:Connect(function(theme) |
3088 | dropdown.OutlineItems.BackgroundColor3 = theme.outlinecolor |
3089 | end) |
3090 | |
3091 | dropdown.BlackOutlineItems = Instance.new("Frame", dropdown.Main) |
3092 | dropdown.BlackOutlineItems.Name = "blackline" |
3093 | dropdown.BlackOutlineItems.ZIndex = 7 |
3094 | dropdown.BlackOutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(-2, -2) |
3095 | dropdown.BlackOutlineItems.BorderSizePixel = 0 |
3096 | dropdown.BlackOutlineItems.BackgroundColor3 = window.theme.outlinecolor2 |
3097 | dropdown.BlackOutlineItems.Position = dropdown.ItemsFrame.Position + UDim2.fromOffset(-1, -1) |
3098 | dropdown.BlackOutlineItems.Visible = false |
3099 | updateevent.Event:Connect(function(theme) |
3100 | dropdown.BlackOutlineItems.BackgroundColor3 = theme.outlinecolor2 |
3101 | end) |
3102 | |
3103 | dropdown.IgnoreBackButtons = Instance.new("TextButton", dropdown.Main) |
3104 | dropdown.IgnoreBackButtons.BackgroundTransparency = 1 |
3105 | dropdown.IgnoreBackButtons.BorderSizePixel = 0 |
3106 | dropdown.IgnoreBackButtons.Position = UDim2.fromOffset(0, dropdown.Main.Size.Y.Offset + 8) |
3107 | dropdown.IgnoreBackButtons.Size = UDim2.new(0, 0, 0, 0) |
3108 | dropdown.IgnoreBackButtons.ZIndex = 7 |
3109 | dropdown.IgnoreBackButtons.Text = "" |
3110 | dropdown.IgnoreBackButtons.Visible = false |
3111 | dropdown.IgnoreBackButtons.AutoButtonColor = false |
3112 | |
3113 | if dropdown.flag and dropdown.flag ~= "" then |
3114 | library.flags[dropdown.flag] = dropdown.multichoice and { dropdown.default or dropdown.defaultitems[1] or "" } or (dropdown.default or dropdown.defaultitems[1] or "") |
3115 | end |
3116 | |
3117 | function dropdown:isSelected(item) |
3118 | for i, v in pairs(dropdown.values) do |
3119 | if v == item then |
3120 | return true |
3121 | end |
3122 | end |
3123 | return false |
3124 | end |
3125 | |
3126 | function dropdown:GetOptions() |
3127 | return dropdown.values |
3128 | end |
3129 | |
3130 | function dropdown:updateText(text) |
3131 | if #text >= 27 then |
3132 | text = text:sub(1, 25) .. ".." |
3133 | end |
3134 | dropdown.SelectedLabel.Text = text |
3135 | end |
3136 | |
3137 | dropdown.Changed = Instance.new("BindableEvent") |
3138 | function dropdown:Set(value) |
3139 | if type(value) == "table" then |
3140 | dropdown.values = value |
3141 | dropdown:updateText(table.concat(value, ", ")) |
3142 | pcall(dropdown.callback, value) |
3143 | else |
3144 | dropdown:updateText(value) |
3145 | dropdown.values = { value } |
3146 | pcall(dropdown.callback, value) |
3147 | end |
3148 | |
3149 | dropdown.Changed:Fire(value) |
3150 | if dropdown.flag and dropdown.flag ~= "" then |
3151 | library.flags[dropdown.flag] = dropdown.multichoice and dropdown.values or dropdown.values[1] |
3152 | end |
3153 | end |
3154 | |
3155 | function dropdown:Get() |
3156 | return dropdown.multichoice and dropdown.values or dropdown.values[1] |
3157 | end |
3158 | |
3159 | dropdown.items = { } |
3160 | function dropdown:Add(v) |
3161 | local Item = Instance.new("TextButton", dropdown.ItemsFrame) |
3162 | Item.BackgroundColor3 = Color3.fromRGB(40, 40, 40) |
3163 | Item.TextColor3 = Color3.fromRGB(255, 255, 255) |
3164 | Item.BorderSizePixel = 0 |
3165 | Item.Position = UDim2.fromOffset(0, 0) |
3166 | Item.Size = UDim2.fromOffset(dropdown.Main.Size.X.Offset - 4, 20) |
3167 | Item.ZIndex = 9 |
3168 | Item.Text = v |
3169 | Item.Name = v |
3170 | Item.AutoButtonColor = false |
3171 | Item.Font = window.theme.font |
3172 | Item.TextSize = 15 |
3173 | Item.TextXAlignment = Enum.TextXAlignment.Left |
3174 | Item.TextStrokeTransparency = 1 |
3175 | dropdown.ItemsFrame.CanvasSize = dropdown.ItemsFrame.CanvasSize + UDim2.fromOffset(0, Item.AbsoluteSize.Y) |
3176 | |
3177 | Item.MouseButton1Down:Connect(function() |
3178 | if dropdown.multichoice then |
3179 | if dropdown:isSelected(v) then |
3180 | for i2, v2 in pairs(dropdown.values) do |
3181 | if v2 == v then |
3182 | table.remove(dropdown.values, i2) |
3183 | end |
3184 | end |
3185 | dropdown:Set(dropdown.values) |
3186 | else |
3187 | table.insert(dropdown.values, v) |
3188 | dropdown:Set(dropdown.values) |
3189 | end |
3190 | |
3191 | return |
3192 | else |
3193 | dropdown.Nav.Rotation = 90 |
3194 | dropdown.ItemsFrame.Visible = false |
3195 | dropdown.ItemsFrame.Active = false |
3196 | dropdown.OutlineItems.Visible = false |
3197 | dropdown.BlackOutlineItems.Visible = false |
3198 | dropdown.BlackOutline2Items.Visible = false |
3199 | dropdown.IgnoreBackButtons.Visible = false |
3200 | dropdown.IgnoreBackButtons.Active = false |
3201 | end |
3202 | |
3203 | dropdown:Set(v) |
3204 | return |
3205 | end) |
3206 | |
3207 | runservice.RenderStepped:Connect(function() |
3208 | if dropdown.multichoice and dropdown:isSelected(v) or dropdown.values[1] == v then |
3209 | Item.BackgroundColor3 = Color3.fromRGB(64, 64, 64) |
3210 | Item.TextColor3 = window.theme.accentcolor |
3211 | Item.Text = " " .. v |
3212 | else |
3213 | Item.BackgroundColor3 = Color3.fromRGB(40, 40, 40) |
3214 | Item.TextColor3 = Color3.fromRGB(255, 255, 255) |
3215 | Item.Text = v |
3216 | end |
3217 | end) |
3218 | |
3219 | table.insert(dropdown.items, v) |
3220 | dropdown.ItemsFrame.Size = UDim2.fromOffset(dropdown.Main.Size.X.Offset, math.clamp(#dropdown.items * Item.AbsoluteSize.Y, 20, 156) + 4) |
3221 | dropdown.ItemsFrame.CanvasSize = UDim2.fromOffset(dropdown.ItemsFrame.AbsoluteSize.X, (#dropdown.items * Item.AbsoluteSize.Y) + 4) |
3222 | |
3223 | dropdown.OutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(4, 4) |
3224 | dropdown.BlackOutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(2, 2) |
3225 | dropdown.BlackOutline2Items.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(6, 6) |
3226 | dropdown.IgnoreBackButtons.Size = dropdown.ItemsFrame.Size |
3227 | end |
3228 | |
3229 | function dropdown:Remove(value) |
3230 | local item = dropdown.ItemsFrame:FindFirstChild(value) |
3231 | if item then |
3232 | for i,v in pairs(dropdown.items) do |
3233 | if v == value then |
3234 | table.remove(dropdown.items, i) |
3235 | end |
3236 | end |
3237 | |
3238 | dropdown.ItemsFrame.Size = UDim2.fromOffset(dropdown.Main.Size.X.Offset, math.clamp(#dropdown.items * item.AbsoluteSize.Y, 20, 156) + 4) |
3239 | dropdown.ItemsFrame.CanvasSize = UDim2.fromOffset(dropdown.ItemsFrame.AbsoluteSize.X, (#dropdown.items * item.AbsoluteSize.Y) + 4) |
3240 | |
3241 | dropdown.OutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(2, 2) |
3242 | dropdown.BlackOutlineItems.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(4, 4) |
3243 | dropdown.BlackOutline2Items.Size = dropdown.ItemsFrame.Size + UDim2.fromOffset(6, 6) |
3244 | dropdown.IgnoreBackButtons.Size = dropdown.ItemsFrame.Size |
3245 | |
3246 | item:Remove() |
3247 | end |
3248 | end |
3249 | |
3250 | for i,v in pairs(dropdown.defaultitems) do |
3251 | dropdown:Add(v) |
3252 | end |
3253 | |
3254 | if dropdown.default then |
3255 | dropdown:Set(dropdown.default) |
3256 | end |
3257 | |
3258 | local MouseButton1Down = function() |
3259 | if dropdown.Nav.Rotation == 90 then |
3260 | tweenservice:Create(dropdown.Nav, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { Rotation = -90 }):Play() |
3261 | if dropdown.items and #dropdown.items ~= 0 then |
3262 | dropdown.ItemsFrame.ScrollingEnabled = true |
3263 | sector.Main.Parent.ScrollingEnabled = false |
3264 | dropdown.ItemsFrame.Visible = true |
3265 | dropdown.ItemsFrame.Active = true |
3266 | dropdown.IgnoreBackButtons.Visible = true |
3267 | dropdown.IgnoreBackButtons.Active = true |
3268 | dropdown.OutlineItems.Visible = true |
3269 | dropdown.BlackOutlineItems.Visible = true |
3270 | dropdown.BlackOutline2Items.Visible = true |
3271 | end |
3272 | else |
3273 | tweenservice:Create(dropdown.Nav, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { Rotation = 90 }):Play() |
3274 | dropdown.ItemsFrame.ScrollingEnabled = false |
3275 | sector.Main.Parent.ScrollingEnabled = true |
3276 | dropdown.ItemsFrame.Visible = false |
3277 | dropdown.ItemsFrame.Active = false |
3278 | dropdown.IgnoreBackButtons.Visible = false |
3279 | dropdown.IgnoreBackButtons.Active = false |
3280 | dropdown.OutlineItems.Visible = false |
3281 | dropdown.BlackOutlineItems.Visible = false |
3282 | dropdown.BlackOutline2Items.Visible = false |
3283 | end |
3284 | end |
3285 | |
3286 | dropdown.Main.MouseButton1Down:Connect(MouseButton1Down) |
3287 | dropdown.Nav.MouseButton1Down:Connect(MouseButton1Down) |
3288 | |
3289 | dropdown.BlackOutline2.MouseEnter:Connect(function() |
3290 | dropdown.BlackOutline2.BackgroundColor3 = window.theme.accentcolor |
3291 | end) |
3292 | dropdown.BlackOutline2.MouseLeave:Connect(function() |
3293 | dropdown.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2 |
3294 | end) |
3295 | |
3296 | sector:FixSize() |
3297 | table.insert(library.items, dropdown) |
3298 | return dropdown |
3299 | end |
3300 | |
3301 | function sector:AddSeperator(text) |
3302 | local seperator = { } |
3303 | seperator.text = text or "" |
3304 | |
3305 | seperator.main = Instance.new("Frame", sector.Items) |
3306 | seperator.main.Name = "Main" |
3307 | seperator.main.ZIndex = 5 |
3308 | seperator.main.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 12, 10) |
3309 | seperator.main.BorderSizePixel = 0 |
3310 | seperator.main.BackgroundTransparency = 1 |
3311 | |
3312 | seperator.line = Instance.new("Frame", seperator.main) |
3313 | seperator.line.Name = "Line" |
3314 | seperator.line.ZIndex = 7 |
3315 | seperator.line.BackgroundColor3 = Color3.fromRGB(70, 70, 70) |
3316 | seperator.line.BorderSizePixel = 0 |
3317 | seperator.line.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 26, 1) |
3318 | seperator.line.Position = UDim2.fromOffset(7, 5) |
3319 | |
3320 | seperator.outline = Instance.new("Frame", seperator.line) |
3321 | seperator.outline.Name = "Outline" |
3322 | seperator.outline.ZIndex = 6 |
3323 | seperator.outline.BorderSizePixel = 0 |
3324 | seperator.outline.BackgroundColor3 = window.theme.outlinecolor2 |
3325 | seperator.outline.Position = UDim2.fromOffset(-1, -1) |
3326 | seperator.outline.Size = seperator.line.Size - UDim2.fromOffset(-2, -2) |
3327 | updateevent.Event:Connect(function(theme) |
3328 | seperator.outline.BackgroundColor3 = theme.outlinecolor2 |
3329 | end) |
3330 | |
3331 | seperator.label = Instance.new("TextLabel", seperator.main) |
3332 | seperator.label.Name = "Label" |
3333 | seperator.label.BackgroundTransparency = 1 |
3334 | seperator.label.Size = seperator.main.Size |
3335 | seperator.label.Font = window.theme.font |
3336 | seperator.label.ZIndex = 8 |
3337 | seperator.label.Text = seperator.text |
3338 | seperator.label.TextColor3 = Color3.fromRGB(255, 255, 255) |
3339 | seperator.label.TextSize = window.theme.fontsize |
3340 | seperator.label.TextStrokeTransparency = 1 |
3341 | seperator.label.TextXAlignment = Enum.TextXAlignment.Center |
3342 | updateevent.Event:Connect(function(theme) |
3343 | seperator.label.Font = theme.font |
3344 | seperator.label.TextSize = theme.fontsize |
3345 | end) |
3346 | |
3347 | local textSize = textservice:GetTextSize(seperator.text, window.theme.fontsize, window.theme.font, Vector2.new(2000, 2000)) |
3348 | local textStart = seperator.main.AbsoluteSize.X / 2 - (textSize.X / 2) |
3349 | |
3350 | sector.LabelBackFrame = Instance.new("Frame", seperator.main) |
3351 | sector.LabelBackFrame.Name = "LabelBack" |
3352 | sector.LabelBackFrame.ZIndex = 7 |
3353 | sector.LabelBackFrame.Size = UDim2.fromOffset(textSize.X + 12, 10) |
3354 | sector.LabelBackFrame.BorderSizePixel = 0 |
3355 | sector.LabelBackFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) |
3356 | sector.LabelBackFrame.Position = UDim2.new(0, textStart - 6, 0, 0) |
3357 | updateevent.Event:Connect(function(theme) |
3358 | textSize = textservice:GetTextSize(seperator.text, theme.fontsize, theme.font, Vector2.new(2000, 2000)) |
3359 | textStart = seperator.main.AbsoluteSize.X / 2 - (textSize.X / 2) |
3360 | |
3361 | sector.LabelBackFrame.Size = UDim2.fromOffset(textSize.X + 12, 10) |
3362 | sector.LabelBackFrame.Position = UDim2.new(0, textStart - 6, 0, 0) |
3363 | end) |
3364 | |
3365 | sector:FixSize() |
3366 | return seperator |
3367 | end |
3368 | |
3369 | return sector |
3370 | end |
3371 | |
3372 | function tab:CreateConfigSystem(side) |
3373 | local configSystem = { } |
3374 | |
3375 | configSystem.configFolder = window.name .. "/" .. tostring(game.PlaceId) |
3376 | if (not isfolder(configSystem.configFolder)) then |
3377 | makefolder(configSystem.configFolder) |
3378 | end |
3379 | |
3380 | configSystem.sector = tab:CreateSector("Configs", side or "left") |
3381 | |
3382 | local ConfigName = configSystem.sector:AddTextbox("Config Name", "", ConfigName, function() end, "") |
3383 | local default = tostring(listfiles(configSystem.configFolder)[1] or ""):gsub(configSystem.configFolder .. "\\", ""):gsub(".txt", "") |
3384 | local Config = configSystem.sector:AddDropdown("Configs", {}, default, false, function() end, "") |
3385 | for i,v in pairs(listfiles(configSystem.configFolder)) do |
3386 | if v:find(".txt") then |
3387 | Config:Add(tostring(v):gsub(configSystem.configFolder .. "\\", ""):gsub(".txt", "")) |
3388 | end |
3389 | end |
3390 | |
3391 | configSystem.Create = configSystem.sector:AddButton("Create", function() |
3392 | for i,v in pairs(listfiles(configSystem.configFolder)) do |
3393 | Config:Remove(tostring(v):gsub(configSystem.configFolder .. "\\", ""):gsub(".txt", "")) |
3394 | end |
3395 | |
3396 | if ConfigName:Get() and ConfigName:Get() ~= "" then |
3397 | local config = {} |
3398 | |
3399 | for i,v in pairs(library.flags) do |
3400 | if (v ~= nil and v ~= "") then |
3401 | if (typeof(v) == "Color3") then |
3402 | config[i] = { v.R, v.G, v.B } |
3403 | elseif (tostring(v):find("Enum.KeyCode")) then |
3404 | config[i] = v.Name |
3405 | elseif (typeof(v) == "table") then |
3406 | config[i] = { v } |
3407 | else |
3408 | config[i] = v |
3409 | end |
3410 | end |
3411 | end |
3412 | |
3413 | writefile(configSystem.configFolder .. "/" .. ConfigName:Get() .. ".txt", httpservice:JSONEncode(config)) |
3414 | |
3415 | for i,v in pairs(listfiles(configSystem.configFolder)) do |
3416 | if v:find(".txt") then |
3417 | Config:Add(tostring(v):gsub(configSystem.configFolder .. "\\", ""):gsub(".txt", "")) |
3418 | end |
3419 | end |
3420 | end |
3421 | end) |
3422 | |
3423 | configSystem.Save = configSystem.sector:AddButton("Save", function() |
3424 | local config = {} |
3425 | if Config:Get() and Config:Get() ~= "" then |
3426 | for i,v in pairs(library.flags) do |
3427 | if (v ~= nil and v ~= "") then |
3428 | if (typeof(v) == "Color3") then |
3429 | config[i] = { v.R, v.G, v.B } |
3430 | elseif (tostring(v):find("Enum.KeyCode")) then |
3431 | config[i] = "Enum.KeyCode." .. v.Name |
3432 | elseif (typeof(v) == "table") then |
3433 | config[i] = { v } |
3434 | else |
3435 | config[i] = v |
3436 | end |
3437 | end |
3438 | end |
3439 | |
3440 | writefile(configSystem.configFolder .. "/" .. Config:Get() .. ".txt", httpservice:JSONEncode(config)) |
3441 | end |
3442 | end) |
3443 | |
3444 | configSystem.Load = configSystem.sector:AddButton("Load", function() |
3445 | local Success = pcall(readfile, configSystem.configFolder .. "/" .. Config:Get() .. ".txt") |
3446 | if (Success) then |
3447 | pcall(function() |
3448 | local ReadConfig = httpservice:JSONDecode(readfile(configSystem.configFolder .. "/" .. Config:Get() .. ".txt")) |
3449 | local NewConfig = {} |
3450 | |
3451 | for i,v in pairs(ReadConfig) do |
3452 | if (typeof(v) == "table") then |
3453 | if (typeof(v[1]) == "number") then |
3454 | NewConfig[i] = Color3.new(v[1], v[2], v[3]) |
3455 | elseif (typeof(v[1]) == "table") then |
3456 | NewConfig[i] = v[1] |
3457 | end |
3458 | elseif (tostring(v):find("Enum.KeyCode.")) then |
3459 | NewConfig[i] = Enum.KeyCode[tostring(v):gsub("Enum.KeyCode.", "")] |
3460 | else |
3461 | NewConfig[i] = v |
3462 | end |
3463 | end |
3464 | |
3465 | library.flags = NewConfig |
3466 | |
3467 | for i,v in pairs(library.flags) do |
3468 | for i2,v2 in pairs(library.items) do |
3469 | if (i ~= nil and i ~= "" and i ~= "Configs_Name" and i ~= "Configs" and v2.flag ~= nil) then |
3470 | if (v2.flag == i) then |
3471 | pcall(function() |
3472 | v2:Set(v) |
3473 | end) |
3474 | end |
3475 | end |
3476 | end |
3477 | end |
3478 | end) |
3479 | end |
3480 | end) |
3481 | |
3482 | configSystem.Delete = configSystem.sector:AddButton("Delete", function() |
3483 | for i,v in pairs(listfiles(configSystem.configFolder)) do |
3484 | Config:Remove(tostring(v):gsub(configSystem.configFolder .. "\\", ""):gsub(".txt", "")) |
3485 | end |
3486 | |
3487 | if (not Config:Get() or Config:Get() == "") then return end |
3488 | if (not isfile(configSystem.configFolder .. "/" .. Config:Get() .. ".txt")) then return end |
3489 | delfile(configSystem.configFolder .. "/" .. Config:Get() .. ".txt") |
3490 | |
3491 | for i,v in pairs(listfiles(configSystem.configFolder)) do |
3492 | if v:find(".txt") then |
3493 | Config:Add(tostring(v):gsub(configSystem.configFolder .. "\\", ""):gsub(".txt", "")) |
3494 | end |
3495 | end |
3496 | end) |
3497 | |
3498 | return configSystem |
3499 | end |
3500 | |
3501 | --[[ not finished lol |
3502 | function tab:CreatePlayerlist(name) |
3503 | local list = { } |
3504 | list.name = name or "" |
3505 | |
3506 | list.Main = Instance.new("Frame", tab.TabPage) |
3507 | list.Main.Name = list.name:gsub(" ", "") .. "Sector" |
3508 | list.Main.BorderColor3 = window.theme.outlinecolor |
3509 | list.Main.ZIndex = 2 |
3510 | list.Main.Size = UDim2.fromOffset(window.size.X.Offset - 22, 220) |
3511 | list.Main.BackgroundColor3 = window.theme.sectorcolor |
3512 | list.Main.Position = UDim2.new(0, 11, 0, 12) |
3513 | |
3514 | tab.SectorsLeft[#tab.SectorsLeft + 1] = 220 |
3515 | --tab.SectorsRight[#tab.SectorsLeft + 1].space = 220 |
3516 | |
3517 | list.Line = Instance.new("Frame", list.Main) |
3518 | list.Line.Name = "line" |
3519 | list.Line.ZIndex = 2 |
3520 | list.Line.Size = UDim2.fromOffset(list.Main.Size.X.Offset + 2, 1) |
3521 | list.Line.BorderSizePixel = 0 |
3522 | list.Line.Position = UDim2.fromOffset(-1, -1) |
3523 | list.Line.BackgroundColor3 = window.theme.accentcolor |
3524 | |
3525 | list.BlackOutline = Instance.new("Frame", list.Main) |
3526 | list.BlackOutline.Name = "blackline" |
3527 | list.BlackOutline.ZIndex = 1 |
3528 | list.BlackOutline.Size = list.Main.Size + UDim2.fromOffset(4, 4) |
3529 | list.BlackOutline.BorderSizePixel = 0 |
3530 | list.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2 |
3531 | list.BlackOutline.Position = UDim2.fromOffset(-2, -2) |
3532 | |
3533 | local size = textservice:GetTextSize(list.name, 13, window.theme.font, Vector2.new(2000, 2000)) |
3534 | list.Label = Instance.new("TextLabel", list.Main) |
3535 | list.Label.AnchorPoint = Vector2.new(0,0.5) |
3536 | list.Label.Position = UDim2.fromOffset(12, -1) |
3537 | list.Label.Size = UDim2.fromOffset(math.clamp(textservice:GetTextSize(list.name, 13, window.theme.font, Vector2.new(200,300)).X + 10, 0, list.Main.Size.X.Offset), size.Y) |
3538 | list.Label.BackgroundTransparency = 1 |
3539 | list.Label.BorderSizePixel = 0 |
3540 | list.Label.ZIndex = 4 |
3541 | list.Label.Text = list.name |
3542 | list.Label.TextColor3 = Color3.new(1,1,2552/255) |
3543 | list.Label.TextStrokeTransparency = 1 |
3544 | list.Label.Font = window.theme.font |
3545 | list.Label.TextSize = 13 |
3546 | |
3547 | list.LabelBackFrame = Instance.new("Frame", list.Label) |
3548 | list.LabelBackFrame.Name = "labelframe" |
3549 | list.LabelBackFrame.ZIndex = 3 |
3550 | list.LabelBackFrame.Size = UDim2.fromOffset(list.Label.Size.X.Offset, 10) |
3551 | list.LabelBackFrame.BorderSizePixel = 0 |
3552 | list.LabelBackFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) |
3553 | list.LabelBackFrame.Position = UDim2.fromOffset(0, 6) |
3554 | |
3555 | list.Items = Instance.new("ScrollingFrame", list.Main) |
3556 | list.Items.Name = "items" |
3557 | list.Items.ZIndex = 2 |
3558 | list.Items.ScrollBarThickness = 1 |
3559 | list.Items.BackgroundTransparency = 1 |
3560 | list.Items.Size = list.Main.Size - UDim2.fromOffset(10, 15) |
3561 | list.Items.ScrollingDirection = "Y" |
3562 | list.Items.BorderSizePixel = 0 |
3563 | list.Items.Position = UDim2.fromOffset(5, 10) |
3564 | list.Items.CanvasSize = list.Items.Size |
3565 | |
3566 | list.ListLayout = Instance.new("UIListLayout", list.Items) |
3567 | list.ListLayout.FillDirection = Enum.FillDirection.Vertical |
3568 | list.ListLayout.SortOrder = Enum.SortOrder.LayoutOrder |
3569 | list.ListLayout.Padding = UDim.new(0, 0) |
3570 | |
3571 | list.ListPadding = Instance.new("UIPadding", list.Items) |
3572 | list.ListPadding.PaddingTop = UDim.new(0, 2) |
3573 | list.ListPadding.PaddingLeft = UDim.new(0, 6) |
3574 | list.ListPadding.PaddingRight = UDim.new(0, 6) |
3575 | |
3576 | list.items = { } |
3577 | function list:AddPlayer(Player) |
3578 | local player = { } |
3579 | |
3580 | player.Main = Instance.new("Frame", list.Items) |
3581 | player.Main.Name = Player.Name |
3582 | player.Main.BorderColor3 = window.theme.outlinecolor |
3583 | player.Main.ZIndex = 3 |
3584 | player.Main.Size = UDim2.fromOffset(list.Items.AbsoluteSize.X - 12, 20) |
3585 | player.Main.BackgroundColor3 = window.theme.sectorcolor |
3586 | player.Main.Position = UDim2.new(0, 0, 0, 0) |
3587 | |
3588 | table.insert(list.items, Player) |
3589 | list.Items.CanvasSize = UDim2.fromOffset(list.Items.AbsoluteSize.X, (#list.items * 20)) |
3590 | list.Items.Size = UDim2.fromOffset(list.Items.AbsoluteSize.X, math.clamp(list.Items.CanvasSize.Y.Offset, 0, 205)) |
3591 | return player |
3592 | end |
3593 | |
3594 | function list:RemovePlayer(Player) |
3595 | local p = list.Items:FindFirstChild(Player) |
3596 | if p then |
3597 | for i,v in pairs(list.items) do |
3598 | if v == Player then |
3599 | table.remove(list.items, i) |
3600 | end |
3601 | end |
3602 | |
3603 | p:Remove() |
3604 | list.Items.CanvasSize = UDim2.fromOffset(list.Items.AbsoluteSize.X, (#list.items * 90)) |
3605 | end |
3606 | end |
3607 | |
3608 | for i,v in pairs(game:GetService("Players"):GetPlayers()) do |
3609 | list:AddPlayer(v) |
3610 | end |
3611 | |
3612 | game:GetService("Players").PlayerAdded:Connect(function(v) |
3613 | list:AddPlayer(v) |
3614 | end) |
3615 | |
3616 | return list |
3617 | end |
3618 | ]]-- |
3619 | |
3620 | table.insert(window.Tabs, tab) |
3621 | return tab |
3622 | end |
3623 | |
3624 | return window |
3625 | end |
3626 | |
3627 | return library |