Skip to content

Commit c08b9c0

Browse files
committed
feat: add preview display with feature parity
Supports adjusting size and speed just like the old design.
1 parent 3d43161 commit c08b9c0

File tree

8 files changed

+173
-111
lines changed

8 files changed

+173
-111
lines changed

scenes/levels_redesign.gd

Lines changed: 0 additions & 36 deletions
This file was deleted.

scenes/levels_redesign.tscn

Lines changed: 70 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
[gd_scene load_steps=3 format=2]
1+
[gd_scene load_steps=4 format=2]
22

33
[ext_resource path="res://assets/theme.theme" type="Theme" id=1]
4-
[ext_resource path="res://scenes/levels_redesign.gd" type="Script" id=2]
4+
[ext_resource path="res://scripts/levels_redesign.gd" type="Script" id=2]
5+
[ext_resource path="res://scripts/border.gd" type="Script" id=3]
56

67
[node name="Viewport" type="MarginContainer"]
78
anchor_right = 1.0
@@ -18,84 +19,116 @@ margin_right = 1260.0
1819
margin_bottom = 700.0
1920
script = ExtResource( 2 )
2021

21-
[node name="Names" type="HBoxContainer" parent="Levels"]
22+
[node name="NamesContainer" type="MarginContainer" parent="Levels"]
2223
margin_right = 1240.0
23-
margin_bottom = 19.0
24+
margin_bottom = 59.0
25+
script = ExtResource( 3 )
2426

25-
[node name="Current" type="Label" parent="Levels/Names"]
26-
margin_right = 1240.0
27+
[node name="Names" type="HBoxContainer" parent="Levels/NamesContainer"]
28+
margin_left = 20.0
29+
margin_top = 20.0
30+
margin_right = 1220.0
31+
margin_bottom = 39.0
32+
33+
[node name="Previous" type="Label" parent="Levels/NamesContainer/Names"]
34+
margin_right = 557.0
2735
margin_bottom = 19.0
2836
size_flags_horizontal = 3
29-
text = "< CURRENT >"
37+
text = "<"
38+
align = 2
39+
__meta__ = {
40+
"_edit_use_anchors_": false
41+
}
42+
43+
[node name="Current" type="Label" parent="Levels/NamesContainer/Names"]
44+
margin_left = 565.0
45+
margin_right = 635.0
46+
margin_bottom = 19.0
47+
custom_colors/font_color = Color( 1, 0.690196, 0, 1 )
48+
text = "CURRENT"
3049
align = 1
3150

32-
[node name="HBoxContainer" type="HBoxContainer" parent="Levels"]
33-
margin_top = 27.0
51+
[node name="Next" type="Label" parent="Levels/NamesContainer/Names"]
52+
margin_left = 643.0
53+
margin_right = 1200.0
54+
margin_bottom = 19.0
55+
size_flags_horizontal = 3
56+
text = ">"
57+
58+
[node name="Info" type="HBoxContainer" parent="Levels"]
59+
margin_top = 67.0
3460
margin_right = 1240.0
35-
margin_bottom = 134.0
61+
margin_bottom = 680.0
62+
size_flags_vertical = 3
3663

37-
[node name="MarginContainer" type="MarginContainer" parent="Levels/HBoxContainer"]
64+
[node name="CodeContainer" type="MarginContainer" parent="Levels/Info"]
3865
margin_right = 616.0
39-
margin_bottom = 107.0
66+
margin_bottom = 613.0
4067
size_flags_horizontal = 3
68+
script = ExtResource( 3 )
4169

42-
[node name="Label" type="Label" parent="Levels/HBoxContainer/MarginContainer"]
70+
[node name="Code" type="Label" parent="Levels/Info/CodeContainer"]
4371
margin_left = 20.0
44-
margin_top = 44.0
72+
margin_top = 20.0
4573
margin_right = 596.0
46-
margin_bottom = 63.0
74+
margin_bottom = 593.0
75+
size_flags_vertical = 3
4776

48-
[node name="VBoxContainer" type="VBoxContainer" parent="Levels/HBoxContainer"]
77+
[node name="VBoxContainer" type="VBoxContainer" parent="Levels/Info"]
4978
margin_left = 624.0
5079
margin_right = 1240.0
51-
margin_bottom = 107.0
80+
margin_bottom = 613.0
5281
size_flags_horizontal = 3
5382

54-
[node name="MarginContainer" type="MarginContainer" parent="Levels/HBoxContainer/VBoxContainer"]
83+
[node name="Display" type="MarginContainer" parent="Levels/Info/VBoxContainer"]
5584
margin_right = 616.0
56-
margin_bottom = 40.0
85+
margin_bottom = 302.0
5786
size_flags_vertical = 3
87+
script = ExtResource( 3 )
5888

59-
[node name="HBoxContainer" type="HBoxContainer" parent="Levels/HBoxContainer/VBoxContainer"]
60-
margin_top = 48.0
89+
[node name="HBoxContainer" type="HBoxContainer" parent="Levels/Info/VBoxContainer"]
90+
margin_top = 310.0
6191
margin_right = 616.0
62-
margin_bottom = 107.0
92+
margin_bottom = 613.0
6393
size_flags_vertical = 3
6494

65-
[node name="MarginContainer" type="MarginContainer" parent="Levels/HBoxContainer/VBoxContainer/HBoxContainer"]
95+
[node name="MarginContainer" type="MarginContainer" parent="Levels/Info/VBoxContainer/HBoxContainer"]
6696
margin_right = 200.0
67-
margin_bottom = 59.0
97+
margin_bottom = 303.0
6898
size_flags_horizontal = 3
6999

70-
[node name="Label" type="Label" parent="Levels/HBoxContainer/VBoxContainer/HBoxContainer/MarginContainer"]
100+
[node name="Label" type="Label" parent="Levels/Info/VBoxContainer/HBoxContainer/MarginContainer"]
71101
margin_left = 20.0
72-
margin_top = 20.0
102+
margin_top = 142.0
73103
margin_right = 180.0
74-
margin_bottom = 39.0
104+
margin_bottom = 161.0
75105
size_flags_horizontal = 3
76106

77-
[node name="MarginContainer2" type="MarginContainer" parent="Levels/HBoxContainer/VBoxContainer/HBoxContainer"]
107+
[node name="MarginContainer2" type="MarginContainer" parent="Levels/Info/VBoxContainer/HBoxContainer"]
78108
margin_left = 208.0
79109
margin_right = 408.0
80-
margin_bottom = 59.0
110+
margin_bottom = 303.0
81111
size_flags_horizontal = 3
82112

83-
[node name="Label" type="Label" parent="Levels/HBoxContainer/VBoxContainer/HBoxContainer/MarginContainer2"]
113+
[node name="Label" type="Label" parent="Levels/Info/VBoxContainer/HBoxContainer/MarginContainer2"]
84114
margin_left = 20.0
85-
margin_top = 20.0
115+
margin_top = 142.0
86116
margin_right = 180.0
87-
margin_bottom = 39.0
117+
margin_bottom = 161.0
88118
size_flags_horizontal = 3
89119

90-
[node name="MarginContainer3" type="MarginContainer" parent="Levels/HBoxContainer/VBoxContainer/HBoxContainer"]
120+
[node name="MarginContainer3" type="MarginContainer" parent="Levels/Info/VBoxContainer/HBoxContainer"]
91121
margin_left = 416.0
92122
margin_right = 616.0
93-
margin_bottom = 59.0
123+
margin_bottom = 303.0
94124
size_flags_horizontal = 3
95125

96-
[node name="Label" type="Label" parent="Levels/HBoxContainer/VBoxContainer/HBoxContainer/MarginContainer3"]
126+
[node name="Label" type="Label" parent="Levels/Info/VBoxContainer/HBoxContainer/MarginContainer3"]
97127
margin_left = 20.0
98-
margin_top = 20.0
128+
margin_top = 142.0
99129
margin_right = 180.0
100-
margin_bottom = 39.0
130+
margin_bottom = 161.0
101131
size_flags_horizontal = 3
132+
133+
[node name="Timer" type="Timer" parent="Levels"]
134+
[connection signal="timeout" from="Levels/Timer" to="Levels" method="_on_Timer_timeout"]

scenes/menu.tscn

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
[ext_resource path="res://scripts/border.gd" type="Script" id=3]
66

77
[node name="Viewport" type="MarginContainer"]
8-
anchor_left = 0.000711028
9-
anchor_top = 0.00126399
10-
anchor_right = 1.00071
11-
anchor_bottom = 1.00126
8+
anchor_right = 1.0
9+
anchor_bottom = 1.0
1210
theme = ExtResource( 2 )
1311
custom_constants/margin_right = 40
1412
custom_constants/margin_top = 30
@@ -21,36 +19,36 @@ __meta__ = {
2119
[node name="MainMenu" type="VBoxContainer" parent="."]
2220
margin_left = 40.0
2321
margin_top = 30.0
24-
margin_right = 1239.0
25-
margin_bottom = 689.0
22+
margin_right = 1240.0
23+
margin_bottom = 690.0
2624
script = ExtResource( 1 )
2725

2826
[node name="Title" type="Label" parent="MainMenu"]
29-
margin_right = 1199.0
27+
margin_right = 1200.0
3028
margin_bottom = 19.0
3129
text = "Human Computer Simulator"
3230
uppercase = true
3331

3432
[node name="Display" type="MarginContainer" parent="MainMenu"]
3533
margin_top = 27.0
36-
margin_right = 1199.0
37-
margin_bottom = 624.0
34+
margin_right = 1200.0
35+
margin_bottom = 625.0
3836
size_flags_vertical = 3
3937
script = ExtResource( 3 )
4038
__meta__ = {
4139
"_edit_use_anchors_": false
4240
}
4341

4442
[node name="Spacing" type="Control" parent="MainMenu"]
45-
margin_top = 632.0
46-
margin_right = 1199.0
47-
margin_bottom = 632.0
43+
margin_top = 633.0
44+
margin_right = 1200.0
45+
margin_bottom = 633.0
4846

4947
[node name="Buttons" type="HBoxContainer" parent="MainMenu"]
50-
margin_left = 289.0
51-
margin_top = 640.0
52-
margin_right = 909.0
53-
margin_bottom = 659.0
48+
margin_left = 290.0
49+
margin_top = 641.0
50+
margin_right = 910.0
51+
margin_bottom = 660.0
5452
size_flags_horizontal = 4
5553
custom_constants/separation = 500
5654

scenes/play.tscn

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,58 +8,54 @@
88
anchor_right = 1.0
99
anchor_bottom = 1.0
1010
theme = ExtResource( 2 )
11-
custom_constants/margin_right = 30
12-
custom_constants/margin_top = 30
13-
custom_constants/margin_left = 30
14-
custom_constants/margin_bottom = 30
1511
__meta__ = {
1612
"_edit_use_anchors_": false
1713
}
1814

1915
[node name="GameDisplay" type="VBoxContainer" parent="."]
20-
margin_left = 30.0
21-
margin_top = 30.0
22-
margin_right = 1250.0
23-
margin_bottom = 690.0
16+
margin_left = 20.0
17+
margin_top = 20.0
18+
margin_right = 1260.0
19+
margin_bottom = 700.0
2420
script = ExtResource( 1 )
2521

2622
[node name="HUDBorder" type="MarginContainer" parent="GameDisplay"]
27-
margin_right = 1220.0
23+
margin_right = 1240.0
2824
margin_bottom = 59.0
2925
script = ExtResource( 3 )
3026

3127
[node name="HUD" type="HBoxContainer" parent="GameDisplay/HUDBorder"]
3228
margin_left = 20.0
3329
margin_top = 20.0
34-
margin_right = 1200.0
30+
margin_right = 1220.0
3531
margin_bottom = 39.0
3632

3733
[node name="Level" type="Label" parent="GameDisplay/HUDBorder/HUD"]
38-
margin_right = 586.0
34+
margin_right = 596.0
3935
margin_bottom = 19.0
4036
size_flags_horizontal = 3
4137
text = "LEVEL"
4238

4339
[node name="Score" type="Label" parent="GameDisplay/HUDBorder/HUD"]
44-
margin_left = 594.0
45-
margin_right = 1180.0
40+
margin_left = 604.0
41+
margin_right = 1200.0
4642
margin_bottom = 19.0
4743
size_flags_horizontal = 3
4844
text = "0.000"
4945
align = 2
5046

5147
[node name="Display" type="MarginContainer" parent="GameDisplay"]
5248
margin_top = 67.0
53-
margin_right = 1220.0
54-
margin_bottom = 660.0
49+
margin_right = 1240.0
50+
margin_bottom = 680.0
5551
size_flags_vertical = 3
5652
script = ExtResource( 3 )
5753

5854
[node name="Label" type="Label" parent="GameDisplay/Display"]
5955
margin_left = 20.0
60-
margin_top = 287.0
61-
margin_right = 1200.0
62-
margin_bottom = 306.0
56+
margin_top = 297.0
57+
margin_right = 1220.0
58+
margin_bottom = 316.0
6359
text = "ready..."
6460
align = 1
6561

0 commit comments

Comments
 (0)