-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsw.lua
More file actions
143 lines (122 loc) · 3.74 KB
/
sw.lua
File metadata and controls
143 lines (122 loc) · 3.74 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
--[[
start
]]
local OrionLib = loadstring(game:HttpGet(('https://raw.githubusercontent.com/0rgxn/Skvllware/main/OrionSource')))()
local Window = OrionLib:MakeWindow({Name = "Title of the library", HidePremium = false, SaveConfig = true, ConfigFolder = "OrionTest"})
local Tab = Window:MakeTab({
Name = "Tab 1",
Icon = "rbxassetid://4483345998",
PremiumOnly = false
local Section = Tab:AddSection({
Name = "Section"
})
OrionLib:MakeNotification({
Name = "Title!",
Content = "Notification content... what will it say??",
Image = "rbxassetid://4483345998",
Time = 5
})
Tab:AddButton({
Name = "Button!",
Callback = function()
print("button pressed")
end
})
Tab:AddToggle({
Name = "This is a toggle!",
Default = false,
Callback = function(Value)
print(Value)
end
})
Tab:AddColorpicker({
Name = "Colorpicker",
Default = Color3.fromRGB(255, 0, 0),
Callback = function(Value)
print(Value)
end
})
Tab:AddSlider({
Name = "Slider",
Min = 0,
Max = 20,
Default = 5,
Color = Color3.fromRGB(255,255,255),
Increment = 1,
ValueName = "bananas",
Callback = function(Value)
print(Value)
end
})
Tab:AddLabel("Label")
Tab:AddParagraph("Paragraph","Paragraph Content")
Tab:AddTextbox({
Name = "Textbox",
Default = "default box input",
TextDisappear = true,
Callback = function(Value)
print(Value)
end
})
Tab:AddBind({
Name = "Bind",
Default = Enum.KeyCode.E,
Hold = false,
Callback = function()
print("press")
end
})
Tab:AddDropdown({
Name = "Dropdown",
Default = "1",
Options = {"1", "2"},
Callback = function(Value)
print(Value)
end
})
```
```lua
--[[
Name = <string> - The name of the dropdown.
Default = <string> - The default value of the dropdown.
Options = <table> - The options in the dropdown.
Callback = <function> - The function of the dropdown.
]]
```
### Adding a set of new Dropdown buttons to an existing menu
```lua
Dropdown:Refresh(List<table>,true)
```
The above boolean value "true" is whether or not the current buttons will be deleted.
### Selecting a dropdown option
```lua
Dropdown:Set("dropdown option")
```
# Finishing your script (REQUIRED)
The below function needs to be added at the end of your code.
```lua
OrionLib:Init()
```
### How flags work.
The flags feature in the ui may be confusing for some people. It serves the purpose of being the ID of an element in the config file, and makes accessing the value of an element anywhere in the code possible.
Below in an example of using flags.
```lua
Tab1:AddToggle({
Name = "Toggle",
Default = true,
Save = true,
Flag = "toggle"
})
print(OrionLib.Flags["toggle"].Value) -- prints the value of the toggle.
```
Flags only work with the toggle, slider, dropdown, bind, and colorpicker.
### Making your interface work with configs.
In order to make your interface use the configs function you first need to add the `SaveConfig` and `ConfigFolder` arguments to your window function. The explanation of these arguments in above.
Then you need to add the `Flag` and `Save` values to every toggle, slider, dropdown, bind, and colorpicker you want to include in the config file.
The `Flag = <string>` argument is the ID of an element in the config file.
The `Save = <bool>` argument includes the element in the config file.
Config files are made for every game the library is launched in.
## Destroying the Interface
```lua
OrionLib:Destroy()
```