From 0e63883cddef1e1079cf9cec90eb5f52ebf74a37 Mon Sep 17 00:00:00 2001 From: Haze Weathers Date: Tue, 5 Mar 2024 22:16:59 -0500 Subject: [PATCH] fix unfocused animations in more places --- menus/credits.gd | 9 +++++++++ menus/credits.tscn | 16 ++++++++-------- menus/results.gd | 9 +++++++++ 3 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 menus/credits.gd diff --git a/menus/credits.gd b/menus/credits.gd new file mode 100644 index 0000000..f4efaca --- /dev/null +++ b/menus/credits.gd @@ -0,0 +1,9 @@ +extends Node + + +func _notification(what: int) -> void: + match what: + NOTIFICATION_WM_FOCUS_OUT: + $AnimationPlayer.playback_active = false + NOTIFICATION_WM_FOCUS_IN: + $AnimationPlayer.playback_active = true diff --git a/menus/credits.tscn b/menus/credits.tscn index 506faa8..346b7be 100644 --- a/menus/credits.tscn +++ b/menus/credits.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=134 format=2] +[gd_scene load_steps=135 format=2] [ext_resource path="res://shaders/1px_border.gdshader" type="Shader" id=1] [ext_resource path="res://shaders/ska_plane.gdshader" type="Shader" id=2] @@ -13,6 +13,7 @@ [ext_resource path="res://graphics/hud/roll_call.png" type="Texture" id=11] [ext_resource path="res://graphics/npc/intelli_idle.png" type="Texture" id=12] [ext_resource path="res://graphics/npc/speccy.png" type="Texture" id=13] +[ext_resource path="res://menus/credits.gd" type="Script" id=14] [ext_resource path="res://graphics/enemy/snake.png" type="Texture" id=15] [ext_resource path="res://scripts/sg_palette.gd" type="Script" id=16] [ext_resource path="res://graphics/player/sg_stim.png" type="Texture" id=17] @@ -605,6 +606,7 @@ tracks/0/keys = { } [node name="Credits" type="Node" groups=["map"]] +script = ExtResource( 14 ) [node name="CanvasLayer" type="CanvasLayer" parent="."] layer = -64 @@ -833,7 +835,6 @@ align = 1 material = SubResource( 8 ) position = Vector2( 106, 69 ) frames = SubResource( 18 ) -frame = 3 playing = true [node name="Label" type="Label" parent="Control/RollCall1/MsX"] @@ -936,7 +937,6 @@ align = 1 [node name="TheScrump" type="AnimatedSprite" parent="Control/RollCall2"] position = Vector2( 2992, 128 ) frames = SubResource( 27 ) -frame = 1 playing = true [node name="Label" type="Label" parent="Control/RollCall2/TheScrump"] @@ -984,7 +984,6 @@ align = 1 material = SubResource( 34 ) position = Vector2( 3024, 62 ) frames = SubResource( 43 ) -frame = 3 playing = true [node name="Label" type="Label" parent="Control/RollCall2/Skelarcher"] @@ -1109,7 +1108,7 @@ align = 1 material = SubResource( 71 ) position = Vector2( 72, 152 ) frames = SubResource( 80 ) -frame = 4 +frame = 1 playing = true [node name="Label" type="Label" parent="Control/RollCall3/Hellarcher"] @@ -1126,7 +1125,7 @@ align = 1 material = SubResource( 66 ) position = Vector2( 68, 104 ) frames = SubResource( 70 ) -frame = 2 +frame = 1 playing = true [node name="Label" type="Label" parent="Control/RollCall3/Turchin"] @@ -1264,11 +1263,11 @@ position = Vector2( 3464, -8 ) autostart = false [node name="FootShapeFront" parent="Control/RollCall4/2600/Hitbox" index="1"] -position = Vector2( 63.7333, 154.923 ) +position = Vector2( 63.7334, 154.923 ) scale = Vector2( 1, 1 ) [node name="FootShapeBack" parent="Control/RollCall4/2600/Hitbox" index="2"] -position = Vector2( 42.7333, 154.923 ) +position = Vector2( 42.7334, 154.923 ) scale = Vector2( 1, 1 ) [node name="ExplosionRect" parent="Control/RollCall4/2600/BigExplosion" index="0"] @@ -1313,6 +1312,7 @@ align = 1 material = SubResource( 82 ) position = Vector2( 3362, 122.5 ) frames = SubResource( 87 ) +frame = 2 playing = true [node name="Label" type="Label" parent="Control/RollCall4/Famicop"] diff --git a/menus/results.gd b/menus/results.gd index 026fe7d..2996a49 100644 --- a/menus/results.gd +++ b/menus/results.gd @@ -18,6 +18,15 @@ onready var perfect_bonus_score = $ShardsAndBonuses/Bonuses/PerfectBonus/Perfect var text_3d = null + +func _notification(what: int) -> void: + match what: + NOTIFICATION_WM_FOCUS_OUT: + $AnimationPlayer.playback_active = false + NOTIFICATION_WM_FOCUS_IN: + $AnimationPlayer.playback_active = true + + func _ready() -> void: #preload final score text_3d = Text3D.instance()