From 395c25b1fbe51f42decf402f97e51eabcc8c0a77 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 18 Jun 2023 16:43:22 +0200 Subject: Godot v3 -> v4 --- UI/HUD/CancelButton.tscn | 32 ++++----- UI/HUD/LevelMap.gd | 8 +-- UI/HUD/LevelMap.tscn | 23 +++--- UI/HUD/LevelMapCell.gd | 15 ++-- UI/HUD/LevelMapCell.tscn | 182 ++++++++++++++++++++++++++++++++++------------- UI/HUD/Timer.tscn | 13 +--- 6 files changed, 173 insertions(+), 100 deletions(-) (limited to 'UI/HUD') diff --git a/UI/HUD/CancelButton.tscn b/UI/HUD/CancelButton.tscn index 27441cb..e069083 100644 --- a/UI/HUD/CancelButton.tscn +++ b/UI/HUD/CancelButton.tscn @@ -1,28 +1,24 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=4 format=3 uid="uid://c1t4wotcq114x"] -[ext_resource path="res://UI/HUD/CancelButton.gd" type="Script" id=1] +[ext_resource type="Script" path="res://UI/HUD/CancelButton.gd" id="1"] -[sub_resource type="StyleBoxFlat" id=2] -bg_color = Color( 0, 0, 0, 1 ) - -[sub_resource type="StyleBoxFlat" id=1] -bg_color = Color( 0.6, 0.6, 0.6, 0 ) +[sub_resource type="StyleBoxFlat" id="1"] +bg_color = Color(0.6, 0.6, 0.6, 0) border_width_left = 1 border_width_top = 1 border_width_right = 1 border_width_bottom = 1 -border_color = Color( 0, 0, 0, 1 ) +border_color = Color(0, 0, 0, 1) + +[sub_resource type="StyleBoxFlat" id="2"] +bg_color = Color(0, 0, 0, 1) [node name="CancelButton" type="Button"] -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_top = 576.0 -margin_right = -960.0 -custom_styles/hover = SubResource( 2 ) -custom_styles/normal = SubResource( 1 ) +offset_right = 159.0 +offset_bottom = 62.0 +theme_override_styles/normal = SubResource("1") +theme_override_styles/hover = SubResource("2") text = "Cancel" -script = ExtResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} +script = ExtResource("1") + [connection signal="pressed" from="." to="." method="_on_CancelButton_pressed"] diff --git a/UI/HUD/LevelMap.gd b/UI/HUD/LevelMap.gd index 1b4b860..8c67520 100644 --- a/UI/HUD/LevelMap.gd +++ b/UI/HUD/LevelMap.gd @@ -2,7 +2,7 @@ extends Panel func _ready(): - Global.connect("level_map_updated", self, "draw") + Global.connect("level_map_updated", Callable(self, "draw")) self.draw() @@ -11,13 +11,13 @@ func draw(): #var Level = get_parent().get_parent() # HUD > Level for idx in range(Global.Level_Map.size()): # size = 9 - var cell = Cell.instance() + var cell = Cell.instantiate() cell.level_idx = idx cell.set_rect_size(150/3, 150/3) var column = idx % 3 var row = idx / 3 - cell.rect_position.x = cell.rect_size.x*column - cell.rect_position.y = cell.rect_size.y*row + cell.position.x = cell.size.x*column + cell.position.y = cell.size.y*row #if idx == Level.idx: #cell.set_border_width_all(3) diff --git a/UI/HUD/LevelMap.tscn b/UI/HUD/LevelMap.tscn index 646c96a..5f3ab37 100644 --- a/UI/HUD/LevelMap.tscn +++ b/UI/HUD/LevelMap.tscn @@ -1,18 +1,13 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=3 format=3 uid="uid://ds2y86kx2kfxq"] -[ext_resource path="res://UI/HUD/LevelMap.gd" type="Script" id=1] +[ext_resource type="Script" path="res://UI/HUD/LevelMap.gd" id="1"] -[sub_resource type="StyleBoxFlat" id=1] -bg_color = Color( 0, 0, 0, 0.117647 ) +[sub_resource type="StyleBoxFlat" id="1"] +bg_color = Color(0, 0, 0, 0.117647) [node name="LevelMap" type="Panel"] -margin_left = 864.0 -margin_top = 8.0 -margin_right = 1014.0 -margin_bottom = 158.0 -rect_clip_content = true -custom_styles/panel = SubResource( 1 ) -script = ExtResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} +clip_contents = true +offset_right = 150.0 +offset_bottom = 150.0 +theme_override_styles/panel = SubResource("1") +script = ExtResource("1") diff --git a/UI/HUD/LevelMapCell.gd b/UI/HUD/LevelMapCell.gd index a03fc52..f66c8c3 100644 --- a/UI/HUD/LevelMapCell.gd +++ b/UI/HUD/LevelMapCell.gd @@ -20,7 +20,14 @@ func _ready(): func set_rect_size(x, y): - self.rect_size.x = x - self.rect_size.y = y - $ClearMark.rect_size.x = x - $ClearMark.rect_size.y = y + self.size.x = x + self.size.y = y + + $ClearMark.position = Vector2(0, 0) + $ClearMark.size.x = x + $ClearMark.size.y = y + $ClearMark.add_theme_font_size_override('font_size', y / 2) + + $Time.position = Vector2(3, 3) + + $Name.position = Vector2(3, y - ($Name.size.y / 2)) diff --git a/UI/HUD/LevelMapCell.tscn b/UI/HUD/LevelMapCell.tscn index d933d4f..ac981b9 100644 --- a/UI/HUD/LevelMapCell.tscn +++ b/UI/HUD/LevelMapCell.tscn @@ -1,71 +1,153 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=7 format=3 uid="uid://dqwexsei86sdd"] -[ext_resource path="res://UI/LevelSelectCell.gd" type="Script" id=1] -[ext_resource path="res://Assets/Fonts/geometry-soft-pro/Geometry_Soft_Pro-Bold_N.otf" type="DynamicFontData" id=2] -[ext_resource path="res://Assets/Fonts/impact-label/Impact_Label_Reversed.ttf" type="DynamicFontData" id=3] +[ext_resource type="Script" path="res://UI/HUD/LevelMapCell.gd" id="1_j6u6l"] +[ext_resource type="FontFile" uid="uid://qbiaulowpomb" path="res://Assets/Fonts/geometry-soft-pro/Geometry_Soft_Pro-Bold_N.otf" id="2"] +[ext_resource type="FontFile" uid="uid://c8r0x3spdh8sg" path="res://Assets/Fonts/impact-label/Impact_Label_Reversed.ttf" id="3"] -[sub_resource type="StyleBoxFlat" id=1] -bg_color = Color( 0.133333, 0.372549, 0.188235, 1 ) +[sub_resource type="StyleBoxFlat" id="1"] +bg_color = Color(0.133333, 0.372549, 0.188235, 1) border_width_left = 1 border_width_top = 1 border_width_right = 1 border_width_bottom = 1 -[sub_resource type="DynamicFont" id=2] -size = 32 -font_data = ExtResource( 3 ) +[sub_resource type="FontFile" id="2"] +fallbacks = Array[Font]([ExtResource("3")]) +face_index = null +embolden = null +transform = null +cache/0/16/0/ascent = 0.0 +cache/0/16/0/descent = 0.0 +cache/0/16/0/underline_position = 0.0 +cache/0/16/0/underline_thickness = 0.0 +cache/0/16/0/scale = 1.0 +cache/0/16/0/kerning_overrides/16/0 = Vector2(0, 0) -[sub_resource type="DynamicFont" id=3] -size = 8 -outline_size = 2 -outline_color = Color( 0, 0, 0, 1 ) -font_data = ExtResource( 2 ) +[sub_resource type="FontFile" id="3"] +fallbacks = Array[Font]([ExtResource("2")]) +face_index = null +embolden = null +transform = null +cache/0/16/0/ascent = 0.0 +cache/0/16/0/descent = 0.0 +cache/0/16/0/underline_position = 0.0 +cache/0/16/0/underline_thickness = 0.0 +cache/0/16/0/scale = 1.0 +cache/0/16/0/kerning_overrides/16/0 = Vector2(0, 0) +cache/0/16/0/kerning_overrides/2/0 = Vector2(0, 0) +cache/0/16/0/kerning_overrides/24/0 = Vector2(0, 0) +cache/0/16/0/kerning_overrides/12/0 = Vector2(0, 0) +cache/0/16/0/kerning_overrides/10/0 = Vector2(0, 0) +cache/0/16/0/kerning_overrides/8/0 = Vector2(0, 0) +cache/0/16/0/kerning_overrides/1/0 = Vector2(0, 0) +cache/0/2/0/ascent = 0.0 +cache/0/2/0/descent = 0.0 +cache/0/2/0/underline_position = 0.0 +cache/0/2/0/underline_thickness = 0.0 +cache/0/2/0/scale = 1.0 +cache/0/2/0/kerning_overrides/16/0 = Vector2(0, 0) +cache/0/2/0/kerning_overrides/2/0 = Vector2(0, 0) +cache/0/2/0/kerning_overrides/24/0 = Vector2(0, 0) +cache/0/2/0/kerning_overrides/12/0 = Vector2(0, 0) +cache/0/2/0/kerning_overrides/10/0 = Vector2(0, 0) +cache/0/2/0/kerning_overrides/8/0 = Vector2(0, 0) +cache/0/2/0/kerning_overrides/1/0 = Vector2(0, 0) +cache/0/24/0/ascent = 0.0 +cache/0/24/0/descent = 0.0 +cache/0/24/0/underline_position = 0.0 +cache/0/24/0/underline_thickness = 0.0 +cache/0/24/0/scale = 1.0 +cache/0/24/0/kerning_overrides/16/0 = Vector2(0, 0) +cache/0/24/0/kerning_overrides/2/0 = Vector2(0, 0) +cache/0/24/0/kerning_overrides/24/0 = Vector2(0, 0) +cache/0/24/0/kerning_overrides/12/0 = Vector2(0, 0) +cache/0/24/0/kerning_overrides/10/0 = Vector2(0, 0) +cache/0/24/0/kerning_overrides/8/0 = Vector2(0, 0) +cache/0/24/0/kerning_overrides/1/0 = Vector2(0, 0) +cache/0/12/0/ascent = 0.0 +cache/0/12/0/descent = 0.0 +cache/0/12/0/underline_position = 0.0 +cache/0/12/0/underline_thickness = 0.0 +cache/0/12/0/scale = 1.0 +cache/0/12/0/kerning_overrides/16/0 = Vector2(0, 0) +cache/0/12/0/kerning_overrides/2/0 = Vector2(0, 0) +cache/0/12/0/kerning_overrides/24/0 = Vector2(0, 0) +cache/0/12/0/kerning_overrides/12/0 = Vector2(0, 0) +cache/0/12/0/kerning_overrides/10/0 = Vector2(0, 0) +cache/0/12/0/kerning_overrides/8/0 = Vector2(0, 0) +cache/0/12/0/kerning_overrides/1/0 = Vector2(0, 0) +cache/0/10/0/ascent = 0.0 +cache/0/10/0/descent = 0.0 +cache/0/10/0/underline_position = 0.0 +cache/0/10/0/underline_thickness = 0.0 +cache/0/10/0/scale = 1.0 +cache/0/10/0/kerning_overrides/16/0 = Vector2(0, 0) +cache/0/10/0/kerning_overrides/2/0 = Vector2(0, 0) +cache/0/10/0/kerning_overrides/24/0 = Vector2(0, 0) +cache/0/10/0/kerning_overrides/12/0 = Vector2(0, 0) +cache/0/10/0/kerning_overrides/10/0 = Vector2(0, 0) +cache/0/10/0/kerning_overrides/8/0 = Vector2(0, 0) +cache/0/10/0/kerning_overrides/1/0 = Vector2(0, 0) +cache/0/8/0/ascent = 0.0 +cache/0/8/0/descent = 0.0 +cache/0/8/0/underline_position = 0.0 +cache/0/8/0/underline_thickness = 0.0 +cache/0/8/0/scale = 1.0 +cache/0/8/0/kerning_overrides/16/0 = Vector2(0, 0) +cache/0/8/0/kerning_overrides/2/0 = Vector2(0, 0) +cache/0/8/0/kerning_overrides/24/0 = Vector2(0, 0) +cache/0/8/0/kerning_overrides/12/0 = Vector2(0, 0) +cache/0/8/0/kerning_overrides/10/0 = Vector2(0, 0) +cache/0/8/0/kerning_overrides/8/0 = Vector2(0, 0) +cache/0/8/0/kerning_overrides/1/0 = Vector2(0, 0) +cache/0/1/0/ascent = 0.0 +cache/0/1/0/descent = 0.0 +cache/0/1/0/underline_position = 0.0 +cache/0/1/0/underline_thickness = 0.0 +cache/0/1/0/scale = 1.0 +cache/0/1/0/kerning_overrides/16/0 = Vector2(0, 0) +cache/0/1/0/kerning_overrides/2/0 = Vector2(0, 0) +cache/0/1/0/kerning_overrides/24/0 = Vector2(0, 0) +cache/0/1/0/kerning_overrides/12/0 = Vector2(0, 0) +cache/0/1/0/kerning_overrides/10/0 = Vector2(0, 0) +cache/0/1/0/kerning_overrides/8/0 = Vector2(0, 0) +cache/0/1/0/kerning_overrides/1/0 = Vector2(0, 0) [node name="LevelMapCell" type="Panel"] +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -margin_right = -974.0 -margin_bottom = -550.0 -hint_tooltip = "Select Level" -custom_styles/panel = SubResource( 1 ) -script = ExtResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} +offset_right = -974.0 +offset_bottom = -550.0 +tooltip_text = "Select Level" +theme_override_styles/panel = SubResource("1") +script = ExtResource("1_j6u6l") [node name="ClearMark" type="Label" parent="."] -margin_left = 1.0 -margin_top = 1.0 -margin_right = 50.0 -margin_bottom = 50.0 -custom_fonts/font = SubResource( 2 ) +layout_mode = 0 +offset_left = 86.0 +offset_top = 37.0 +offset_right = 96.0 +offset_bottom = 56.0 +theme_override_fonts/font = SubResource("2") text = "X" -align = 1 -valign = 1 -__meta__ = { -"_edit_use_anchors_": false -} +horizontal_alignment = 1 +vertical_alignment = 1 [node name="Time" type="Label" parent="."] -margin_left = 3.72449 -margin_top = 2.01899 -margin_right = 32.7245 -margin_bottom = 15.019 -custom_fonts/font = SubResource( 3 ) +layout_mode = 0 +offset_right = 28.0 +offset_bottom = 16.0 +theme_override_fonts/font = SubResource("3") +theme_override_font_sizes/font_size = 12 text = "0.00s" -valign = 1 -__meta__ = { -"_edit_use_anchors_": false -} [node name="Name" type="Label" parent="."] -margin_left = 3.95238 -margin_top = 31.297 -margin_right = 61.9524 -margin_bottom = 52.297 -custom_fonts/font = SubResource( 3 ) +layout_mode = 0 +offset_left = 1.0 +offset_top = 85.0 +offset_right = 25.0 +offset_bottom = 97.0 +theme_override_fonts/font = SubResource("3") +theme_override_font_sizes/font_size = 8 text = "Player" -valign = 1 -__meta__ = { -"_edit_use_anchors_": false -} diff --git a/UI/HUD/Timer.tscn b/UI/HUD/Timer.tscn index 93a3512..983b3d4 100644 --- a/UI/HUD/Timer.tscn +++ b/UI/HUD/Timer.tscn @@ -1,13 +1,6 @@ -[gd_scene format=2] +[gd_scene format=3 uid="uid://cch42nnvwpi67"] [node name="Timer" type="Label"] -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_left = 10.0 -margin_top = 10.0 -margin_right = 10.0 -margin_bottom = 10.0 +offset_right = 51.0 +offset_bottom = 26.0 text = "0.00s" -__meta__ = { -"_edit_use_anchors_": false -} -- cgit v1.2.3