Commit 7089ab3c authored by Nathan Lovato's avatar Nathan Lovato
Browse files

Update scoreboard to use LineEdit

parent 98036fdd
......@@ -202,12 +202,5 @@ transform = Transform2D( 1, 0, 0, 1, 0, 0 )
[node name="ScoreBoard" parent="UI" index="0" instance=ExtResource( 11 )]
visible = false
anchor_left = 0.0
anchor_top = 0.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
......@@ -134,7 +134,7 @@ tracks/1/keys = {
"values": [ 4.10578, 0.0 ]
}
[node name="Gnu" type="KinematicBody2D" index="0"]
[node name="Gnu" type="KinematicBody2D"]
input_pickable = false
collision_layer = 1
......
......@@ -4,59 +4,154 @@
[ext_resource path="res://assets/fonts/ScoreTitle.tres" type="DynamicFont" id=2]
[sub_resource type="StyleBoxFlat" id=1]
content_margin_left = -1.0
content_margin_right = -1.0
content_margin_top = -1.0
content_margin_bottom = -1.0
bg_color = Color( 0.168627, 0.137255, 0.223529, 0.576471 )
draw_center = true
border_width_left = 0
border_width_top = 0
border_width_right = 0
border_width_bottom = 0
border_color = Color( 0.8, 0.8, 0.8, 1 )
border_blend = false
corner_radius_top_left = 0
corner_radius_top_right = 0
corner_radius_bottom_right = 0
corner_radius_bottom_left = 0
corner_detail = 8
expand_margin_left = 0.0
expand_margin_right = 0.0
expand_margin_top = 0.0
expand_margin_bottom = 0.0
shadow_color = Color( 0, 0, 0, 0.6 )
shadow_size = 0
anti_aliasing = true
anti_aliasing_size = 1
[node name="ScoreBoard" type="Control"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
script = ExtResource( 1 )
[node name="Panel" type="Panel" parent="."]
[node name="Panel" type="Panel" parent="." index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 80.0
margin_top = 360.0
margin_top = 680.0
margin_right = -80.0
margin_bottom = -300.0
margin_bottom = -600.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
custom_styles/panel = SubResource( 1 )
[node name="Column" type="VBoxContainer" parent="."]
[node name="Column" type="VBoxContainer" parent="." index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 120.0
margin_top = 460.0
margin_top = 780.0
margin_right = -120.0
margin_bottom = -400.0
margin_bottom = -640.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
[node name="Title" type="Label" parent="Column" index="0"]
[node name="Title" type="Label" parent="Column"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 840.0
margin_bottom = 127.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = ExtResource( 2 )
text = "High scores"
align = 1
uppercase = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Spacer" type="Control" parent="Column" index="1"]
[node name="Spacer" type="Control" parent="Column"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 131.0
margin_right = 840.0
margin_bottom = 207.0
margin_bottom = 161.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 3
size_flags_stretch_ratio = 0.1
[node name="ScoresColumn" type="VBoxContainer" parent="Column"]
margin_top = 211.0
[node name="ScoresColumn" type="VBoxContainer" parent="Column" index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 165.0
margin_right = 840.0
margin_bottom = 978.0
margin_bottom = 465.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 3
alignment = 0
[node name="Spacer2" type="Control" parent="Column"]
margin_top = 982.0
[node name="Spacer2" type="Control" parent="Column" index="3"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 469.0
margin_right = 840.0
margin_bottom = 1060.0
margin_bottom = 500.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 3
size_flags_stretch_ratio = 0.1
......@@ -22,8 +22,10 @@ func register(score):
sorted_scores.append({initials='YOU', score=score})
sorted_scores.sort_custom(self, 'sort_scores')
sorted_scores.pop_back()
_scores = sorted_scores
save()
if sorted_scores != _scores:
_scores = sorted_scores
save()
return _scores
static func sort_scores(a, b):
......
[gd_scene load_steps=5 format=2]
[gd_scene load_steps=8 format=2]
[ext_resource path="res://ScoreBoard/ScoreRow.gd" type="Script" id=1]
[ext_resource path="res://assets/fonts/ScoreRow.tres" type="DynamicFont" id=2]
......@@ -21,9 +21,29 @@ func set_rank(index):
text = \"%s%s\" % [index + 1, suffix]
"
[sub_resource type="Animation" id=2]
[sub_resource type="StyleBoxEmpty" id=2]
content_margin_left = -1.0
content_margin_right = -1.0
content_margin_top = -1.0
content_margin_bottom = -1.0
[sub_resource type="StyleBoxEmpty" id=3]
content_margin_left = -1.0
content_margin_right = -1.0
content_margin_top = -1.0
content_margin_bottom = -1.0
[sub_resource type="StyleBoxEmpty" id=4]
content_margin_left = -1.0
content_margin_right = -1.0
content_margin_top = -1.0
content_margin_bottom = -1.0
[sub_resource type="Animation" id=5]
resource_name = "fade_in"
length = 0.3
loop = false
step = 0.1
......@@ -103,7 +123,7 @@ percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Initials" type="Label" parent="." index="2"]
[node name="Initials" type="LineEdit" parent="." index="2"]
anchor_left = 0.0
anchor_top = 0.0
......@@ -118,12 +138,18 @@ mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 4
custom_styles/read_only = SubResource( 2 )
custom_styles/focus = SubResource( 3 )
custom_styles/normal = SubResource( 4 )
custom_fonts/font = ExtResource( 2 )
text = "RMS"
uppercase = true
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
max_length = 3
focus_mode = 0
context_menu_enabled = false
placeholder_text = "AAA"
placeholder_alpha = 0.6
caret_blink = true
caret_blink_speed = 0.65
caret_position = 0
[node name="AnimationPlayer" type="AnimationPlayer" parent="." index="3"]
......@@ -132,7 +158,7 @@ autoplay = ""
playback_process_mode = 1
playback_default_blend_time = 0.0
playback_speed = 1.0
anims/fade_in = SubResource( 2 )
anims/fade_in = SubResource( 5 )
blend_times = [ ]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment