@@ -70,13 +70,17 @@ local WindowTab = Window:Tab({
7070 Title = " Window and File Configuration" ,
7171 Icon = " settings" ,
7272})
73+ local CreateThemeTab = Window :Tab ({
74+ Title = " Create theme" ,
75+ Icon = " palette" ,
76+ })
7377
7478local Divider = Window :Divider ()
7579
7680for i = 1 , 20 do
7781 Window :Tab ({
78- Title = " Just A Tab" ,
79- Image = " Grid "
82+ Title = " Just An Empty Tab" ,
83+ Image = " grid "
8084 })
8185end
8286
@@ -109,6 +113,51 @@ local Paragraph = MainTab:Paragraph({
109113 Title = " Paragraph without content" ,
110114})
111115
116+ MainTab :Section ({ Title = " Code" })
117+
118+ MainTab :Code ({
119+ Title = " main.lua" ,
120+ Code = [[ -- This is a simple Lua script
121+ local message = "hi"
122+ print(message)
123+
124+ -- Condition check
125+ if message == "hi" then
126+ print("Hello, world!")
127+ end
128+
129+ local function pisun(a,b)
130+ return print(a,b)
131+ end
132+
133+ pisun("hello", "world")]] ,
134+ })
135+
136+ MainTab :Code ({
137+ Title = " Example.lua" ,
138+ Code = [[ local WindUI = loadstring(game:HttpGet("https://raw.githubusercontent.com/Footagesus/WindUI/refs/heads/main/dist/main.lua"))()
139+
140+ local Window = WindUI:CreateWindow({
141+ Title = "WindUI Library", -- UI Title
142+ Icon = "image", -- Url or rbxassetid or lucide
143+ Author = ".ftgs", -- Author & Creator
144+ Folder = "CloudHub", -- Folder name for saving data (And key)
145+ Size = UDim2.fromOffset(580, 460), -- UI Size
146+ KeySystem = { -- Creates key system
147+ Key = "1234", -- key
148+ Note = "The Key is 1234", -- Note
149+ URL = "https://github.com/Footagesus/WindUI", -- URL To get key (example: Discord)
150+ SaveKey = true, -- Saves the key in the folder specified above
151+ },
152+ Transparent = true,-- UI Transparency
153+ Theme = "Dark", -- UI Theme
154+ SideBarWidth = 170, -- UI Sidebar Width (number)
155+ HasOutline = true, -- Adds Oultines to the window
156+ })
157+
158+ ]] ,
159+ })
160+
112161Paragraph1 :SetTitle (" New Title!" )
113162Paragraph1 :SetDesc (" New Description!" )
114163
@@ -412,7 +461,7 @@ local Button = NotificationTab:Button({
412461
413462---- 1. Add Theme
414463
415- Window :AddTheme ({
464+ WindUI :AddTheme ({
416465 Name = " Halloween" ,
417466
418467 Accent = " #331400" ,
@@ -426,7 +475,7 @@ Window:AddTheme({
426475
427476---- 2. Use Theme
428477
429- Window :SetTheme (" Dark" )
478+ WindUI :SetTheme (" Dark" )
430479
431480---- 3. Load Themes
432481
463512WindowTab :Section ({ Title = " Window" })
464513
465514local themeValues = {}
466- for name , _ in pairs (Window :GetThemes ()) do
515+ for name , _ in pairs (WindUI :GetThemes ()) do
467516 table.insert (themeValues , name )
468517end
469518
@@ -474,17 +523,17 @@ local themeDropdown = WindowTab:Dropdown({
474523 Value = nil ,
475524 Values = themeValues ,
476525 Callback = function (theme )
477- Window :SetTheme (theme )
526+ WindUI :SetTheme (theme )
478527 end
479528})
480- themeDropdown :Select (Window :GetCurrentTheme ())
529+ themeDropdown :Select (WindUI :GetCurrentTheme ())
481530
482531local ToggleTransparency = WindowTab :Toggle ({
483532 Title = " Toggle Window Transparency" ,
484533 Callback = function (e )
485534 Window :ToggleTransparency (e )
486535 end ,
487- Value = Window :GetTransparency ()
536+ Value = WindUI :GetTransparency ()
488537})
489538
490539WindowTab :Section ({ Title = " Save" })
@@ -502,7 +551,7 @@ WindowTab:Button({
502551 Title = " Save File" ,
503552 Callback = function ()
504553 if fileNameInput ~= " " then
505- SaveFile (fileNameInput , { Transparent = Window :GetTransparency (), Theme = Window :GetCurrentTheme () })
554+ SaveFile (fileNameInput , { Transparent = WindUI :GetTransparency (), Theme = WindUI :GetCurrentTheme () })
506555 end
507556 end
508557})
@@ -537,7 +586,7 @@ WindowTab:Button({
537586 Window :ToggleTransparency (data .Transparent )
538587 ToggleTransparency :SetValue (data .Transparent )
539588 end
540- if data .Theme then Window :SetTheme (data .Theme ) end
589+ if data .Theme then WindUI :SetTheme (data .Theme ) end
541590 end
542591 end
543592 end
@@ -547,7 +596,7 @@ WindowTab:Button({
547596 Title = " Overwrite File" ,
548597 Callback = function ()
549598 if fileNameInput ~= " " then
550- SaveFile (fileNameInput , { Transparent = Window :GetTransparency (), Theme = Window :GetCurrentTheme () })
599+ SaveFile (fileNameInput , { Transparent = WindUI :GetTransparency (), Theme = WindUI :GetCurrentTheme () })
551600 end
552601 end
553602})
@@ -568,6 +617,32 @@ WindowTab:Button({
568617
569618
570619
620+ BlockedElementsTab :Code ({
621+ Title = " Blocked_Example.lua" ,
622+ Locked = true ,
623+ Code = [[ local WindUI = loadstring(game:HttpGet("https://raw.githubusercontent.com/Footagesus/WindUI/refs/heads/main/dist/main.lua"))()
624+
625+ local Window = WindUI:CreateWindow({
626+ Title = "WindUI Library", -- UI Title
627+ Icon = "image", -- Url or rbxassetid or lucide
628+ Author = ".ftgs", -- Author & Creator
629+ Folder = "CloudHub", -- Folder name for saving data (And key)
630+ Size = UDim2.fromOffset(580, 460), -- UI Size
631+ KeySystem = { -- Creates key system
632+ Key = "1234", -- key
633+ Note = "The Key is 1234", -- Note
634+ URL = "https://github.com/Footagesus/WindUI", -- URL To get key (example: Discord)
635+ SaveKey = true, -- Saves the key in the folder specified above
636+ },
637+ Transparent = true,-- UI Transparency
638+ Theme = "Dark", -- UI Theme
639+ SideBarWidth = 170, -- UI Sidebar Width (number)
640+ HasOutline = true, -- Adds Oultines to the window
641+ })
642+
643+ ]] ,
644+ })
645+
571646
572647local Button = BlockedElementsTab :Button ({
573648 Title = " Blocked Button" ,
@@ -663,4 +738,73 @@ local Colorpicker = BlockedElementsTab:Colorpicker({
663738})
664739
665740--- Unlock
666- Colorpicker :Unlock ()
741+ Colorpicker :Unlock ()
742+
743+
744+ ---
745+
746+ local currentThemeName = WindUI :GetCurrentTheme ()
747+ local themes = WindUI :GetThemes ()
748+
749+ local ThemeAccent = themes [currentThemeName ].Accent
750+ local ThemeOutline = themes [currentThemeName ].Outline
751+ local ThemeText = themes [currentThemeName ].Text
752+ local ThemePlaceholderText = themes [currentThemeName ].PlaceholderText
753+
754+ function updateTheme ()
755+ WindUI :AddTheme ({
756+ Name = currentThemeName ,
757+ Accent = ThemeAccent ,
758+ Outline = ThemeOutline ,
759+ Text = ThemeText ,
760+ PlaceholderText = ThemePlaceholderText
761+ })
762+ WindUI :SetTheme (currentThemeName )
763+ end
764+
765+ local CreateInput = CreateThemeTab :Input ({
766+ Title = " Theme Name" ,
767+ Value = currentThemeName ,
768+ Callback = function (name )
769+ currentThemeName = name
770+ end
771+ })
772+
773+ CreateThemeTab :Colorpicker ({
774+ Title = " Background Color" ,
775+ Default = Color3 .fromHex (ThemeAccent ),
776+ Callback = function (color )
777+ ThemeAccent = color :ToHex ()
778+ end
779+ })
780+
781+ CreateThemeTab :Colorpicker ({
782+ Title = " Outline Color" ,
783+ Default = Color3 .fromHex (ThemeOutline ),
784+ Callback = function (color )
785+ ThemeOutline = color :ToHex ()
786+ end
787+ })
788+
789+ CreateThemeTab :Colorpicker ({
790+ Title = " Text Color" ,
791+ Default = Color3 .fromHex (ThemeText ),
792+ Callback = function (color )
793+ ThemeText = color :ToHex ()
794+ end
795+ })
796+
797+ CreateThemeTab :Colorpicker ({
798+ Title = " Placeholder Text Color" ,
799+ Default = Color3 .fromHex (ThemePlaceholderText ),
800+ Callback = function (color )
801+ ThemePlaceholderText = color :ToHex ()
802+ end
803+ })
804+
805+ CreateThemeTab :Button ({
806+ Title = " Update Theme" ,
807+ Callback = function ()
808+ updateTheme ()
809+ end
810+ })
0 commit comments