diff --git a/project/game/level/Level.tscn b/project/game/level/Level.tscn index 63aa7c3c..3d884e60 100644 --- a/project/game/level/Level.tscn +++ b/project/game/level/Level.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=31 format=3 uid="uid://dlcfb4y7xjjl3"] +[gd_scene load_steps=32 format=3 uid="uid://dlcfb4y7xjjl3"] [ext_resource type="Script" path="res://game/level/Level.gd" id="2_wvis2"] [ext_resource type="PackedScene" uid="uid://qm8ijblbhiyt" path="res://game/level/GridView.tscn" id="2_yywdk"] @@ -20,6 +20,7 @@ [ext_resource type="PackedScene" uid="uid://8wk0fsy5tc5" path="res://database/tutorials/TogetherSeparate.tscn" id="13_kx7dw"] [ext_resource type="PackedScene" uid="uid://cqxcsefprpluj" path="res://game/level/TutorialDisplay.tscn" id="15_nwo8g"] [ext_resource type="PackedScene" uid="uid://cvc05fffw42ma" path="res://game/steam/SteamPlaytimeTracker.tscn" id="16_78sh5"] +[ext_resource type="Script" path="res://game/ui/OutlineLabelConvert.gd" id="17_oqjtt"] [sub_resource type="FontVariation" id="FontVariation_hmnss"] base_font = ExtResource("5_2usht") @@ -273,7 +274,7 @@ tracks/3/keys = { "times": PackedFloat32Array(0, 1, 1.3, 3.2, 3.5), "transitions": PackedFloat32Array(1, 1, 1, 1, 1), "update": 0, -"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 0.670588), Color(1, 1, 1, 1), Color(1, 1, 1, 0)] } tracks/4/type = "value" tracks/4/imported = false @@ -338,6 +339,7 @@ theme_override_colors/font_outline_color = Color(0, 0.0352941, 0.141176, 1) theme_override_constants/outline_size = 36 theme_override_font_sizes/font_size = 70 text = "0 - 0" +script = ExtResource("17_oqjtt") [node name="LevelLabel" type="Label" parent="TopInfo/LevelNameContainer"] unique_name_in_owner = true @@ -348,6 +350,7 @@ theme_override_constants/outline_size = 54 theme_override_font_sizes/font_size = 90 text = "LEVELNAM" autowrap_mode = 3 +script = ExtResource("17_oqjtt") [node name="VBoxContainer" type="VBoxContainer" parent="TopInfo"] layout_mode = 0 @@ -724,6 +727,7 @@ theme_override_font_sizes/font_size = 120 text = "Level title" horizontal_alignment = 1 text_overrun_behavior = 3 +script = ExtResource("17_oqjtt") [node name="Edit" type="LineEdit" parent="Title"] visible = false @@ -807,6 +811,7 @@ layer = 3 libraries = { "": SubResource("AnimationLibrary_b8al2") } +speed_scale = 0.3 [node name="Autosaver" type="Timer" parent="."] wait_time = 30.0 diff --git a/project/game/levelhub/LevelSection.tscn b/project/game/levelhub/LevelSection.tscn index 8b2a2c39..efc2926a 100644 --- a/project/game/levelhub/LevelSection.tscn +++ b/project/game/levelhub/LevelSection.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=20 format=3 uid="uid://dns62u0n4j1k3"] +[gd_scene load_steps=21 format=3 uid="uid://dns62u0n4j1k3"] [ext_resource type="Theme" uid="uid://c6108lc3jg2cv" path="res://assets/ui/GeneralTheme.tres" id="1_8nqmb"] [ext_resource type="Script" path="res://game/levelhub/LevelSection.gd" id="2_5vo2a"] @@ -8,6 +8,7 @@ [ext_resource type="StyleBox" uid="uid://dw5db25mri8oa" path="res://assets/ui/SectionButton/CompletedHoverStyle.tres" id="4_ej3iu"] [ext_resource type="PackedScene" uid="uid://d3tmba0xubh11" path="res://game/levelhub/OngoingSolution.tscn" id="4_wvh0b"] [ext_resource type="StyleBox" uid="uid://cskgyvxp485ui" path="res://assets/ui/SectionButton/DisabledStyle.tres" id="6_lf75c"] +[ext_resource type="Script" path="res://game/ui/OutlineLabelConvert.gd" id="8_lakdo"] [ext_resource type="Texture2D" uid="uid://dd04btxtr18wg" path="res://assets/images/ui/bg/bubble.png" id="8_xte08"] [ext_resource type="Theme" uid="uid://cjvm0hkahhs31" path="res://assets/ui/MobileTheme.tres" id="10_lt5bs"] @@ -351,6 +352,7 @@ text = "Level Name That is Very Big" horizontal_alignment = 1 vertical_alignment = 1 autowrap_mode = 3 +script = ExtResource("8_lakdo") [node name="Completed" type="Label" parent="Button/LevelInfoContainer/VBoxContainer"] unique_name_in_owner = true @@ -361,6 +363,7 @@ theme_override_constants/outline_size = 30 theme_override_font_sizes/font_size = 30 text = "COMPLETED_LEVEL" horizontal_alignment = 1 +script = ExtResource("8_lakdo") [node name="Spacer" type="Control" parent="Button/LevelInfoContainer/VBoxContainer"] custom_minimum_size = Vector2(0, 10) @@ -376,6 +379,7 @@ theme_override_constants/outline_size = 20 theme_override_font_sizes/font_size = 20 text = "BEST_TIME" horizontal_alignment = 1 +script = ExtResource("8_lakdo") [node name="BestMistakes" type="Label" parent="Button/LevelInfoContainer/VBoxContainer"] unique_name_in_owner = true @@ -386,6 +390,7 @@ theme_override_constants/outline_size = 20 theme_override_font_sizes/font_size = 20 text = "BEST_MISTAKES" horizontal_alignment = 1 +script = ExtResource("8_lakdo") [node name="UnlockParticles" type="GPUParticles2D" parent="Button"] position = Vector2(91, 130) diff --git a/project/game/ui/OutlineLabel.gd b/project/game/ui/OutlineLabel.gd new file mode 100644 index 00000000..4e790577 --- /dev/null +++ b/project/game/ui/OutlineLabel.gd @@ -0,0 +1,19 @@ +extends CanvasGroup + +var text: String : + get: + return $Label.text + set(x): + $Label.text = x + + +func _process(dt): + var a := 1.0 + var n := get_parent() + while n != null: + if n.get("modulate") != null: + a *= n.modulate.a + else: + break + n = n.get_parent() + self_modulate.a = a diff --git a/project/game/ui/OutlineLabel.tscn b/project/game/ui/OutlineLabel.tscn new file mode 100644 index 00000000..709f21b6 --- /dev/null +++ b/project/game/ui/OutlineLabel.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://dexpbx7tera5u"] + +[ext_resource type="Script" path="res://game/ui/OutlineLabel.gd" id="1_i8vuh"] + +[node name="OutlineLabel" type="CanvasGroup"] +script = ExtResource("1_i8vuh") diff --git a/project/game/ui/OutlineLabelConvert.gd b/project/game/ui/OutlineLabelConvert.gd new file mode 100644 index 00000000..e6c2bbaf --- /dev/null +++ b/project/game/ui/OutlineLabelConvert.gd @@ -0,0 +1,13 @@ +class_name OutlineLabelConvert +extends Label + +func _ready() -> void: + call_deferred("put_inside_group") + +func put_inside_group() -> void: + var had_uniq := unique_name_in_owner + var group := preload("res://game/ui/OutlineLabel.tscn").instantiate() + add_sibling(group) + reparent(group) + if had_uniq: + unique_name_in_owner = true