diff options
Diffstat (limited to 'src/ui/stats_display')
-rw-r--r-- | src/ui/stats_display/scenes/StatsDisplay.tscn | 43 | ||||
-rw-r--r-- | src/ui/stats_display/scripts/progression_label.gd | 8 | ||||
-rw-r--r-- | src/ui/stats_display/scripts/stats_display.gd | 20 |
3 files changed, 57 insertions, 14 deletions
diff --git a/src/ui/stats_display/scenes/StatsDisplay.tscn b/src/ui/stats_display/scenes/StatsDisplay.tscn index 9b86a55..998cdd6 100644 --- a/src/ui/stats_display/scenes/StatsDisplay.tscn +++ b/src/ui/stats_display/scenes/StatsDisplay.tscn @@ -17,36 +17,55 @@ margin_right = 320.0 margin_bottom = 180.0 [node name="HBox" type="HBoxContainer" parent="Center"] -margin_left = 126.0 -margin_top = 82.0 -margin_right = 194.0 -margin_bottom = 98.0 +margin_left = 96.0 +margin_top = 74.0 +margin_right = 224.0 +margin_bottom = 105.0 [node name="ProgressionPanel" type="PanelContainer" parent="Center/HBox"] -margin_right = 68.0 -margin_bottom = 16.0 +margin_right = 62.0 +margin_bottom = 31.0 [node name="VBox" type="VBoxContainer" parent="Center/HBox/ProgressionPanel"] margin_left = 1.0 margin_top = 1.0 -margin_right = 67.0 -margin_bottom = 15.0 +margin_right = 61.0 +margin_bottom = 30.0 custom_constants/separation = 0 [node name="Label" type="Label" parent="Center/HBox/ProgressionPanel/VBox"] -margin_right = 66.0 +margin_right = 60.0 margin_bottom = 13.0 custom_colors/font_color_shadow = Color( 0, 0, 0, 1 ) custom_fonts/font = ExtResource( 1 ) -text = "Progression" +text = "Highscores" [node name="HSeparator" type="HSeparator" parent="Center/HBox/ProgressionPanel/VBox"] margin_top = 13.0 -margin_right = 66.0 +margin_right = 60.0 margin_bottom = 14.0 [node name="VBox" type="VBoxContainer" parent="Center/HBox/ProgressionPanel/VBox"] margin_top = 14.0 -margin_right = 66.0 +margin_right = 60.0 margin_bottom = 14.0 custom_constants/separation = 0 + +[node name="Center" type="CenterContainer" parent="Center/HBox"] +margin_left = 66.0 +margin_right = 128.0 +margin_bottom = 31.0 + +[node name="Restart" type="PanelContainer" parent="Center/HBox/Center"] +margin_right = 62.0 +margin_bottom = 31.0 + +[node name="Label" type="Label" parent="Center/HBox/Center/Restart"] +margin_left = 1.0 +margin_top = 1.0 +margin_right = 61.0 +margin_bottom = 30.0 +custom_colors/font_color_shadow = Color( 0, 0, 0, 1 ) +text = "Press \"R\" +to restart" +align = 1 diff --git a/src/ui/stats_display/scripts/progression_label.gd b/src/ui/stats_display/scripts/progression_label.gd index d4a0da0..57db363 100644 --- a/src/ui/stats_display/scripts/progression_label.gd +++ b/src/ui/stats_display/scripts/progression_label.gd @@ -3,6 +3,9 @@ extends MarginContainer enum Type { BODY_SEGMENT, + DASH_SEGMENT, + SLOW_SEGMENT, + JUMP_SEGMENT, EMPTY } @@ -17,7 +20,10 @@ onready var texture_rect: TextureRect = $HBox/Center/VBox/TextureRect var textures: Dictionary = { - Type.BODY_SEGMENT: preload("res://ui/hud/progress_bars/sprites/grow_progress_icon.png"), + Type.BODY_SEGMENT: preload("res://ui/hud/progress_bars/sprites/grow/grow_progress_icon.png"), + Type.DASH_SEGMENT: preload("res://ui/hud/progress_bars/sprites/dash/dash_progress_icon.png"), + Type.SLOW_SEGMENT: preload("res://ui/hud/progress_bars/sprites/slow/slow_progress_icon.png"), + Type.JUMP_SEGMENT: preload("res://ui/hud/progress_bars/sprites/jump/jump_progress_icon.png"), Type.EMPTY: preload("res://ui/stats_display/sprites/sep_8x8.png") } diff --git a/src/ui/stats_display/scripts/stats_display.gd b/src/ui/stats_display/scripts/stats_display.gd index f1f17e8..e9422b1 100644 --- a/src/ui/stats_display/scripts/stats_display.gd +++ b/src/ui/stats_display/scripts/stats_display.gd @@ -35,8 +35,14 @@ func _on_display_stats(old_stats: Stats, new_stats: Stats, mut_stats: Array) -> func _get_type(stat_name: String) -> int: var type: int match stat_name: - "segments": + "points", "segments": type = ProgressionLabel.Type.BODY_SEGMENT + "dash_points", "dash_segments": + type = ProgressionLabel.Type.DASH_SEGMENT + "slow_points", "slow_segments": + type = ProgressionLabel.Type.SLOW_SEGMENT + "jump_points", "jump_segments": + type = ProgressionLabel.Type.JUMP_SEGMENT _: type = ProgressionLabel.Type.EMPTY return type @@ -47,6 +53,12 @@ func _get_prefix(stat_name: String) -> String: match stat_name: "points": prefix = "points" + "dash_points": + prefix = "points" + "slow_points": + prefix = "points" + "jump_points": + prefix = "points" _: prefix = "" return prefix @@ -56,6 +68,12 @@ func _should_print(stat_name: String, stats: Dictionary) -> bool: var to_print: Array = [ "points", "segments", + "dash_points", + "dash_segments", + "slow_points", + "slow_segments", + "jump_points", + "jump_segments" ] var to_print_check: Array = [ "dash_percentage", |