Files
Nockin_On_Hells_Door/script/Menu.cs
2024-10-19 22:42:43 +02:00

55 lines
978 B
C#

using Godot;
using System;
public partial class Menu : Control
{
[Export] AnimationPlayer anim;
[Export] Panel pause;
[Export] Panel trick;
[Export] CharacterBody2D player;
Node parent;
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
parent = player.GetParent().GetParent();
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
public void ResumeDown()
{
Input.MouseMode = Input.MouseModeEnum.Hidden;
anim.Play("resume");
}
public void OptionDown()
{
pause.Visible = false;
trick.Visible = true;
}
public void ExitDown()
{
GetTree().Paused = false;
parent.Call("ToPrincipalFunc");
//EmitSignal("ToPrincipalEventHandler");
//GetTree().ChangeSceneToPacked(principal);
}
public void Res()
{
GetTree().Paused = false;
}
public void ExitTrick()
{
pause.Visible = true;
trick.Visible = false;
}
}