-
Notifications
You must be signed in to change notification settings - Fork 14
/
frame.ts
306 lines (241 loc) · 6.82 KB
/
frame.ts
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
/** @noSelfInFile **/
import { Handle } from "./handle";
export class Frame extends Handle<framehandle> {
constructor(name: string, owner: Frame, priority: number, createContext: number);
/**
* Creates a SimpleFrame.
* @param name
* @param owner
* @param createContext
*/
constructor(name: string, owner: Frame, createContext: number);
constructor(name: string, owner: Frame, priority: number, createContext?: number) {
if (Handle.initFromHandle()) {
super();
} else {
if (!createContext) {
super(BlzCreateSimpleFrame(name, owner.handle, priority));
} else {
super(BlzCreateFrame(name, owner.handle, priority, createContext));
}
}
}
public set alpha(alpha: number) {
BlzFrameSetAlpha(this.handle, alpha);
}
public get alpha() {
return BlzFrameGetAlpha(this.handle);
}
public get children() {
const count = this.childrenCount;
const output: Frame[] = [];
for (let i = 0; i < count; i++) {
output.push(this.getChild(i));
}
return output;
}
public get childrenCount() {
return BlzFrameGetChildrenCount(this.handle);
}
public set enabled(flag: boolean) {
BlzFrameSetEnable(this.handle, flag);
}
public get enabled() {
return BlzFrameGetEnable(this.handle);
}
public set height(height: number) {
BlzFrameSetSize(this.handle, this.width, height);
}
public get height() {
return BlzFrameGetHeight(this.handle);
}
public set parent(parent: Frame) {
BlzFrameSetParent(this.handle, parent.handle);
}
public get parent() {
return Frame.fromHandle(BlzFrameGetParent(this.handle));
}
public set text(text: string) {
BlzFrameSetText(this.handle, text);
}
public get text() {
return BlzFrameGetText(this.handle);
}
public set textSizeLimit(size: number) {
BlzFrameSetTextSizeLimit(this.handle, size);
}
public get textSizeLimit() {
return BlzFrameGetTextSizeLimit(this.handle);
}
public set value(value: number) {
BlzFrameSetValue(this.handle, value);
}
public get value() {
return BlzFrameGetValue(this.handle);
}
public set visible(flag: boolean) {
BlzFrameSetVisible(this.handle, flag);
}
public get visible() {
return BlzFrameIsVisible(this.handle);
}
public set width(width: number) {
BlzFrameSetSize(this.handle, width, this.height);
}
public get width() {
return BlzFrameGetWidth(this.handle);
}
public addText(text: string) {
BlzFrameAddText(this.handle, text);
return this;
}
public cageMouse(enable: boolean) {
BlzFrameCageMouse(this.handle, enable);
return this;
}
public clearPoints() {
BlzFrameClearAllPoints(this.handle);
return this;
}
public click() {
BlzFrameClick(this.handle);
return this;
}
public destroy() {
BlzDestroyFrame(this.handle);
return this;
}
public getChild(index: number) {
return Frame.fromHandle(BlzFrameGetChild(this.handle, index));
}
public setAbsPoint(point: framepointtype, x: number, y: number) {
BlzFrameSetAbsPoint(this.handle, point, x, y);
return this;
}
public setAllPoints(relative: Frame) {
BlzFrameSetAllPoints(this.handle, relative.handle);
return this;
}
public setAlpha(alpha: number) {
BlzFrameSetAlpha(this.handle, alpha);
return this;
}
public setEnabled(flag: boolean) {
BlzFrameSetEnable(this.handle, flag);
return this;
}
public setFocus(flag: boolean) {
BlzFrameSetFocus(this.handle, flag);
return this;
}
public setFont(filename: string, height: number, flags: number) {
BlzFrameSetFont(this.handle, filename, height, flags);
return this;
}
public setHeight(height: number) {
BlzFrameSetSize(this.handle, this.width, height);
return this;
}
public setLevel(level: number) {
BlzFrameSetLevel(this.handle, level);
return this;
}
public setMinMaxValue(minValue: number, maxValue: number) {
BlzFrameSetMinMaxValue(this.handle, minValue, maxValue);
return this;
}
public setModel(modelFile: string, cameraIndex: number) {
BlzFrameSetModel(this.handle, modelFile, cameraIndex);
return this;
}
public setParent(parent: Frame) {
BlzFrameSetParent(this.handle, parent.handle);
return this;
}
public setPoint(point: framepointtype, relative: Frame, relativePoint: framepointtype, x: number, y: number) {
BlzFrameSetPoint(this.handle, point, relative.handle, relativePoint, x, y);
return this;
}
public setScale(scale: number) {
BlzFrameSetScale(this.handle, scale);
return this;
}
public setSize(width: number, height: number) {
BlzFrameSetSize(this.handle, width, height);
return this;
}
public setSpriteAnimate(primaryProp: number, flags: number) {
BlzFrameSetSpriteAnimate(this.handle, primaryProp, flags);
return this;
}
public setStepSize(stepSize: number) {
BlzFrameSetStepSize(this.handle, stepSize);
return this;
}
public setText(text: string) {
BlzFrameSetText(this.handle, text);
return this;
}
public setTextColor(color: number) {
BlzFrameSetTextColor(this.handle, color);
return this;
}
public setTextSizeLimit(size: number) {
BlzFrameSetTextSizeLimit(this.handle, size);
return this;
}
public setTexture(texFile: string, flag: number, blend: boolean) {
BlzFrameSetTexture(this.handle, texFile, flag, blend);
return this;
}
public setTooltip(tooltip: Frame) {
BlzFrameSetTooltip(this.handle, tooltip.handle);
return this;
}
public setValue(value: number) {
BlzFrameSetValue(this.handle, value);
return this;
}
public setVertexColor(color: number) {
BlzFrameSetVertexColor(this.handle, color);
return this;
}
public setVisible(flag: boolean) {
BlzFrameSetVisible(this.handle, flag);
return this;
}
public setWidth(width: number) {
BlzFrameSetSize(this.handle, width, this.height);
return this;
}
public static autoPosition(enable: boolean) {
BlzEnableUIAutoPosition(enable);
}
public static fromEvent() {
return this.fromHandle(BlzGetTriggerFrame());
}
public static fromHandle(handle: framehandle): Frame {
return this.getObject(handle);
}
public static fromName(name: string, createContext: number) {
return this.fromHandle(BlzGetFrameByName(name, createContext));
}
public static fromOrigin(frameType: originframetype, index: number) {
return this.fromHandle(BlzGetOriginFrame(frameType, index));
}
public static getEventHandle() {
return BlzGetTriggerFrameEvent();
}
public static getEventText() {
return BlzGetTriggerFrameValue();
}
public static getEventValue() {
return BlzGetTriggerFrameValue();
}
public static hideOrigin(enable: boolean) {
BlzHideOriginFrames(enable);
}
public static loadTOC(filename: string) {
return BlzLoadTOCFile(filename);
}
}