-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_usage.lua
More file actions
161 lines (150 loc) · 5.18 KB
/
Copy pathexample_usage.lua
File metadata and controls
161 lines (150 loc) · 5.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
-- Pollo UI Lib - complete interface example
-- This file demonstrates every UI control. It does not include game features.
local LIB_URL = "https://raw.githubusercontent.com/Perrodevs/PolloUILib/main/PolloUILib.lua"
local success, PolloUI = pcall(function()
return loadstring(game:HttpGet(LIB_URL))()
end)
if not success then
warn("[PolloUI] Could not load the library:", PolloUI)
return
end
local Window = PolloUI:CreateWindow({
Name = "PolloUICompleteExample",
Title = "PolloHub // Example",
Credit = "by @yarayarayaragod",
Footer = "Pollo UI Lib - complete control showcase",
ToggleKey = Enum.KeyCode.LeftShift,
Theme = "Pollo Dark"
})
-- Home is created automatically and is always the first group.
local Home = Window:GetPage("Home")
local Welcome = Home:CreateCard("Example", {Column = 1, Order = 2})
Welcome:AddLabel("The Home and Misc groups are built into every window.", {
Wrapped = true,
Height = 38
})
Welcome:AddButton("Show Success", function()
Window:Notify("Example", "The button callback was executed.", "Success")
end)
-- Every custom group is inserted between Home and Misc.
local Combat = Window:CreateGroup("Combat", {
Description = "Buttons, toggles, sliders, and dropdowns."
})
local CombatPage = Window:GetPage("Combat")
local MainCard = CombatPage:CreateCard("Main Controls", {Column = 1})
MainCard:AddLabel("All callbacks in this example only print or notify.", {
Role = "Muted",
Wrapped = true,
Height = 34
})
MainCard:AddSeparator()
MainCard:AddButton("Action Button", function(button)
print("Pollo UI button:", button.Text)
Window:Notify("Button", "Action Button pressed.", "Info")
end)
local EnabledToggle = MainCard:AddToggle("Enabled", false, function(enabled)
print("Enabled:", enabled)
end)
local AmountSlider = MainCard:AddSlider({
Text = "Amount",
Min = 0,
Max = 100,
Default = 25,
Callback = function(value)
print("Amount:", value)
end
})
local OptionsCard = CombatPage:CreateCard("Input Controls", {Column = 2})
local ModeDropdown = OptionsCard:AddDropdown({
Text = "Mode",
Values = {"Default", "Smooth", "Performance"},
Default = "Default",
Callback = function(value)
Window:Notify("Dropdown", "Selected: " .. value, "Info")
end
})
OptionsCard:AddTextBox({
Label = "Config Name",
Default = "example-config",
Placeholder = "Enter a name...",
EnterOnly = true,
Callback = function(text)
Window:Notify("Text Box", text, "Success")
end
})
OptionsCard:AddColorPicker({
Text = "Example Color",
Default = Color3.fromRGB(85, 200, 255),
Callback = function(color)
print("Color:", color)
end
})
OptionsCard:AddButton("Set Controls From Code", function()
EnabledToggle:Set(true)
AmountSlider:Set(75)
ModeDropdown:Set("Smooth")
end)
local ESP = Window:CreateGroup("ESP", {
Description = "Two-column card layout example."
})
local ESPPage = Window:GetPage("ESP")
local Layers = ESPPage:CreateCard("Layers", {Column = 1})
for _, name in ipairs({"Boxes", "Names", "Health", "Distance", "Tracers"}) do
Layers:AddToggle(name, false, function(value)
print(name, value)
end)
end
local Style = ESPPage:CreateCard("Style", {Column = 2})
Style:AddDropdown({
Text = "Box Style",
Values = {"Full", "Corners", "Outline"},
Default = "Corners",
Callback = function(value)
print("Box style:", value)
end
})
Style:AddSlider({Text = "Thickness", Min = 1, Max = 5, Default = 1, Callback = print})
Style:AddColorPicker({Text = "Primary Color", Default = Color3.fromRGB(255, 90, 100), Callback = print})
-- A group can contain multiple subpages.
local Tools = Window:CreateGroup("Tools", {
Description = "Group with multiple subpages.",
Page = false
})
local Explorer = Tools:CreatePage("Explorer", "First custom subpage.")
local Settings = Tools:CreatePage("Tool Settings", "Second custom subpage.")
local ExplorerCard = Explorer:CreateCard("Explorer Mockup", {Column = 1})
ExplorerCard:AddTextBox({Placeholder = "Search instances..."})
ExplorerCard:AddLabel("Workspace\nPlayers\nReplicatedStorage\nStarterGui", {
Height = 110,
Wrapped = true,
Role = "Muted"
})
local ToolSettingsCard = Settings:CreateCard("Settings", {Column = 1})
ToolSettingsCard:AddToggle("Show Class Names", true, print)
ToolSettingsCard:AddToggle("Show Class Badges", true, print)
ToolSettingsCard:AddSlider({Text = "Maximum Rows", Min = 40, Max = 220, Default = 120, Callback = print})
local World = Window:CreateGroup("World", {
Description = "Additional layout and notification examples."
})
local WorldPage = Window:GetPage("World")
local Notifications = WorldPage:CreateCard("Notification Types", {Column = 1})
for _, kind in ipairs({"Success", "Warning", "Error", "Info"}) do
Notifications:AddButton(kind, function()
Window:Notify(kind, "This is a " .. string.lower(kind) .. " notification.", kind)
end)
end
local Runtime = WorldPage:CreateCard("Window API", {Column = 2})
Runtime:AddButton("Open Home", function()
Window:SelectPage("Home")
end)
Runtime:AddButton("Open Themes", function()
Window:SelectPage("Themes")
end)
Runtime:AddButton("Toggle Window", function()
Window:Toggle()
end)
Runtime:AddButton("Unload Library", function()
Window:Unload()
end)
-- Misc is automatic and remains the final group regardless of creation order.
Window:Notify("Pollo UI", "Complete example loaded. Press LeftShift to toggle.", "Success")