@quenty/iris 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/LICENSE.md +22 -0
- package/README.md +33 -0
- package/default.project.json +14 -0
- package/package.json +42 -0
- package/src/Shared/Iris.lua +702 -0
- package/src/Shared/iris_API.lua +231 -0
- package/src/Shared/iris_Internal.lua +923 -0
- package/src/Shared/iris_PubTypes.lua +44 -0
- package/src/Shared/iris_Types.lua +674 -0
- package/src/Shared/iris_WidgetTypes.lua +522 -0
- package/src/Shared/iris_config.lua +306 -0
- package/src/Shared/iris_demoWindow.lua +2148 -0
- package/src/Shared/widgets/iris_Button.lua +91 -0
- package/src/Shared/widgets/iris_Checkbox.lua +116 -0
- package/src/Shared/widgets/iris_Combo.lua +498 -0
- package/src/Shared/widgets/iris_Format.lua +141 -0
- package/src/Shared/widgets/iris_Image.lua +156 -0
- package/src/Shared/widgets/iris_Input.lua +1430 -0
- package/src/Shared/widgets/iris_Menu.lua +603 -0
- package/src/Shared/widgets/iris_Plot.lua +642 -0
- package/src/Shared/widgets/iris_RadioButton.lua +127 -0
- package/src/Shared/widgets/iris_Root.lua +148 -0
- package/src/Shared/widgets/iris_Tab.lua +334 -0
- package/src/Shared/widgets/iris_Table.lua +641 -0
- package/src/Shared/widgets/iris_Text.lua +133 -0
- package/src/Shared/widgets/iris_Tree.lua +291 -0
- package/src/Shared/widgets/iris_Window.lua +1158 -0
- package/src/Shared/widgets/iris_widgets.lua +487 -0
- package/src/jest.config.lua +3 -0
- package/src/node_modules.project.json +7 -0
- package/test/default.project.json +25 -0
- package/test/scripts/Server/ServerMain.server.lua +13 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
--!nocheck
|
|
2
|
+
local Types = require(script.Parent.iris_Types)
|
|
3
|
+
|
|
4
|
+
export type ID = Types.ID
|
|
5
|
+
export type State<T> = Types.State<T>
|
|
6
|
+
|
|
7
|
+
export type Widget = Types.Widget
|
|
8
|
+
export type Root = Types.Root
|
|
9
|
+
export type Window = Types.Window
|
|
10
|
+
export type Tooltip = Types.Tooltip
|
|
11
|
+
export type MenuBar = Types.MenuBar
|
|
12
|
+
export type Menu = Types.Menu
|
|
13
|
+
export type MenuItem = Types.MenuItem
|
|
14
|
+
export type MenuToggle = Types.MenuToggle
|
|
15
|
+
export type Separator = Types.Separator
|
|
16
|
+
export type Indent = Types.Indent
|
|
17
|
+
export type SameLine = Types.SameLine
|
|
18
|
+
export type Group = Types.Group
|
|
19
|
+
export type Text = Types.Text
|
|
20
|
+
export type SeparatorText = Types.SeparatorText
|
|
21
|
+
export type Button = Types.Button
|
|
22
|
+
export type Checkbox = Types.Checkbox
|
|
23
|
+
export type RadioButton = Types.RadioButton
|
|
24
|
+
export type Image = Types.Image
|
|
25
|
+
export type ImageButton = Types.ImageButton
|
|
26
|
+
export type Tree = Types.Tree
|
|
27
|
+
export type CollapsingHeader = Types.CollapsingHeader
|
|
28
|
+
export type TabBar = Types.TabBar
|
|
29
|
+
export type Tab = Types.Tab
|
|
30
|
+
export type Input<T> = Types.Input<T>
|
|
31
|
+
export type InputColor3 = Types.InputColor3
|
|
32
|
+
export type InputColor4 = Types.InputColor4
|
|
33
|
+
export type InputEnum = Types.InputEnum
|
|
34
|
+
export type InputText = Types.InputText
|
|
35
|
+
export type Selectable = Types.Selectable
|
|
36
|
+
export type Combo = Types.Combo
|
|
37
|
+
export type ProgressBar = Types.ProgressBar
|
|
38
|
+
export type PlotLines = Types.PlotLines
|
|
39
|
+
export type PlotHistogram = Types.PlotHistogram
|
|
40
|
+
export type Table = Types.Table
|
|
41
|
+
|
|
42
|
+
export type Iris = Types.Iris
|
|
43
|
+
|
|
44
|
+
return {}
|
|
@@ -0,0 +1,674 @@
|
|
|
1
|
+
--!nocheck
|
|
2
|
+
local WidgetTypes = require(script.Parent.iris_WidgetTypes)
|
|
3
|
+
|
|
4
|
+
export type ID = WidgetTypes.ID
|
|
5
|
+
export type State<T> = WidgetTypes.State<T>
|
|
6
|
+
|
|
7
|
+
export type Hovered = WidgetTypes.Hovered
|
|
8
|
+
export type Clicked = WidgetTypes.Clicked
|
|
9
|
+
export type RightClicked = WidgetTypes.RightClicked
|
|
10
|
+
export type DoubleClicked = WidgetTypes.DoubleClicked
|
|
11
|
+
export type CtrlClicked = WidgetTypes.CtrlClicked
|
|
12
|
+
export type Active = WidgetTypes.Active
|
|
13
|
+
export type Checked = WidgetTypes.Checked
|
|
14
|
+
export type Unchecked = WidgetTypes.Unchecked
|
|
15
|
+
export type Opened = WidgetTypes.Opened
|
|
16
|
+
export type Closed = WidgetTypes.Closed
|
|
17
|
+
export type Collapsed = WidgetTypes.Collapsed
|
|
18
|
+
export type Uncollapsed = WidgetTypes.Uncollapsed
|
|
19
|
+
export type Selected = WidgetTypes.Selected
|
|
20
|
+
export type Unselected = WidgetTypes.Unselected
|
|
21
|
+
export type Changed = WidgetTypes.Changed
|
|
22
|
+
export type NumberChanged = WidgetTypes.NumberChanged
|
|
23
|
+
export type TextChanged = WidgetTypes.TextChanged
|
|
24
|
+
|
|
25
|
+
export type Widget = WidgetTypes.Widget
|
|
26
|
+
export type ParentWidget = WidgetTypes.ParentWidget
|
|
27
|
+
export type StateWidget = WidgetTypes.StateWidget
|
|
28
|
+
|
|
29
|
+
export type Root = WidgetTypes.Root
|
|
30
|
+
export type Window = WidgetTypes.Window
|
|
31
|
+
export type Tooltip = WidgetTypes.Tooltip
|
|
32
|
+
export type MenuBar = WidgetTypes.MenuBar
|
|
33
|
+
export type Menu = WidgetTypes.Menu
|
|
34
|
+
export type MenuItem = WidgetTypes.MenuItem
|
|
35
|
+
export type MenuToggle = WidgetTypes.MenuToggle
|
|
36
|
+
export type Separator = WidgetTypes.Separator
|
|
37
|
+
export type Indent = WidgetTypes.Indent
|
|
38
|
+
export type SameLine = WidgetTypes.SameLine
|
|
39
|
+
export type Group = WidgetTypes.Group
|
|
40
|
+
export type Text = WidgetTypes.Text
|
|
41
|
+
export type SeparatorText = WidgetTypes.SeparatorText
|
|
42
|
+
export type Button = WidgetTypes.Button
|
|
43
|
+
export type Checkbox = WidgetTypes.Checkbox
|
|
44
|
+
export type RadioButton = WidgetTypes.RadioButton
|
|
45
|
+
export type Image = WidgetTypes.Image
|
|
46
|
+
export type ImageButton = WidgetTypes.ImageButton
|
|
47
|
+
export type Tree = WidgetTypes.Tree
|
|
48
|
+
export type CollapsingHeader = WidgetTypes.CollapsingHeader
|
|
49
|
+
export type TabBar = WidgetTypes.TabBar
|
|
50
|
+
export type Tab = WidgetTypes.Tab
|
|
51
|
+
export type Input<T> = WidgetTypes.Input<T>
|
|
52
|
+
export type InputColor3 = WidgetTypes.InputColor3
|
|
53
|
+
export type InputColor4 = WidgetTypes.InputColor4
|
|
54
|
+
export type InputEnum = WidgetTypes.InputEnum
|
|
55
|
+
export type InputText = WidgetTypes.InputText
|
|
56
|
+
export type Selectable = WidgetTypes.Selectable
|
|
57
|
+
export type Combo = WidgetTypes.Combo
|
|
58
|
+
export type ProgressBar = WidgetTypes.ProgressBar
|
|
59
|
+
export type PlotLines = WidgetTypes.PlotLines
|
|
60
|
+
export type PlotHistogram = WidgetTypes.PlotHistogram
|
|
61
|
+
export type Table = WidgetTypes.Table
|
|
62
|
+
|
|
63
|
+
export type InputDataType = number | Vector2 | Vector3 | UDim | UDim2 | Color3 | Rect | { number }
|
|
64
|
+
|
|
65
|
+
export type Argument = any
|
|
66
|
+
export type Arguments = {
|
|
67
|
+
[string]: Argument,
|
|
68
|
+
Text: string,
|
|
69
|
+
TextHint: string,
|
|
70
|
+
TextOverlay: string,
|
|
71
|
+
ReadOnly: boolean,
|
|
72
|
+
MultiLine: boolean,
|
|
73
|
+
Wrapped: boolean,
|
|
74
|
+
Color: Color3,
|
|
75
|
+
RichText: boolean,
|
|
76
|
+
|
|
77
|
+
Increment: InputDataType,
|
|
78
|
+
Min: InputDataType,
|
|
79
|
+
Max: InputDataType,
|
|
80
|
+
Format: { string },
|
|
81
|
+
UseFloats: boolean,
|
|
82
|
+
UseHSV: boolean,
|
|
83
|
+
UseHex: boolean,
|
|
84
|
+
Prefix: { string },
|
|
85
|
+
BaseLine: number,
|
|
86
|
+
|
|
87
|
+
Width: number,
|
|
88
|
+
Height: number,
|
|
89
|
+
VerticalAlignment: Enum.VerticalAlignment,
|
|
90
|
+
HorizontalAlignment: Enum.HorizontalAlignment,
|
|
91
|
+
Index: any,
|
|
92
|
+
Image: string,
|
|
93
|
+
Size: UDim2,
|
|
94
|
+
Rect: Rect,
|
|
95
|
+
ScaleType: Enum.ScaleType,
|
|
96
|
+
TileSize: UDim2,
|
|
97
|
+
SliceCenter: Rect,
|
|
98
|
+
SliceScale: number,
|
|
99
|
+
ResampleMode: Enum.ResamplerMode,
|
|
100
|
+
|
|
101
|
+
SpanAvailWidth: boolean,
|
|
102
|
+
NoIdent: boolean,
|
|
103
|
+
NoClick: boolean,
|
|
104
|
+
NoButtons: boolean,
|
|
105
|
+
NoButton: boolean,
|
|
106
|
+
NoPreview: boolean,
|
|
107
|
+
|
|
108
|
+
NumColumns: number,
|
|
109
|
+
RowBg: boolean,
|
|
110
|
+
BordersOuter: boolean,
|
|
111
|
+
BordersInner: boolean,
|
|
112
|
+
|
|
113
|
+
Title: string,
|
|
114
|
+
NoTitleBar: boolean,
|
|
115
|
+
NoBackground: boolean,
|
|
116
|
+
NoCollapse: boolean,
|
|
117
|
+
NoClose: boolean,
|
|
118
|
+
NoMove: boolean,
|
|
119
|
+
NoScrollbar: boolean,
|
|
120
|
+
NoResize: boolean,
|
|
121
|
+
NoMenu: boolean,
|
|
122
|
+
|
|
123
|
+
KeyCode: Enum.KeyCode,
|
|
124
|
+
ModifierKey: Enum.ModifierKey,
|
|
125
|
+
Disabled: boolean,
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export type States = {
|
|
129
|
+
[string]: State<any>,
|
|
130
|
+
number: State<number>,
|
|
131
|
+
color: State<Color3>,
|
|
132
|
+
transparency: State<number>,
|
|
133
|
+
editingText: State<boolean>,
|
|
134
|
+
index: State<any>,
|
|
135
|
+
|
|
136
|
+
size: State<Vector2>,
|
|
137
|
+
position: State<Vector2>,
|
|
138
|
+
progress: State<number>,
|
|
139
|
+
scrollDistance: State<number>,
|
|
140
|
+
|
|
141
|
+
isChecked: State<boolean>,
|
|
142
|
+
isOpened: State<boolean>,
|
|
143
|
+
isUncollapsed: State<boolean>,
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export type Event = {
|
|
147
|
+
Init: (Widget) -> (),
|
|
148
|
+
Get: (Widget) -> boolean,
|
|
149
|
+
}
|
|
150
|
+
export type Events = { [string]: Event }
|
|
151
|
+
|
|
152
|
+
-- Widgets
|
|
153
|
+
|
|
154
|
+
export type WidgetArguments = { [number]: Argument }
|
|
155
|
+
export type WidgetStates = {
|
|
156
|
+
[string]: State<any>,
|
|
157
|
+
number: State<number>?,
|
|
158
|
+
color: State<Color3>?,
|
|
159
|
+
transparency: State<number>?,
|
|
160
|
+
editingText: State<boolean>?,
|
|
161
|
+
index: State<any>?,
|
|
162
|
+
|
|
163
|
+
size: State<Vector2>?,
|
|
164
|
+
position: State<Vector2>?,
|
|
165
|
+
progress: State<number>?,
|
|
166
|
+
scrollDistance: State<number>?,
|
|
167
|
+
values: State<number>?,
|
|
168
|
+
|
|
169
|
+
isChecked: State<boolean>?,
|
|
170
|
+
isOpened: State<boolean>?,
|
|
171
|
+
isUncollapsed: State<boolean>?,
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export type WidgetClass = {
|
|
175
|
+
Generate: (thisWidget: Widget) -> GuiObject,
|
|
176
|
+
Discard: (thisWidget: Widget) -> (),
|
|
177
|
+
Update: (thisWidget: Widget, ...any) -> (),
|
|
178
|
+
|
|
179
|
+
Args: { [string]: number },
|
|
180
|
+
Events: Events,
|
|
181
|
+
hasChildren: boolean,
|
|
182
|
+
hasState: boolean,
|
|
183
|
+
ArgNames: { [number]: string },
|
|
184
|
+
|
|
185
|
+
GenerateState: (thisWidget: Widget) -> (),
|
|
186
|
+
UpdateState: (thisWidget: Widget) -> (),
|
|
187
|
+
|
|
188
|
+
ChildAdded: (thisWidget: Widget, thisChild: Widget) -> GuiObject,
|
|
189
|
+
ChildDiscarded: (thisWidget: Widget, thisChild: Widget) -> (),
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
-- Iris
|
|
193
|
+
|
|
194
|
+
export type Internal = {
|
|
195
|
+
--[[
|
|
196
|
+
--------------
|
|
197
|
+
PROPERTIES
|
|
198
|
+
--------------
|
|
199
|
+
]]
|
|
200
|
+
_version: string,
|
|
201
|
+
_started: boolean,
|
|
202
|
+
_shutdown: boolean,
|
|
203
|
+
_cycleTick: number,
|
|
204
|
+
_deltaTime: number,
|
|
205
|
+
_eventConnection: RBXScriptConnection?,
|
|
206
|
+
|
|
207
|
+
-- Refresh
|
|
208
|
+
_globalRefreshRequested: boolean,
|
|
209
|
+
_refreshCounter: number,
|
|
210
|
+
_refreshLevel: number,
|
|
211
|
+
_refreshStack: { boolean },
|
|
212
|
+
|
|
213
|
+
-- Widgets & Instances
|
|
214
|
+
_widgets: { [string]: WidgetClass },
|
|
215
|
+
_widgetCount: number,
|
|
216
|
+
_stackIndex: number,
|
|
217
|
+
_rootInstance: GuiObject?,
|
|
218
|
+
_rootWidget: ParentWidget,
|
|
219
|
+
_lastWidget: Widget,
|
|
220
|
+
SelectionImageObject: Frame,
|
|
221
|
+
parentInstance: BasePlayerGui | GuiBase2d,
|
|
222
|
+
_utility: WidgetUtility,
|
|
223
|
+
|
|
224
|
+
-- Config
|
|
225
|
+
_rootConfig: Config,
|
|
226
|
+
_config: Config,
|
|
227
|
+
|
|
228
|
+
-- ID
|
|
229
|
+
_IDStack: { ID },
|
|
230
|
+
_usedIDs: { [ID]: number },
|
|
231
|
+
_newID: boolean,
|
|
232
|
+
_pushedIds: { ID },
|
|
233
|
+
_nextWidgetId: ID?,
|
|
234
|
+
|
|
235
|
+
-- VDOM
|
|
236
|
+
_lastVDOM: { [ID]: Widget },
|
|
237
|
+
_VDOM: { [ID]: Widget },
|
|
238
|
+
|
|
239
|
+
-- State
|
|
240
|
+
_states: { [ID]: State<any> },
|
|
241
|
+
|
|
242
|
+
-- Callback
|
|
243
|
+
_postCycleCallbacks: { () -> () },
|
|
244
|
+
_connectedFunctions: { () -> () },
|
|
245
|
+
_connections: { RBXScriptConnection },
|
|
246
|
+
_initFunctions: { () -> () },
|
|
247
|
+
_cycleCoroutine: thread?,
|
|
248
|
+
|
|
249
|
+
--[[
|
|
250
|
+
---------
|
|
251
|
+
STATE
|
|
252
|
+
---------
|
|
253
|
+
]]
|
|
254
|
+
|
|
255
|
+
StateClass: {
|
|
256
|
+
__index: any,
|
|
257
|
+
|
|
258
|
+
get: <T>(self: State<T>) -> any,
|
|
259
|
+
set: <T>(self: State<T>, newValue: any) -> any,
|
|
260
|
+
onChange: <T>(self: State<T>, callback: (newValue: any) -> ()) -> (),
|
|
261
|
+
},
|
|
262
|
+
|
|
263
|
+
--[[
|
|
264
|
+
-------------
|
|
265
|
+
FUNCTIONS
|
|
266
|
+
-------------
|
|
267
|
+
]]
|
|
268
|
+
_cycle: (deltaTime: number) -> (),
|
|
269
|
+
_NoOp: () -> (),
|
|
270
|
+
|
|
271
|
+
-- Widget
|
|
272
|
+
WidgetConstructor: (type: string, widgetClass: WidgetClass) -> (),
|
|
273
|
+
_Insert: (widgetType: string, arguments: WidgetArguments?, states: WidgetStates?) -> Widget,
|
|
274
|
+
_GenNewWidget: (widgetType: string, arguments: Arguments, states: WidgetStates?, ID: ID) -> Widget,
|
|
275
|
+
_ContinueWidget: (ID: ID, widgetType: string) -> Widget,
|
|
276
|
+
_DiscardWidget: (widgetToDiscard: Widget) -> (),
|
|
277
|
+
|
|
278
|
+
_widgetState: (thisWidget: Widget, stateName: string, initialValue: any) -> State<any>,
|
|
279
|
+
_EventCall: (thisWidget: Widget, eventName: string) -> boolean,
|
|
280
|
+
_GetParentWidget: () -> ParentWidget,
|
|
281
|
+
SetFocusedWindow: (thisWidget: WidgetTypes.Window?) -> (),
|
|
282
|
+
|
|
283
|
+
-- Generate
|
|
284
|
+
_generateEmptyVDOM: () -> { [ID]: Widget },
|
|
285
|
+
_generateRootInstance: () -> (),
|
|
286
|
+
_generateSelectionImageObject: () -> (),
|
|
287
|
+
|
|
288
|
+
-- Utility
|
|
289
|
+
_getID: (levelsToIgnore: number) -> ID,
|
|
290
|
+
_deepCompare: (t1: {}, t2: {}) -> boolean,
|
|
291
|
+
_deepCopy: (t: {}) -> {},
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export type WidgetUtility = {
|
|
295
|
+
GuiService: GuiService,
|
|
296
|
+
RunService: RunService,
|
|
297
|
+
TextService: TextService,
|
|
298
|
+
UserInputService: UserInputService,
|
|
299
|
+
ContextActionService: ContextActionService,
|
|
300
|
+
|
|
301
|
+
getTime: () -> number,
|
|
302
|
+
getMouseLocation: () -> Vector2,
|
|
303
|
+
|
|
304
|
+
ICONS: {
|
|
305
|
+
BLANK_SQUARE: string,
|
|
306
|
+
RIGHT_POINTING_TRIANGLE: string,
|
|
307
|
+
DOWN_POINTING_TRIANGLE: string,
|
|
308
|
+
MULTIPLICATION_SIGN: string,
|
|
309
|
+
BOTTOM_RIGHT_CORNER: string,
|
|
310
|
+
CHECKMARK: string,
|
|
311
|
+
BORDER: string,
|
|
312
|
+
ALPHA_BACKGROUND_TEXTURE: string,
|
|
313
|
+
UNKNOWN_TEXTURE: string,
|
|
314
|
+
},
|
|
315
|
+
|
|
316
|
+
GuiOffset: Vector2,
|
|
317
|
+
MouseOffset: Vector2,
|
|
318
|
+
|
|
319
|
+
findBestWindowPosForPopup: (refPos: Vector2, size: Vector2, outerMin: Vector2, outerMax: Vector2) -> Vector2,
|
|
320
|
+
getScreenSizeForWindow: (thisWidget: Widget) -> Vector2,
|
|
321
|
+
isPosInsideRect: (pos: Vector2, rectMin: Vector2, rectMax: Vector2) -> boolean,
|
|
322
|
+
extend: (superClass: WidgetClass, { [any]: any }) -> WidgetClass,
|
|
323
|
+
discardState: (thisWidget: Widget) -> (),
|
|
324
|
+
|
|
325
|
+
UIPadding: (Parent: GuiObject, PxPadding: Vector2) -> UIPadding,
|
|
326
|
+
UIListLayout: (Parent: GuiObject, FillDirection: Enum.FillDirection, Padding: UDim) -> UIListLayout,
|
|
327
|
+
UIStroke: (Parent: GuiObject, Thickness: number, Color: Color3, Transparency: number) -> UIStroke,
|
|
328
|
+
UICorner: (Parent: GuiObject, PxRounding: number?) -> UICorner,
|
|
329
|
+
UISizeConstraint: (Parent: GuiObject, MinSize: Vector2?, MaxSize: Vector2?) -> UISizeConstraint,
|
|
330
|
+
|
|
331
|
+
applyTextStyle: (thisInstance: TextLabel | TextButton | TextBox) -> (),
|
|
332
|
+
applyInteractionHighlights: (
|
|
333
|
+
Property: string,
|
|
334
|
+
Button: GuiButton,
|
|
335
|
+
Highlightee: GuiObject,
|
|
336
|
+
Colors: { [string]: any }
|
|
337
|
+
) -> (),
|
|
338
|
+
applyInteractionHighlightsWithMultiHighlightee: (
|
|
339
|
+
Property: string,
|
|
340
|
+
Button: GuiButton,
|
|
341
|
+
Highlightees: { { GuiObject | { [string]: Color3 | number } } }
|
|
342
|
+
) -> (),
|
|
343
|
+
applyFrameStyle: (thisInstance: GuiObject, noPadding: boolean?, noCorner: boolean?) -> (),
|
|
344
|
+
|
|
345
|
+
applyButtonClick: (thisInstance: GuiButton, callback: () -> ()) -> (),
|
|
346
|
+
applyButtonDown: (thisInstance: GuiButton, callback: (x: number, y: number) -> ()) -> (),
|
|
347
|
+
applyMouseEnter: (thisInstance: GuiObject, callback: (x: number, y: number) -> ()) -> (),
|
|
348
|
+
applyMouseMoved: (thisInstance: GuiObject, callback: (x: number, y: number) -> ()) -> (),
|
|
349
|
+
applyMouseLeave: (thisInstance: GuiObject, callback: (x: number, y: number) -> ()) -> (),
|
|
350
|
+
applyInputBegan: (thisInstance: GuiObject, callback: (input: InputObject) -> ()) -> (),
|
|
351
|
+
applyInputEnded: (thisInstance: GuiObject, callback: (input: InputObject) -> ()) -> (),
|
|
352
|
+
|
|
353
|
+
registerEvent: (event: string, callback: (...any) -> ()) -> (),
|
|
354
|
+
|
|
355
|
+
EVENTS: {
|
|
356
|
+
hover: (pathToHovered: (thisWidget: Widget & Hovered) -> GuiObject) -> Event,
|
|
357
|
+
click: (pathToClicked: (thisWidget: Widget & Clicked) -> GuiButton) -> Event,
|
|
358
|
+
rightClick: (pathToClicked: (thisWidget: Widget & RightClicked) -> GuiButton) -> Event,
|
|
359
|
+
doubleClick: (pathToClicked: (thisWidget: Widget & DoubleClicked) -> GuiButton) -> Event,
|
|
360
|
+
ctrlClick: (pathToClicked: (thisWidget: Widget & CtrlClicked) -> GuiButton) -> Event,
|
|
361
|
+
},
|
|
362
|
+
|
|
363
|
+
abstractButton: WidgetClass,
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export type Config = {
|
|
367
|
+
TextColor: Color3,
|
|
368
|
+
TextTransparency: number,
|
|
369
|
+
TextDisabledColor: Color3,
|
|
370
|
+
TextDisabledTransparency: number,
|
|
371
|
+
|
|
372
|
+
BorderColor: Color3,
|
|
373
|
+
BorderActiveColor: Color3,
|
|
374
|
+
BorderTransparency: number,
|
|
375
|
+
BorderActiveTransparency: number,
|
|
376
|
+
|
|
377
|
+
WindowBgColor: Color3,
|
|
378
|
+
WindowBgTransparency: number,
|
|
379
|
+
ScrollbarGrabColor: Color3,
|
|
380
|
+
ScrollbarGrabTransparency: number,
|
|
381
|
+
PopupBgColor: Color3,
|
|
382
|
+
PopupBgTransparency: number,
|
|
383
|
+
|
|
384
|
+
TitleBgColor: Color3,
|
|
385
|
+
TitleBgTransparency: number,
|
|
386
|
+
TitleBgActiveColor: Color3,
|
|
387
|
+
TitleBgActiveTransparency: number,
|
|
388
|
+
TitleBgCollapsedColor: Color3,
|
|
389
|
+
TitleBgCollapsedTransparency: number,
|
|
390
|
+
|
|
391
|
+
MenubarBgColor: Color3,
|
|
392
|
+
MenubarBgTransparency: number,
|
|
393
|
+
|
|
394
|
+
FrameBgColor: Color3,
|
|
395
|
+
FrameBgTransparency: number,
|
|
396
|
+
FrameBgHoveredColor: Color3,
|
|
397
|
+
FrameBgHoveredTransparency: number,
|
|
398
|
+
FrameBgActiveColor: Color3,
|
|
399
|
+
FrameBgActiveTransparency: number,
|
|
400
|
+
|
|
401
|
+
ButtonColor: Color3,
|
|
402
|
+
ButtonTransparency: number,
|
|
403
|
+
ButtonHoveredColor: Color3,
|
|
404
|
+
ButtonHoveredTransparency: number,
|
|
405
|
+
ButtonActiveColor: Color3,
|
|
406
|
+
ButtonActiveTransparency: number,
|
|
407
|
+
|
|
408
|
+
ImageColor: Color3,
|
|
409
|
+
ImageTransparency: number,
|
|
410
|
+
|
|
411
|
+
SliderGrabColor: Color3,
|
|
412
|
+
SliderGrabTransparency: number,
|
|
413
|
+
SliderGrabActiveColor: Color3,
|
|
414
|
+
SliderGrabActiveTransparency: number,
|
|
415
|
+
|
|
416
|
+
HeaderColor: Color3,
|
|
417
|
+
HeaderTransparency: number,
|
|
418
|
+
HeaderHoveredColor: Color3,
|
|
419
|
+
HeaderHoveredTransparency: number,
|
|
420
|
+
HeaderActiveColor: Color3,
|
|
421
|
+
HeaderActiveTransparency: number,
|
|
422
|
+
|
|
423
|
+
TabColor: Color3,
|
|
424
|
+
TabTransparency: number,
|
|
425
|
+
TabHoveredColor: Color3,
|
|
426
|
+
TabHoveredTransparency: number,
|
|
427
|
+
TabActiveColor: Color3,
|
|
428
|
+
TabActiveTransparency: number,
|
|
429
|
+
|
|
430
|
+
SelectionImageObjectColor: Color3,
|
|
431
|
+
SelectionImageObjectTransparency: number,
|
|
432
|
+
SelectionImageObjectBorderColor: Color3,
|
|
433
|
+
SelectionImageObjectBorderTransparency: number,
|
|
434
|
+
|
|
435
|
+
TableBorderStrongColor: Color3,
|
|
436
|
+
TableBorderStrongTransparency: number,
|
|
437
|
+
TableBorderLightColor: Color3,
|
|
438
|
+
TableBorderLightTransparency: number,
|
|
439
|
+
TableRowBgColor: Color3,
|
|
440
|
+
TableRowBgTransparency: number,
|
|
441
|
+
TableRowBgAltColor: Color3,
|
|
442
|
+
TableRowBgAltTransparency: number,
|
|
443
|
+
TableHeaderColor: Color3,
|
|
444
|
+
TableHeaderTransparency: number,
|
|
445
|
+
|
|
446
|
+
NavWindowingHighlightColor: Color3,
|
|
447
|
+
NavWindowingHighlightTransparency: number,
|
|
448
|
+
NavWindowingDimBgColor: Color3,
|
|
449
|
+
NavWindowingDimBgTransparency: number,
|
|
450
|
+
|
|
451
|
+
SeparatorColor: Color3,
|
|
452
|
+
SeparatorTransparency: number,
|
|
453
|
+
|
|
454
|
+
CheckMarkColor: Color3,
|
|
455
|
+
CheckMarkTransparency: number,
|
|
456
|
+
|
|
457
|
+
PlotLinesColor: Color3,
|
|
458
|
+
PlotLinesTransparency: number,
|
|
459
|
+
PlotLinesHoveredColor: Color3,
|
|
460
|
+
PlotLinesHoveredTransparency: number,
|
|
461
|
+
PlotHistogramColor: Color3,
|
|
462
|
+
PlotHistogramTransparency: number,
|
|
463
|
+
PlotHistogramHoveredColor: Color3,
|
|
464
|
+
PlotHistogramHoveredTransparency: number,
|
|
465
|
+
|
|
466
|
+
ResizeGripColor: Color3,
|
|
467
|
+
ResizeGripTransparency: number,
|
|
468
|
+
ResizeGripHoveredColor: Color3,
|
|
469
|
+
ResizeGripHoveredTransparency: number,
|
|
470
|
+
ResizeGripActiveColor: Color3,
|
|
471
|
+
ResizeGripActiveTransparency: number,
|
|
472
|
+
|
|
473
|
+
HoverColor: Color3,
|
|
474
|
+
HoverTransparency: number,
|
|
475
|
+
|
|
476
|
+
-- Sizes
|
|
477
|
+
ItemWidth: UDim,
|
|
478
|
+
ContentWidth: UDim,
|
|
479
|
+
ContentHeight: UDim,
|
|
480
|
+
|
|
481
|
+
WindowPadding: Vector2,
|
|
482
|
+
WindowResizePadding: Vector2,
|
|
483
|
+
FramePadding: Vector2,
|
|
484
|
+
ItemSpacing: Vector2,
|
|
485
|
+
ItemInnerSpacing: Vector2,
|
|
486
|
+
CellPadding: Vector2,
|
|
487
|
+
DisplaySafeAreaPadding: Vector2,
|
|
488
|
+
IndentSpacing: number,
|
|
489
|
+
SeparatorTextPadding: Vector2,
|
|
490
|
+
|
|
491
|
+
TextFont: Font,
|
|
492
|
+
TextSize: number,
|
|
493
|
+
FrameBorderSize: number,
|
|
494
|
+
FrameRounding: number,
|
|
495
|
+
GrabRounding: number,
|
|
496
|
+
WindowBorderSize: number,
|
|
497
|
+
WindowTitleAlign: Enum.LeftRight,
|
|
498
|
+
PopupBorderSize: number,
|
|
499
|
+
PopupRounding: number,
|
|
500
|
+
ScrollbarSize: number,
|
|
501
|
+
GrabMinSize: number,
|
|
502
|
+
SeparatorTextBorderSize: number,
|
|
503
|
+
ImageBorderSize: number,
|
|
504
|
+
|
|
505
|
+
UseScreenGUIs: boolean,
|
|
506
|
+
IgnoreGuiInset: boolean,
|
|
507
|
+
ScreenInsets: Enum.ScreenInsets,
|
|
508
|
+
Parent: BasePlayerGui,
|
|
509
|
+
RichText: boolean,
|
|
510
|
+
TextWrapped: boolean,
|
|
511
|
+
DisplayOrderOffset: number,
|
|
512
|
+
ZIndexOffset: number,
|
|
513
|
+
|
|
514
|
+
MouseDoubleClickTime: number,
|
|
515
|
+
MouseDoubleClickMaxDist: number,
|
|
516
|
+
MouseDragThreshold: number,
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
type WidgetCall<W, A, S, E...> = (arguments: A, states: S, E...) -> W
|
|
520
|
+
|
|
521
|
+
export type Iris = {
|
|
522
|
+
--[[
|
|
523
|
+
-----------
|
|
524
|
+
WIDGETS
|
|
525
|
+
-----------
|
|
526
|
+
]]
|
|
527
|
+
|
|
528
|
+
End: () -> (),
|
|
529
|
+
|
|
530
|
+
-- Window API
|
|
531
|
+
Window: WidgetCall<Window, WidgetArguments, WidgetStates?>,
|
|
532
|
+
Tooltip: WidgetCall<Tooltip, WidgetArguments, nil>,
|
|
533
|
+
|
|
534
|
+
-- Menu Widget API
|
|
535
|
+
MenuBar: () -> Widget,
|
|
536
|
+
Menu: WidgetCall<Menu, WidgetArguments, WidgetStates?>,
|
|
537
|
+
MenuItem: WidgetCall<MenuItem, WidgetArguments, nil>,
|
|
538
|
+
MenuToggle: WidgetCall<MenuToggle, WidgetArguments, WidgetStates?>,
|
|
539
|
+
|
|
540
|
+
-- Format Widget API
|
|
541
|
+
Separator: () -> Separator,
|
|
542
|
+
Indent: (arguments: WidgetArguments?) -> Indent,
|
|
543
|
+
SameLine: (arguments: WidgetArguments?) -> SameLine,
|
|
544
|
+
Group: () -> Group,
|
|
545
|
+
|
|
546
|
+
-- Text Widget API
|
|
547
|
+
Text: WidgetCall<Text, WidgetArguments, nil>,
|
|
548
|
+
TextWrapped: WidgetCall<Text, WidgetArguments, nil>,
|
|
549
|
+
TextColored: WidgetCall<Text, WidgetArguments, nil>,
|
|
550
|
+
SeparatorText: WidgetCall<SeparatorText, WidgetArguments, nil>,
|
|
551
|
+
InputText: WidgetCall<InputText, WidgetArguments, WidgetStates?>,
|
|
552
|
+
|
|
553
|
+
-- Basic Widget API
|
|
554
|
+
Button: WidgetCall<Button, WidgetArguments, nil>,
|
|
555
|
+
SmallButton: WidgetCall<Button, WidgetArguments, nil>,
|
|
556
|
+
Checkbox: WidgetCall<Checkbox, WidgetArguments, WidgetStates?>,
|
|
557
|
+
RadioButton: WidgetCall<RadioButton, WidgetArguments, WidgetStates?>,
|
|
558
|
+
|
|
559
|
+
-- Tree Widget API
|
|
560
|
+
Tree: WidgetCall<Tree, WidgetArguments, WidgetStates?>,
|
|
561
|
+
CollapsingHeader: WidgetCall<CollapsingHeader, WidgetArguments, WidgetStates?>,
|
|
562
|
+
|
|
563
|
+
-- Tab Widget API
|
|
564
|
+
TabBar: WidgetCall<TabBar, WidgetArguments?, WidgetStates?>,
|
|
565
|
+
Tab: WidgetCall<Tab, WidgetArguments, WidgetStates?>,
|
|
566
|
+
|
|
567
|
+
-- Input Widget API
|
|
568
|
+
InputNum: WidgetCall<Input<number>, WidgetArguments, WidgetStates?>,
|
|
569
|
+
InputVector2: WidgetCall<Input<Vector2>, WidgetArguments, WidgetStates?>,
|
|
570
|
+
InputVector3: WidgetCall<Input<Vector3>, WidgetArguments, WidgetStates?>,
|
|
571
|
+
InputUDim: WidgetCall<Input<UDim>, WidgetArguments, WidgetStates?>,
|
|
572
|
+
InputUDim2: WidgetCall<Input<UDim2>, WidgetArguments, WidgetStates?>,
|
|
573
|
+
InputRect: WidgetCall<Input<Rect>, WidgetArguments, WidgetStates?>,
|
|
574
|
+
InputColor3: WidgetCall<InputColor3, WidgetArguments, WidgetStates?>,
|
|
575
|
+
InputColor4: WidgetCall<InputColor4, WidgetArguments, WidgetStates?>,
|
|
576
|
+
|
|
577
|
+
-- Drag Widget API
|
|
578
|
+
DragNum: WidgetCall<Input<number>, WidgetArguments, WidgetStates?>,
|
|
579
|
+
DragVector2: WidgetCall<Input<Vector2>, WidgetArguments, WidgetStates?>,
|
|
580
|
+
DragVector3: WidgetCall<Input<Vector3>, WidgetArguments, WidgetStates?>,
|
|
581
|
+
DragUDim: WidgetCall<Input<UDim>, WidgetArguments, WidgetStates?>,
|
|
582
|
+
DragUDim2: WidgetCall<Input<UDim2>, WidgetArguments, WidgetStates?>,
|
|
583
|
+
DragRect: WidgetCall<Input<Rect>, WidgetArguments, WidgetStates?>,
|
|
584
|
+
|
|
585
|
+
-- Slider Widget API
|
|
586
|
+
SliderNum: WidgetCall<Input<number>, WidgetArguments, WidgetStates?>,
|
|
587
|
+
SliderVector2: WidgetCall<Input<Vector2>, WidgetArguments, WidgetStates?>,
|
|
588
|
+
SliderVector3: WidgetCall<Input<Vector3>, WidgetArguments, WidgetStates?>,
|
|
589
|
+
SliderUDim: WidgetCall<Input<UDim>, WidgetArguments, WidgetStates?>,
|
|
590
|
+
SliderUDim2: WidgetCall<Input<UDim2>, WidgetArguments, WidgetStates?>,
|
|
591
|
+
SliderRect: WidgetCall<Input<Rect>, WidgetArguments, WidgetStates?>,
|
|
592
|
+
|
|
593
|
+
-- Combo Widget Widget API
|
|
594
|
+
Selectable: WidgetCall<Selectable, WidgetArguments, WidgetStates?>,
|
|
595
|
+
Combo: WidgetCall<Combo, WidgetArguments, WidgetStates?>,
|
|
596
|
+
ComboArray: WidgetCall<Combo, WidgetArguments, WidgetStates?, { any }>,
|
|
597
|
+
ComboEnum: WidgetCall<Combo, WidgetArguments, WidgetStates?, Enum>,
|
|
598
|
+
InputEnum: WidgetCall<Combo, WidgetArguments, WidgetStates?, Enum>,
|
|
599
|
+
|
|
600
|
+
ProgressBar: WidgetCall<ProgressBar, WidgetArguments, WidgetStates?>,
|
|
601
|
+
PlotLines: WidgetCall<PlotLines, WidgetArguments, WidgetStates?>,
|
|
602
|
+
PlotHistogram: WidgetCall<PlotHistogram, WidgetArguments, WidgetStates?>,
|
|
603
|
+
|
|
604
|
+
Image: WidgetCall<Image, WidgetArguments, nil>,
|
|
605
|
+
ImageButton: WidgetCall<ImageButton, WidgetArguments, nil>,
|
|
606
|
+
|
|
607
|
+
-- Table Widget Api
|
|
608
|
+
Table: WidgetCall<Table, WidgetArguments, WidgetStates?>,
|
|
609
|
+
NextColumn: () -> number,
|
|
610
|
+
NextRow: () -> number,
|
|
611
|
+
SetColumnIndex: (index: number) -> (),
|
|
612
|
+
SetRowIndex: (index: number) -> (),
|
|
613
|
+
NextHeaderColumn: () -> number,
|
|
614
|
+
SetHeaderColumnIndex: (index: number) -> (),
|
|
615
|
+
SetColumnWidth: (index: number, width: number) -> (),
|
|
616
|
+
|
|
617
|
+
--[[
|
|
618
|
+
---------
|
|
619
|
+
STATE
|
|
620
|
+
---------
|
|
621
|
+
]]
|
|
622
|
+
|
|
623
|
+
State: <T>(initialValue: T) -> State<T>,
|
|
624
|
+
WeakState: <T>(initialValue: T) -> T,
|
|
625
|
+
VariableState: <T>(variable: T, callback: (T) -> ()) -> State<T>,
|
|
626
|
+
TableState: <K, V>(tab: { [K]: V }, key: K, callback: ((newValue: V) -> true?)?) -> State<V>,
|
|
627
|
+
ComputedState: <T, U>(firstState: State<T>, onChangeCallback: (firstValue: T) -> U) -> State<U>,
|
|
628
|
+
|
|
629
|
+
--[[
|
|
630
|
+
-------------
|
|
631
|
+
FUNCTIONS
|
|
632
|
+
-------------
|
|
633
|
+
]]
|
|
634
|
+
|
|
635
|
+
Init: (
|
|
636
|
+
parentInstance: BasePlayerGui | GuiBase2d?,
|
|
637
|
+
eventConnection: (RBXScriptSignal | (() -> number) | false)?,
|
|
638
|
+
allowMultipleInits: boolean
|
|
639
|
+
) -> Iris,
|
|
640
|
+
Shutdown: () -> (),
|
|
641
|
+
Connect: (self: Iris, callback: () -> ()) -> () -> (),
|
|
642
|
+
Append: (userInstance: GuiObject) -> (),
|
|
643
|
+
ForceRefresh: () -> (),
|
|
644
|
+
|
|
645
|
+
-- Widget
|
|
646
|
+
SetFocusedWindow: (thisWidget: Window?) -> (),
|
|
647
|
+
|
|
648
|
+
-- ID API
|
|
649
|
+
PushId: (ID: ID) -> (),
|
|
650
|
+
PopId: () -> (),
|
|
651
|
+
SetNextWidgetID: (ID: ID) -> (),
|
|
652
|
+
|
|
653
|
+
-- Config API
|
|
654
|
+
UpdateGlobalConfig: (deltaStyle: { [string]: any }) -> (),
|
|
655
|
+
PushConfig: (deltaStyle: { [string]: any }) -> (),
|
|
656
|
+
PopConfig: () -> (),
|
|
657
|
+
|
|
658
|
+
--[[
|
|
659
|
+
--------------
|
|
660
|
+
PROPERTIES
|
|
661
|
+
--------------
|
|
662
|
+
]]
|
|
663
|
+
|
|
664
|
+
Internal: Internal,
|
|
665
|
+
Disabled: boolean,
|
|
666
|
+
Args: { [string]: { [string]: number } },
|
|
667
|
+
Events: { [string]: () -> boolean },
|
|
668
|
+
|
|
669
|
+
TemplateConfig: { [string]: Config },
|
|
670
|
+
_config: Config,
|
|
671
|
+
ShowDemoWindow: () -> Window,
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
return {}
|