-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathticker-display.d.ts
130 lines (118 loc) · 3.61 KB
/
ticker-display.d.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
declare namespace ig {
interface TextParser {
parse(
this: this,
text: sc.ui2.ParsedTextData,
commands: ig.TextCommand[] | null,
font: ig.MultiFont,
ignoreCommands?: boolean,
): string;
}
interface TextBlock {
setText(this: this, text: sc.ui2.ParsedTextData): void;
}
interface TextBlockConstructor {
// eslint-disable-next-line @typescript-eslint/prefer-function-type
new (
font: ig.MultiFont,
text: sc.ui2.ParsedTextData,
settings: ig.TextBlock.Settings,
): TextBlock;
}
}
declare namespace sc {
interface TextGui {
tickerHook: sc.ui2.TickerDisplayHook;
}
}
declare namespace sc.ui2 {
namespace TickerDisplayHook {
type RenderTextCallback = (renderer: ig.GuiRenderer, x: number, y: number) => void;
interface FocusTarget {
focus?: boolean;
keepPressed?: boolean;
pressed?: boolean;
}
}
interface TickerDisplayHook {
hook: ig.GuiHook;
renderText: TickerDisplayHook.RenderTextCallback;
enable: boolean;
timer: number;
speed: number;
delayAtBorders: number;
constantTextOffset: Vec2;
shadowGfx: ig.Image;
maxWidth: number | null | undefined;
focusTarget: TickerDisplayHook.FocusTarget | null | undefined;
focusTargetKeepPressed: boolean;
update(this: this): void;
updateDrawables(this: this, renderer: ig.GuiRenderer): void;
_tryRenderTicker(this: this, renderer: ig.GuiRenderer): boolean;
}
interface TickerDisplayHookConstructor extends ImpactClass<TickerDisplayHook> {
new (
hook: ig.GuiHook,
renderText: sc.ui2.TickerDisplayHook.RenderTextCallback,
): TickerDisplayHook;
PATTERN_SHADOW_LEFT: ig.ImagePattern;
PATTERN_SHADOW_RIGHT: ig.ImagePattern;
}
let TickerDisplayHook: TickerDisplayHookConstructor;
interface ParsedTextData extends ig.Class {
parsedText: string;
commands: ig.TextCommand[];
}
interface ParsedTextDataConstructor extends ImpactClass<ParsedTextData> {
new (parsedText: string, commands: ig.TextCommand[]): ParsedTextData;
}
let ParsedTextData: ParsedTextDataConstructor;
namespace LongHorizontalTextGui {
interface Settings {
font?: ig.MultiFont;
linePadding?: number;
}
}
interface LongHorizontalTextGui extends ig.GuiElementBase {
text: string;
parsedText: string;
commands: ig.TextCommand[];
textBlocks: ig.TextBlock[];
font: ig.MultiFont;
linePadding: number;
tickerHook: sc.ui2.TickerDisplayHook;
setText(this: this, text: sc.TextLike): void;
prerender(this: this): void;
clear(this: this): void;
}
interface LongHorizontalTextGuiConstructor extends ImpactClass<LongHorizontalTextGui> {
new (
text: sc.TextLike,
settings?: sc.ui2.LongHorizontalTextGui.Settings,
): LongHorizontalTextGui;
SPLIT_WIDTH: number;
}
let LongHorizontalTextGui: LongHorizontalTextGuiConstructor;
namespace IconTextGui {
interface Settings {
font?: ig.MultiFont;
linePadding?: number;
}
}
interface IconTextGui extends ig.GuiElementBase {
font: ig.MultiFont;
text: string;
iconTextBlock: ig.TextBlock;
textBlock: ig.TextBlock;
tickerHook: sc.ui2.TickerDisplayHook;
setText(this: this, text: sc.TextLike): void;
_updateDimensions(this: this): void;
setDrawCallback(this: this, callback: ig.TextBlock.DrawCallback): void;
prerender(this: this): void;
clear(this: this): void;
}
interface IconTextGuiConstructor extends ImpactClass<IconTextGui> {
new (text: sc.TextLike, settings?: sc.ui2.IconTextGui.Settings): IconTextGui;
}
let IconTextGui: IconTextGuiConstructor;
}