Advertisement
NebulaZorua

shitty gui lib

Apr 11th, 2020
2,160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.75 KB | None | 0 0
  1. local signal;
  2. local fakeEvent = {}
  3. local picker = {}
  4.  
  5. if(not script:FindFirstChild'Panel')then
  6. game:GetObjects("rbxassetid://4881341304")[1]:Clone():WaitForChild'Panel'.Parent=script; -- for colorpicker later
  7. end
  8.  
  9.  
  10. do
  11. local ScriptConnection = {}
  12.  
  13. function ScriptConnection.new(event,func,...)
  14. local connObj = newproxy(true)
  15. local conn = {
  16. Event=event;
  17. Function=func;
  18. Args={...};
  19. Object=connObj;
  20. }
  21. getmetatable(connObj).__index=function(self,index)
  22. if(index=='Locked')then
  23. return nil;
  24. else
  25. return conn[index] or ScriptConnection[index]
  26. end
  27. end
  28. getmetatable(connObj).__newindex=function(self,index,value)
  29. if(index=='Locked' and getfenv(2).script==script)then
  30. conn.Locked=value
  31. elseif(index~='Locked')then
  32. conn[index]=value
  33. end
  34. end
  35.  
  36. return connObj;
  37. end
  38.  
  39. function ScriptConnection:disconnect()
  40. self.Event._connections[self]=nil;
  41. end
  42.  
  43. function ScriptConnection:Lock(key)
  44. self.Locked=key;
  45. end
  46.  
  47. function ScriptConnection:Unlock(key)
  48. if(self.Locked==key)then
  49. self.Locked=nil;
  50. else
  51. error("Invalid key!",2)
  52. end
  53. end
  54.  
  55.  
  56. ScriptConnection.Disconnect=ScriptConnection.disconnect;
  57.  
  58. setmetatable(ScriptConnection,{__call=function(s,...)ScriptConnection.new(...) end})
  59.  
  60. signal = ScriptConnection.new;
  61. end
  62.  
  63. do
  64. function fakeEvent.new()
  65. local conn = {
  66. _connections={};
  67. _yield={};
  68. }
  69.  
  70. setmetatable(conn,{__index=fakeEvent})
  71.  
  72. return conn;
  73. end
  74.  
  75. function fakeEvent:fire(...)
  76. self._yield={};
  77. for i = 1,#self._connections do
  78. local connection = self._connections[i]
  79. coroutine.wrap(function(...) connection.Function(#connection.Args>0 and unpack(connection.Args) or ...) end)(...)
  80. end
  81. end
  82.  
  83. function fakeEvent:connect(func,...)
  84. local obj = signal(self,func,...)
  85. table.insert(self._connections,obj)
  86. end
  87.  
  88. function fakeEvent:wait()
  89. local guid = tostring(function() end):sub(13)
  90. self._yield[guid]=true;
  91. repeat wait() until self._yield[guid]~=true
  92. self._yield[guid]=nil;
  93. end
  94.  
  95. fakeEvent.Fire=fakeEvent.fire;
  96. fakeEvent.Connect=fakeEvent.connect;
  97. fakeEvent.Wait=fakeEvent.wait;
  98.  
  99. setmetatable(fakeEvent,{__call=fakeEvent.new})
  100. end
  101.  
  102. do
  103.  
  104. local function regPicker(obj)
  105. local panel = obj.Panel
  106. local hue = obj.Hue
  107. local colorEvent = obj.ColorChanged
  108.  
  109. local connection;
  110. local hconnection;
  111. panel.InputBegan:connect(function(io)
  112. if(io.UserInputType==Enum.UserInputType.MouseButton1)then
  113. local y = math.clamp( io.Position.y - panel.AbsolutePosition.Y, 0, 128 )
  114. local x = math.clamp( io.Position.x - panel.AbsolutePosition.X, 0, 128 )
  115. obj.PSel.Position=UDim2.new(0,x,0,y)
  116. obj.s = x/128
  117. obj.v = 1-y/128
  118. colorEvent:fire(obj:Get())
  119. if(connection)then
  120. connection:disconnect()
  121. end
  122. connection = game:service'UserInputService'.InputChanged:Connect(function(io,gpe)
  123. if(io.UserInputType==Enum.UserInputType.MouseMovement)then
  124. local y = math.clamp( io.Position.y - panel.AbsolutePosition.Y, 0, 128 )
  125. local x = math.clamp( io.Position.x - panel.AbsolutePosition.X, 0, 128 )
  126. obj.PSel.Position=UDim2.new(0,x,0,y)
  127. obj.s = x/128
  128. obj.v = 1-y/128
  129. colorEvent:fire(obj:Get())
  130. end
  131. end)
  132. end
  133. end)
  134. hue.InputBegan:connect(function(io)
  135. if(io.UserInputType==Enum.UserInputType.MouseButton1)then
  136. local guiInset = game:service'GuiService':GetGuiInset()
  137. local y = math.clamp( io.Position.y - hue.AbsolutePosition.Y, 0, 128 )
  138. obj.HSel.Position=UDim2.new(0,0,0,y)
  139. obj.h = 1-y/128
  140. colorEvent:fire(obj:Get())
  141. if(connection)then
  142. connection:disconnect()
  143. end
  144. obj:UpdateDisplay()
  145. hconnection = game:service'UserInputService'.InputChanged:Connect(function(io,gpe)
  146. if(io.UserInputType==Enum.UserInputType.MouseMovement)then
  147. local y = math.clamp( io.Position.y - hue.AbsolutePosition.Y, 0, 128 )
  148. obj.HSel.Position=UDim2.new(0,0,0,y)
  149. obj.h = 1-y/128
  150. colorEvent:fire(obj:Get())
  151. obj:UpdateDisplay()
  152. end
  153. end)
  154. end
  155. end)
  156.  
  157. game:service'UserInputService'.InputEnded:Connect(function(io,gpe)
  158. if(io.UserInputType==Enum.UserInputType.MouseButton1)then
  159. if(typeof(connection)=='RBXScriptConnection')then
  160. connection:disconnect()
  161. connection=nil
  162. end
  163. if(typeof(hconnection)=='RBXScriptConnection')then
  164. hconnection:disconnect()
  165. hconnection=nil
  166. end
  167. end
  168. end)
  169.  
  170. end
  171.  
  172. function picker.new()
  173. local p = script:WaitForChild'Panel':Clone()
  174. local selection = p:WaitForChild'selection'
  175. local h = p:WaitForChild'Hue'
  176. local hselection = h:WaitForChild'selection'
  177. local obj = {
  178. Panel = p;
  179. Hue = h;
  180. PSel = selection;
  181. HSel=hselection;
  182. ColorChanged=fakeEvent.new();
  183. h=0;
  184. s=0;
  185. v=1;
  186. UpdateDisplay=function(self)
  187. self.Panel.BackgroundColor3 = Color3.fromHSV(self.h,1,1)
  188. end;
  189. Set=function(self,c3)
  190. local h,s,v = Color3.toHSV(c3)
  191. self.h = h
  192. self.s = s
  193. self.v = v
  194. self.PSel.Position=UDim2.new(0,s*128,0,128-v*128)
  195. self.HSel.Position=UDim2.new(0,0,0,128-h*128)
  196. self.ColorChanged:fire(self:Get())
  197. self:UpdateDisplay()
  198. end;
  199. SetHSV=function(self,h,s,v)
  200. self.h = h
  201. self.s = s
  202. self.v = v
  203. self.PSel.Position=UDim2.new(0,s*128,0,128-v*128)
  204. self.HSel.Position=UDim2.new(0,0,0,128-h*128)
  205. self.ColorChanged:fire(self:Get())
  206. self:UpdateDisplay()
  207. end;
  208. Get=function(self)
  209. return Color3.fromHSV(self.h,self.s,self.v)
  210. end;
  211. GetHSV=function(self)
  212. return self.h,self.s,self.v
  213. end;
  214. }
  215.  
  216. setmetatable(obj,picker)
  217.  
  218. obj:Set(Color3.new(1,1,1))
  219. regPicker(obj);
  220. return obj;
  221. end
  222.  
  223. picker.__index=picker;
  224. picker.__newindex=function(self,ind,val)
  225. local s,e = pcall(function()
  226. rawget(self,'Panel')[ind]=val;
  227. end)
  228. if(not s)then
  229. rawset(self,ind,val)
  230. end
  231. end
  232.  
  233. end
  234.  
  235. local newTabGUI=(function()
  236. local partsWithId = {}
  237. local awaitRef = {}
  238.  
  239. local root = {
  240. ID = 0;
  241. Type = "ImageLabel";
  242. Properties = {
  243. ImageColor3 = Color3.new(49/255,77/255,97/255);
  244. ScaleType = Enum.ScaleType.Slice;
  245. BorderColor3 = Color3.new(9/85,14/85,53/255);
  246. BackgroundTransparency = 1;
  247. Size = UDim2.new(0,243,0,25);
  248. Image = "rbxassetid://3570695787";
  249. Name = "Frame";
  250. Position = UDim2.new(0,25,0,25);
  251. SliceScale = 0.25;
  252. ZIndex = 3;
  253. BackgroundColor3 = Color3.new(1,1,1);
  254. SliceCenter = Rect.new(Vector2.new(100,100),Vector2.new(100,100));
  255. };
  256. Children = {
  257. {
  258. ID = 1;
  259. Type = "TextLabel";
  260. Properties = {
  261. FontSize = Enum.FontSize.Size24;
  262. TextColor3 = Color3.new(1,1,1);
  263. Text = "Stinky";
  264. Font = Enum.Font.Highway;
  265. Name = "Title";
  266. BackgroundTransparency = 1;
  267. Size = UDim2.new(1,0,0.87999999523163,0);
  268. ZIndex = 4;
  269. TextSize = 24;
  270. BackgroundColor3 = Color3.new(1,1,1);
  271. };
  272. Children = {};
  273. };
  274. {
  275. ID = 2;
  276. Type = "Frame";
  277. Properties = {
  278. AnchorPoint = Vector2.new(0.5,0);
  279. Position = UDim2.new(0.5,0,0.5,0);
  280. Size = UDim2.new(1,-10,0,100);
  281. BorderSizePixel = 0;
  282. BackgroundColor3 = Color3.new(9/85,14/85,53/255);
  283. };
  284. Children = {
  285. {
  286. ID = 3;
  287. Type = "ImageLabel";
  288. Properties = {
  289. ImageColor3 = Color3.new(9/85,14/85,53/255);
  290. ScaleType = Enum.ScaleType.Slice;
  291. BackgroundTransparency = 1;
  292. AnchorPoint = Vector2.new(0.5,0.5);
  293. Image = "rbxassetid://3570695787";
  294. Name = "Border";
  295. Position = UDim2.new(0.5,0,0.5,0);
  296. SliceScale = 0.050000000745058;
  297. Size = UDim2.new(1,10,1,10);
  298. BackgroundColor3 = Color3.new(1,1,1);
  299. SliceCenter = Rect.new(Vector2.new(100,100),Vector2.new(100,100));
  300. };
  301. Children = {};
  302. };
  303. {
  304. ID = 4;
  305. Type = "Frame";
  306. Properties = {
  307. AnchorPoint = Vector2.new(0.5,0);
  308. Position = UDim2.new(0.5,0,0,0);
  309. Name = "ListContainer";
  310. ClipsDescendants = true;
  311. BackgroundTransparency = 1;
  312. Size = UDim2.new(1,10,1,5);
  313. BorderSizePixel = 0;
  314. BackgroundColor3 = Color3.new(9/85,14/85,53/255);
  315. };
  316. Children = {
  317. {
  318. ID = 5;
  319. Type = "ScrollingFrame";
  320. Properties = {
  321. BackgroundTransparency = 1;
  322. Name = "List";
  323. Position = UDim2.new(0,0,0,15);
  324. BorderColor3 = Color3.new(9/85,14/85,53/255);
  325. Size = UDim2.new(1,0,0,85);
  326. BorderSizePixel = 0;
  327. BackgroundColor3 = Color3.new(9/85,14/85,53/255);
  328. };
  329. Children = {
  330. {
  331. ID = 6;
  332. Type = "UIListLayout";
  333. Properties = {
  334. SortOrder = Enum.SortOrder.LayoutOrder;
  335. Padding=UDim.new(0,5);
  336. };
  337. Children = {};
  338. };
  339. };
  340. };
  341. };
  342. };
  343. };
  344. };
  345. };
  346. };
  347.  
  348. local function Scan(item, parent)
  349. local obj = Instance.new(item.Type)
  350. if (item.ID) then
  351. local awaiting = awaitRef[item.ID]
  352. if (awaiting) then
  353. awaiting[1][awaiting[2]] = obj
  354. awaitRef[item.ID] = nil
  355. else
  356. partsWithId[item.ID] = obj
  357. end
  358. end
  359. for p,v in pairs(item.Properties) do
  360. if (type(v) == "string") then
  361. local id = tonumber(v:match("^_R:(%w+)_$"))
  362. if (id) then
  363. if (partsWithId[id]) then
  364. v = partsWithId[id]
  365. else
  366. awaitRef[id] = {obj, p}
  367. v = nil
  368. end
  369. end
  370. end
  371. obj[p] = v
  372. end
  373. for _,c in pairs(item.Children) do
  374. Scan(c, obj)
  375. end
  376. obj.Parent = parent
  377. return obj
  378. end
  379.  
  380. return function() return Scan(root, nil) end
  381. end)()
  382.  
  383. local newTextlessSeperator=(function()
  384. local partsWithId = {}
  385. local awaitRef = {}
  386.  
  387. local root = {
  388. ID = 0;
  389. Type = "Frame";
  390. Properties = {
  391. AnchorPoint = Vector2.new(0.5,0.5);
  392. Name = "Sep";
  393. Position = UDim2.new(0.5,0,0.5,0);
  394. BorderColor3 = Color3.new(9/85,14/85,53/255);
  395. ZIndex = 2;
  396. Size = UDim2.new(1,10,0,5);
  397. BackgroundColor3 = Color3.new(47/255,74/255,94/255);
  398. };
  399. Children = {};
  400. };
  401.  
  402. local function Scan(item, parent)
  403. local obj = Instance.new(item.Type)
  404. if (item.ID) then
  405. local awaiting = awaitRef[item.ID]
  406. if (awaiting) then
  407. awaiting[1][awaiting[2]] = obj
  408. awaitRef[item.ID] = nil
  409. else
  410. partsWithId[item.ID] = obj
  411. end
  412. end
  413. for p,v in pairs(item.Properties) do
  414. if (type(v) == "string") then
  415. local id = tonumber(v:match("^_R:(%w+)_$"))
  416. if (id) then
  417. if (partsWithId[id]) then
  418. v = partsWithId[id]
  419. else
  420. awaitRef[id] = {obj, p}
  421. v = nil
  422. end
  423. end
  424. end
  425. obj[p] = v
  426. end
  427. for _,c in pairs(item.Children) do
  428. Scan(c, obj)
  429. end
  430. obj.Parent = parent
  431. return obj
  432. end
  433.  
  434. return function() return Scan(root, nil) end
  435. end)()
  436.  
  437.  
  438. local player = game:service'Players'.localPlayer;
  439. local plrGui = player:FindFirstChildOfClass'PlayerGui'
  440. local textService = game:service'TextService'
  441.  
  442. local resources = game:service'RunService':IsStudio() and require(script:WaitForChild'RoStrap') or loadstring(game:HttpGet"https://pastebin.com/raw/nV4Kh274")()
  443. local pInstance = resources:LoadLibrary'PseudoInstance'
  444. local Color = resources:LoadLibrary'Color'
  445. local drag = game:service'RunService':IsStudio() and require(script:WaitForChild'Drag') or loadstring(game:HttpGet'https://pastebin.com/raw/LgeCDbAX')()
  446. local library = {}
  447. local themeOptions = setmetatable({DisabledModuleColor=Color3.new(1,0,0);EnabledModuleColor=Color3.new(0,1,0);TabTitleColor=Color.White;TextColor3=Color.White;TabColor=Color3.fromRGB(61,21,133);ContentColor=Color3.fromRGB(27,42,53)},{__mode='k'})
  448. local readonlyProperties={
  449. Visible=false;
  450. ThemeSettings=setmetatable({},{__index=themeOptions,__newindex=function()return error'no.'end});
  451. };
  452.  
  453. function Tween(obj,props,time,easing,direction,repeats,backwards)
  454. local info = TweenInfo.new(time or .5, easing or Enum.EasingStyle.Quad, direction or Enum.EasingDirection.Out, repeats or 0, backwards or false)
  455. local tween = game:service'TweenService':Create(obj, info, props)
  456.  
  457. tween:Play()
  458. end
  459.  
  460. library.GUI = Instance.new("ScreenGui",game:service'RunService':IsStudio() and plrGui or game.CoreGui)
  461. library.GUI.DisplayOrder=100
  462. library.GUI.ResetOnSpawn=false
  463. library.GUI.IgnoreGuiInset=true
  464. library.GUI.ZIndexBehavior=Enum.ZIndexBehavior.Global
  465. library.Tabs={}
  466. library.TabObject = {};
  467. setmetatable(library.TabObject,{__index=library})
  468. setmetatable(library,{__index=readonlyProperties,__metatable=bm==bad})
  469. local NextTabPos = UDim2.new(0,0,0,0)
  470.  
  471. local internalStuff = {}
  472. local errors = {
  473. unableToCast="Unable to cast %s to %s"
  474. }
  475.  
  476. function expectType(got,expected)
  477. return typeof(got)==expected,errors.unableToCast:format(typeof(got),expected)
  478. end
  479.  
  480. function library:SetVisibility(value)
  481. readonlyProperties.Visible=value
  482. library:UpdateTabs()
  483. end
  484.  
  485. function library.TabObject:Update()
  486. self:UpdateTabs()
  487. self:UpdateScroll()
  488. self:TweenSize()
  489. end
  490.  
  491. function library:UpdateTabs()
  492. for i = 1,#self.Tabs do
  493. local obj = self.Tabs[i]
  494. if(obj and obj.UI)then
  495. obj.UI.ImageColor3=self.ThemeSettings.TabColor
  496. obj.UI:WaitForChild'Frame':WaitForChild'Border'.ImageColor3=self.ThemeSettings.ContentColor
  497. obj.UI.Visible=self.Visible
  498. end
  499. end
  500. end
  501.  
  502. function library:SetTabColor(c3)
  503. assert(expectType(c3,'Color3'))
  504. themeOptions.TabColor=c3
  505. end
  506.  
  507. function library:SetContentColor(c3)
  508. assert(expectType(c3,'Color3'))
  509. themeOptions.ContentColor=c3
  510. end
  511.  
  512. function library.TabObject:SetModulesVisibility(value)
  513. self.Visibility=value
  514. self:TweenSize()
  515. end
  516.  
  517. function library.TabObject:UpdateScroll()
  518. self.UI.Frame.ListContainer.List.Size=UDim2.new(1,0,0,self:GetHeight())
  519. self.UI.Frame.ListContainer.List.CanvasSize=UDim2.new(0,0,0,self:GetHeight())
  520. end
  521.  
  522. function library.TabObject:GetHeight()
  523. local y=0;
  524. for i = 1,#self.Children do
  525. y=y+self.Children[i].Element.AbsoluteSize.Y+5
  526. end
  527. return y
  528. end
  529.  
  530. function library.TabObject:GetSize()
  531. return UDim2.new(1,-10,0,math.min(self:GetHeight(),500)+15)
  532. end
  533.  
  534. function library.TabObject:TweenSize()
  535. if(self.Visibility)then
  536. self.UI.Frame:TweenSize(self:GetSize(),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,.2,true)
  537. else
  538. self.UI.Frame:TweenSize(UDim2.new(1,-10,0,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,.2,true)
  539. end
  540. end
  541.  
  542. function library.TabObject:NewButton(name,callback)
  543. if(callback)then assert(expectType(callback,'function'))end
  544. local button = pInstance.new("RippleButton")
  545. button.Size=UDim2.new(1,0,0,25)
  546. button.Object.Active=false
  547. button.Text=name
  548. button.Font=Enum.Font.Highway
  549. button.TextSize=24
  550. button.ZIndex=4
  551. button.PrimaryColor3 = self.ThemeSettings.TextColor3
  552. button.Parent=self.UI.Frame.ListContainer.List
  553. if(callback)then
  554. button.OnPressed:Connect(callback)
  555. end
  556. table.insert(self.Children,{Type='Button';Element=button.Object})
  557. self:Update()
  558.  
  559. return button;
  560. end
  561.  
  562. function library.TabObject:NewSeperator(text)
  563. local sep = newTextlessSeperator()
  564. local h,s,v = Color3.toHSV(self.ThemeSettings.ContentColor)
  565. local v = v<=.5 and v*1.5 or v/1.5
  566. sep.BackgroundColor3 = Color3.fromHSV(h,s,v)
  567. sep.Parent=self.UI.Frame.ListContainer.List
  568. table.insert(self.Children,{Type='Seperator';Element=sep})
  569. self:Update()
  570.  
  571. return sep;
  572. end
  573.  
  574. function library.TabObject:NewLabel(text)
  575. assert(expectType(text,"string"))
  576. local txt = Instance.new("TextLabel")
  577. txt.Size=UDim2.new(1,0,0,25)
  578. txt.Text=text
  579. txt.Font=Enum.Font.Highway
  580. txt.TextSize=24
  581. txt.ZIndex=4
  582. txt.BackgroundTransparency=1
  583. txt.TextColor3=self.ThemeSettings.TextColor3
  584. txt.Parent=self.UI.Frame.ListContainer.List
  585. table.insert(self.Children,{Type='TextLabel';Element=txt})
  586. self:Update()
  587.  
  588. return setmetatable({},{__index=function(s,i)
  589. if(i:sub(1,3)=='Set')then
  590. local prop = i:sub(4)
  591. return function(...)
  592. txt[prop]=...
  593. end
  594. else
  595. return txt[i]
  596. end
  597. end},{__newindex=function(s,i,v) txt[i]=v end})
  598. end
  599.  
  600. function library.TabObject:NewToggle(text,callback,defaultVal)
  601. local text = text or 'ExampleMod'
  602. if(callback)then assert(expectType(callback,'function'))end
  603. if(text)then assert(expectType(text,'string'))end
  604. local button = Instance.new("TextButton")
  605. button.Size=UDim2.new(1,0,0,25)
  606. button.Active=false
  607. button.Text=text
  608. button.Font=Enum.Font.Highway
  609. button.TextSize=24
  610. button.ZIndex=4
  611. button.BackgroundTransparency = 1
  612. button.Parent=self.UI.Frame.ListContainer.List
  613.  
  614. local Object = {Toggled=false;Type='Toggle';Element=button}
  615. setmetatable(Object,{__index=library})
  616. function Object:Toggle(tog)
  617. self.Toggled = tog or not self.Toggled
  618. Tween(button,{TextColor3 = (self.Toggled and self.ThemeSettings.EnabledModuleColor or self.ThemeSettings.DisabledModuleColor)},.1,Enum.EasingStyle.Linear)
  619. if(callback)then callback(self.Toggled)end
  620. end
  621. button.TextColor3 = self.ThemeSettings.DisabledModuleColor
  622. button.MouseButton1Down:Connect(function()Object:Toggle()end)
  623. table.insert(self.Children,Object)
  624. self:Update()
  625. Object:Toggle(not not defaultVal)
  626.  
  627. return Object;
  628. end
  629.  
  630. function library.TabObject:NewTextbox(defaultValue,placeholderText)
  631. local h,s,v = Color3.toHSV(self.ThemeSettings.ContentColor)
  632. local v = v<=.5 and v*1.5 or v/1.5
  633. local textBox = Instance.new("TextBox")
  634. textBox.TextWrapped = true
  635. textBox.TextColor3 = Color3.new(1,1,1)
  636. textBox.Text = defaultValue and tostring(defaultValue) or ''
  637. textBox.PlaceholderText = placeholderText and tostring(placeholderText) or ''
  638. textBox.Font = Enum.Font.Highway
  639. textBox.FontSize = Enum.FontSize.Size24
  640. textBox.Size = UDim2.new(1,0,0,25)
  641. textBox.TextSize = 24
  642. textBox.BackgroundColor3 = Color3.fromHSV(h,s,v)
  643. textBox.TextScaled = true
  644. textBox.Parent = self.UI.Frame.ListContainer.List
  645. table.insert(self.Children,{Type='Textbox';Element=textBox})
  646. self:Update()
  647.  
  648. return textBox
  649. end
  650.  
  651. function library:NewTab(name)
  652. local name = name or "TextLabel"
  653. local textSize = textService:GetTextSize(name,24,Enum.Font.Highway,Vector2.new(9e9,9e9))
  654. local ui = newTabGUI()
  655. ui.Position = NextTabPos+UDim2.new(0,0,0,36)
  656. ui.Name=name
  657. ui.Size=UDim2.new(0,math.max(textSize.X,230),0,ui.Size.Y.Offset)
  658. NextTabPos=NextTabPos+UDim2.new(0,ui.Size.X.Offset+10,0,0)
  659. ui:WaitForChild'Title'.Text = name
  660. ui.ImageColor3=self.ThemeSettings.TabColor
  661. ui.Title.TextColor3=self.ThemeSettings.TabTitleColor
  662. ui:WaitForChild'Frame':WaitForChild'Border'.ImageColor3=self.ThemeSettings.ContentColor
  663. ui.Visible=self.Visible
  664. local tabObj = setmetatable({Visibility=true;UI=ui,Children={},Dragger=drag:Connect(ui)},{__index=self.TabObject})
  665. tabObj.Dragger:SetDragTime(.1)
  666. ui.Frame.Size = tabObj:GetSize()
  667. ui.InputEnded:connect(function(io,gpe)
  668. if(gpe)then return end
  669. if(io.UserInputType==Enum.UserInputType.MouseButton2)then
  670. tabObj:SetModulesVisibility(not tabObj.Visibility)
  671. end
  672. end)
  673. ui.Parent=self.GUI;
  674. tabObj:Update()
  675.  
  676. table.insert(self.Tabs,tabObj)
  677.  
  678. return tabObj
  679. end
  680.  
  681. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement