You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -107,12 +107,12 @@ describe('GLua API Writer', () => {
107
107
url: 'na',
108
108
arguments: [
109
109
{
110
-
args: [{
110
+
args: [{
111
111
name: 'intensity',
112
112
type: 'number',
113
113
description: 'The intensity of the explosion.',
114
114
default: '1000',
115
-
}]
115
+
}]
116
116
}
117
117
],
118
118
returns: [
@@ -397,6 +397,28 @@ describe('GLua API Writer', () => {
397
397
expect(api).toEqual(`--- Returns where on the screen the specified position vector would appear.\n---\n---[View wiki](na)\n---@return ToScreenData # The created Structures/ToScreenData.\nfunction Vector.ToScreen() end\n\n`);
398
398
});
399
399
400
+
it('should support Panel type',()=>{
401
+
constwriter=newGluaApiWriter();
402
+
constapi=writer.writePage(<PanelFunction>{
403
+
name: 'GetVBar',
404
+
address: 'DScrollPanel.GetVBar',
405
+
parent: 'DScrollPanel',
406
+
isPanelFunction: 'yes',
407
+
description: 'Returns the vertical scroll bar of the panel.',
408
+
realm: 'client',
409
+
type: 'panelfunc',
410
+
url: 'na',
411
+
returns: [
412
+
{
413
+
type: 'Panel{DVScrollBar}',
414
+
description: 'The DVScrollBar.',
415
+
},
416
+
],
417
+
});
418
+
419
+
expect(api).toEqual(`--- Returns the vertical scroll bar of the panel.\n---\n---[View wiki](na)\n---@return DVScrollBar # The DVScrollBar.\nfunction DScrollPanel:GetVBar() end\n\n`);
description: '`Serverside`, Sandbox and Sandbox derived only.\n\nCalled by the Drive property to override the default drive type, which is `drive_sandbox`.',
147
-
},
148
-
{
149
-
name: 'OnEntityCopyTableFinish',
150
-
type: 'function',
151
-
description: 'Documented at ENTITY:OnEntityCopyTableFinish.',
152
-
},
153
-
{
154
-
name: 'PostEntityCopy',
155
-
type: 'function',
156
-
description: 'Documented at ENTITY:PostEntityCopy.',
157
-
},
158
-
{
159
-
name: 'PostEntityPaste',
160
-
type: 'function',
161
-
description: 'Documented at ENTITY:PostEntityPaste.',
162
-
},
163
-
{
164
-
name: 'PreEntityCopy',
165
-
type: 'function',
166
-
description: 'Documented at ENTITY:PreEntityCopy.',
167
-
},
168
-
{
169
-
name: 'OnDuplicated',
170
-
type: 'function',
171
-
description: 'Documented at ENTITY:OnDuplicated.',
172
-
},
173
-
{
174
-
name: 'PhysgunDisabled',
175
-
type: 'boolean',
176
-
description: '`Shared`, Sandbox or Sandbox derived only.\n\nIf set to `true`, physgun will not be able to pick this entity up. This can also be set from map, see Sandbox Specific Mapping',
177
-
},
178
-
{
179
-
name: 'PhysgunPickup',
180
-
type: 'function',
181
-
description: '`Shared`, Sandbox or Sandbox derived only.\n\nCalled from GM:PhysgunPickup, overrides `PhysgunDisabled`',
182
-
},
183
-
{
184
-
name: 'm_tblToolsAllowed',
185
-
type: 'table',
186
-
description: '`Shared`, Sandbox or Sandbox derived only.\n\nControls which tools **and** properties can be used on this entity. Format is a list of strings where each string is the tool or property classname.\n\nThis can also be set from map, see Sandbox Specific Mapping',
187
-
},
188
-
{
189
-
name: 'GravGunPickupAllowed',
190
-
type: 'function',
191
-
description: 'Documented at ENTITY:GravGunPickupAllowed.',
192
-
},
193
-
{
194
-
name: 'GravGunPunt',
195
-
type: 'function',
196
-
description: 'Documented at ENTITY:GravGunPunt.',
197
-
},
198
-
{
199
-
name: 'CanProperty',
200
-
type: 'function',
201
-
description: 'Documented at ENTITY:CanProperty.',
202
-
},
203
-
{
204
-
name: 'CanTool',
205
-
type: 'function',
206
-
description: 'Documented at ENTITY:CanTool.',
207
-
},
208
-
{
209
-
name: 'CalcAbsolutePosition',
210
-
type: 'function',
211
-
description: 'Documented at ENTITY:CalcAbsolutePosition.',
212
-
},
213
-
{
214
-
name: 'RenderOverride',
215
-
type: 'function',
216
-
description: 'Documented at ENTITY:RenderOverride.',
217
-
},
218
-
{
219
-
name: 'm_RenderOrigin',
220
-
type: 'Vector',
221
-
description: '(Clientside) Do not use.',
222
-
},
223
-
{
224
-
name: 'm_RenderAngles',
225
-
type: 'Angle',
226
-
description: '(Clientside) Do not use.',
227
-
},
228
-
],
137
+
name: 'Custom_Entity_Fields',
138
+
address: 'Custom_Entity_Fields',
139
+
type: 'struct',
140
+
fields: [
141
+
{
142
+
name: 'GetEntityDriveMode',
143
+
type: 'function',
144
+
description: '`Serverside`, Sandbox and Sandbox derived only.\n\nCalled by the Drive property to override the default drive type, which is `drive_sandbox`.',
145
+
},
146
+
{
147
+
name: 'OnEntityCopyTableFinish',
148
+
type: 'function',
149
+
description: 'Documented at ENTITY:OnEntityCopyTableFinish.',
150
+
},
151
+
{
152
+
name: 'PostEntityCopy',
153
+
type: 'function',
154
+
description: 'Documented at ENTITY:PostEntityCopy.',
155
+
},
156
+
{
157
+
name: 'PostEntityPaste',
158
+
type: 'function',
159
+
description: 'Documented at ENTITY:PostEntityPaste.',
160
+
},
161
+
{
162
+
name: 'PreEntityCopy',
163
+
type: 'function',
164
+
description: 'Documented at ENTITY:PreEntityCopy.',
165
+
},
166
+
{
167
+
name: 'OnDuplicated',
168
+
type: 'function',
169
+
description: 'Documented at ENTITY:OnDuplicated.',
170
+
},
171
+
{
172
+
name: 'PhysgunDisabled',
173
+
type: 'boolean',
174
+
description: '`Shared`, Sandbox or Sandbox derived only.\n\nIf set to `true`, physgun will not be able to pick this entity up. This can also be set from map, see Sandbox Specific Mapping',
175
+
},
176
+
{
177
+
name: 'PhysgunPickup',
178
+
type: 'function',
179
+
description: '`Shared`, Sandbox or Sandbox derived only.\n\nCalled from GM:PhysgunPickup, overrides `PhysgunDisabled`',
180
+
},
181
+
{
182
+
name: 'm_tblToolsAllowed',
183
+
type: 'table',
184
+
description: '`Shared`, Sandbox or Sandbox derived only.\n\nControls which tools **and** properties can be used on this entity. Format is a list of strings where each string is the tool or property classname.\n\nThis can also be set from map, see Sandbox Specific Mapping',
185
+
},
186
+
{
187
+
name: 'GravGunPickupAllowed',
188
+
type: 'function',
189
+
description: 'Documented at ENTITY:GravGunPickupAllowed.',
190
+
},
191
+
{
192
+
name: 'GravGunPunt',
193
+
type: 'function',
194
+
description: 'Documented at ENTITY:GravGunPunt.',
195
+
},
196
+
{
197
+
name: 'CanProperty',
198
+
type: 'function',
199
+
description: 'Documented at ENTITY:CanProperty.',
200
+
},
201
+
{
202
+
name: 'CanTool',
203
+
type: 'function',
204
+
description: 'Documented at ENTITY:CanTool.',
205
+
},
206
+
{
207
+
name: 'CalcAbsolutePosition',
208
+
type: 'function',
209
+
description: 'Documented at ENTITY:CalcAbsolutePosition.',
210
+
},
211
+
{
212
+
name: 'RenderOverride',
213
+
type: 'function',
214
+
description: 'Documented at ENTITY:RenderOverride.',
| %q | Formats a string between double quotes, using escape sequences when necessary to ensure that it can safely be read back by the Lua interpreter | \`"test\\1\\2test"\` |`,
51
+
`The following specifiers are exclusive to LuaJIT:
| %q | Formats a string between double quotes, using escape sequences when necessary to ensure that it can safely be read back by the Lua interpreter | \`"test\\1\\2test"\` |
58
+
--]]`,
59
+
true,
60
+
],
61
+
[
62
+
`The following specifiers are exclusive to LuaJIT:
| %q | Formats a string between double quotes, using escape sequences when necessary to ensure that it can safely be read back by the Lua interpreter | \`"test\\1\\2test"\` |`,
| %q | Formats a string between double quotes, using escape sequences when necessary to ensure that it can safely be read back by the Lua interpreter | \`"test\\1\\2test"\` |
75
+
--]]`,
76
+
],
77
+
])('should put a comment before each line',(input,expected,skipFirstLine=false)=>{
0 commit comments