Move files and folders to new repo format to enable multi-project format
This commit is contained in:
45
Zennysoft.Game.Ma/src/ui/pause_menu/PauseMenu.cs
Normal file
45
Zennysoft.Game.Ma/src/ui/pause_menu/PauseMenu.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
public interface IPauseMenu : IControl
|
||||
{
|
||||
void FadeIn();
|
||||
void FadeOut();
|
||||
event PauseMenu.UnpauseButtonPressedEventHandler UnpauseButtonPressed;
|
||||
event PauseMenu.TransitionCompletedEventHandler TransitionCompleted;
|
||||
}
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class PauseMenu : Control, IPauseMenu
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
[Signal]
|
||||
public delegate void TransitionCompletedEventHandler();
|
||||
[Signal]
|
||||
public delegate void UnpauseButtonPressedEventHandler();
|
||||
|
||||
[Node] public IAnimationPlayer AnimationPlayer { get; set; } = default!;
|
||||
|
||||
public void OnResolved()
|
||||
{
|
||||
AnimationPlayer.AnimationFinished += OnAnimationFinished;
|
||||
}
|
||||
|
||||
public void FadeIn() => AnimationPlayer.Play("fade_in");
|
||||
|
||||
public void FadeOut() => AnimationPlayer.Play("fade_out");
|
||||
|
||||
public override void _UnhandledInput(InputEvent @event)
|
||||
{
|
||||
if (@event.IsActionPressed(GameInputs.Pause))
|
||||
EmitSignal(SignalName.UnpauseButtonPressed);
|
||||
}
|
||||
|
||||
public void OnAnimationFinished(StringName name)
|
||||
{
|
||||
}
|
||||
}
|
||||
1
Zennysoft.Game.Ma/src/ui/pause_menu/PauseMenu.cs.uid
Normal file
1
Zennysoft.Game.Ma/src/ui/pause_menu/PauseMenu.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cbal5oeaha4nx
|
||||
79
Zennysoft.Game.Ma/src/ui/pause_menu/PauseMenu.tscn
Normal file
79
Zennysoft.Game.Ma/src/ui/pause_menu/PauseMenu.tscn
Normal file
@@ -0,0 +1,79 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://blbqgw3wosc1w"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ccrq3"]
|
||||
resource_name = "fade_out"
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.3),
|
||||
"transitions": PackedFloat32Array(1, 7.7),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_bium7"]
|
||||
resource_name = "fade_in"
|
||||
length = 0.3
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.3),
|
||||
"transitions": PackedFloat32Array(1, 7.7),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_f1eqn"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_pmp7u"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_f1eqn"),
|
||||
"fade_in": SubResource("Animation_bium7"),
|
||||
"fade_out": SubResource("Animation_ccrq3")
|
||||
}
|
||||
|
||||
[node name="PauseMenu" type="Control"]
|
||||
process_mode = 3
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_pmp7u")
|
||||
}
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 1)
|
||||
Reference in New Issue
Block a user