Skip to content

Commit dce02aa

Browse files
author
Eaglenait
committed
Various counter fixes
1 parent d52b13e commit dce02aa

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/app/advanced-presets/templates/counter.widget.template.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
export class {{CLASS_NAME}} {
2-
public containerWidget: mod.UIWidget = null;
3-
public textWidget: mod.UIWidget = null;
2+
public containerWidget: mod.UIWidget | undefined;
3+
public textWidget: mod.UIWidget | undefined;
44

55
private counterValue = 0;
66

7-
public create(): mod.UIWidget {
7+
public create(owner: mod.Player | mod.Team | null = null): void {
88
this.counterValue = 0;
99
this.containerWidget = modlib.ParseUI(
1010
{{UI_PARAMS}}
1111
);
1212
this.textWidget = mod.FindUIWidgetWithName('CounterText');
1313
this.refreshUi();
14-
return this.containerWidget;
1514
}
1615

1716
public increment(): number {
@@ -26,13 +25,14 @@ export class {{CLASS_NAME}} {
2625
return this.counterValue;
2726
}
2827

29-
pulic destroy() {
28+
public destroy() {
3029
if (this.containerWidget) {
3130
mod.DeleteUIWidget(this.containerWidget);
3231
}
3332
}
3433

3534
private refreshUi(): void {
35+
if (!this.textWidget) return;
3636
mod.SetUITextLabel(this.textWidget, mod.Message(this.counterValue.toString()));
3737
}
3838

src/app/components/header-bar.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<header class="header-bar">
22
<div class="header-main">
33
<div class="brand">
4-
<span class="brand__title">UI Builder V1.4.0</span>
4+
<span class="brand__title">UI Builder V1.4.1</span>
55
<span class="brand__subtitle">Battlefield Portal</span>
66
</div>
77

0 commit comments

Comments
 (0)