// J.J.

using Godot;
using static ld48.Extensions;

public class Game : Node2D {
    public static DynamicFont horror;
    public static DynamicFont font;
    public static DynamicFont bigFont;
    public static DynamicFont alert;

    private PackedScene menuScene;
    
    public override void _Ready() {
        base._Ready();
        
        menuScene = ResourceLoader.Load<PackedScene>($"res://scene/{nameof(Menu)}.tscn");

        font = new DynamicFont();
        font.FontData = ResourceLoader.Load<DynamicFontData>("res://resources/upheaval.ttf");
        font.Size = 16;
        font.UseFilter = false;
        font.UseMipmaps = false;

        bigFont = new DynamicFont();
        bigFont.FontData = ResourceLoader.Load<DynamicFontData>("res://resources/upheaval.ttf");
        bigFont.Size = 64;
        bigFont.UseFilter = false;
        bigFont.UseMipmaps = false;
        bigFont.OutlineColor = Colors.Black;
        bigFont.OutlineSize = 2;

        horror = new DynamicFont();
        horror.FontData = ResourceLoader.Load<DynamicFontData>("res://resources/angst.ttf");
        horror.Size = 64;
        horror.UseFilter = true;
        horror.UseMipmaps = true;

        alert = new DynamicFont();
        alert.FontData = ResourceLoader.Load<DynamicFontData>("res://resources/alert.ttf");
        alert.Size = 64;
        alert.UseFilter = true;
        alert.UseMipmaps = true;
    }

    public override void _Process(float delta) {
        base._Process(delta);

        if (Input.IsActionPressed("exit")) {
            AddChild(menuScene.Instance());
            GetTree().Paused = true;
        }
        
        // OS.SetWindowTitle(Engine.GetFramesPerSecond().ToString());
    }
}

