31 lines
595 B
C#
31 lines
595 B
C#
using Godot;
|
|
using System;
|
|
|
|
public partial class WinScreen : TextureRect
|
|
{
|
|
[Export] public GameManager Manager;
|
|
[Export] public Label TextLabel;
|
|
|
|
public override void _Ready()
|
|
{
|
|
Visible = false;
|
|
}
|
|
|
|
public void Open()
|
|
{
|
|
Visible = true;
|
|
|
|
TextLabel.Text =
|
|
string.Format(Tr("It took you\n{0} attempts\nand {1}\nto finish the game."),
|
|
Manager.GetAttempts(),
|
|
Manager.GetFormattedTimeElapsed());
|
|
}
|
|
|
|
public override void _Input(InputEvent @event)
|
|
{
|
|
if (Visible && @event.IsActionPressed("ui_confirm"))
|
|
{
|
|
GetTree().ChangeSceneToFile("res://scenes/menu.tscn");
|
|
}
|
|
}
|
|
}
|