Skip to content

Commit 2398e8e

Browse files
committed
BYOND version panel
1 parent 19afe96 commit 2398e8e

File tree

5 files changed

+40
-5
lines changed

5 files changed

+40
-5
lines changed

Diff for: src/app/components/panel/panel.component.ts

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export enum Panel {
99
Controller,
1010
Editor,
1111
Output,
12+
Byond,
1213
}
1314

1415
@Component({
@@ -46,6 +47,9 @@ export class PanelComponent {
4647
case Panel.Output:
4748
this.panelComponent = import('../../panels/output/output.component');
4849
break;
50+
case Panel.Byond:
51+
this.panelComponent = import('../../panels/byond/byond.component');
52+
break;
4953
}
5054
}
5155
}

Diff for: src/app/panels/byond/byond.component.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>byond works!</p>

Diff for: src/app/panels/byond/byond.component.scss

Whitespace-only changes.

Diff for: src/app/panels/byond/byond.component.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-panel-byond',
5+
standalone: true,
6+
imports: [],
7+
templateUrl: './byond.component.html',
8+
styleUrl: './byond.component.scss',
9+
})
10+
export default class ByondPanel {
11+
// noinspection JSUnusedGlobalSymbols
12+
static title = 'BYOND versions';
13+
}

Diff for: src/app/service/shell.service.ts

+22-5
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ const LOCAL_STORAGE_KEY = 'layout';
99
providedIn: 'root',
1010
})
1111
export class ShellService {
12+
private minimumVersion = 1;
1213
public layout?: PanelTreeRoot;
1314
private defaultLayout = JSON.stringify({
14-
version: 0,
15-
nextBranchId: 3,
15+
version: 1,
16+
nextBranchId: 4,
1617
id: 0,
1718
type: 'branch',
1819
split: 'vertical',
@@ -29,14 +30,27 @@ export class ShellService {
2930
size: 70,
3031
},
3132
{
32-
id: Panel.Output,
33-
type: 'leaf',
33+
id: 2,
34+
type: 'branch',
35+
split: 'vertical',
3436
size: 30,
37+
children: [
38+
{
39+
id: Panel.Output,
40+
type: 'leaf',
41+
size: 70,
42+
},
43+
{
44+
id: Panel.Byond,
45+
type: 'leaf',
46+
size: 30,
47+
},
48+
],
3549
},
3650
],
3751
},
3852
{
39-
id: 2,
53+
id: 3,
4054
type: 'branch',
4155
split: 'horizontal',
4256
size: 30,
@@ -78,5 +92,8 @@ export class ShellService {
7892
localStorage.getItem(LOCAL_STORAGE_KEY) ?? '',
7993
)) || this.defaultLayout,
8094
);
95+
if (this.layout!.version < this.minimumVersion) {
96+
this.layout = JSON.parse(this.defaultLayout);
97+
}
8198
}
8299
}

0 commit comments

Comments
 (0)