package;

import flixel.FlxG;
import flixel.text.FlxText;
import flixel.ui.FlxButton;
import flixel.FlxSprite;
import flixel.FlxSubState;


class WinWindow extends FlxSubState {

    var bg:FlxSprite;
    var titleText:FlxText;
    var descriptionText:FlxText;
    var buttonLeft:FlxButton;
    var buttonRight:FlxButton;


    public function new() {
        super();

        bg = new FlxSprite(0, 0, "assets/images/upgrade_window.png");
        bg.camera = PlayState.cameraHUD;
        add(bg);

        titleText = new FlxText(0, 170, FlxG.width, "Victory is Yours", 24);
		titleText.alignment = FlxTextAlign.CENTER;
		titleText.font = "assets/data/PressStart2P.ttf";
		titleText.camera = PlayState.cameraHUD;
		add(titleText);

        descriptionText = new FlxText(305, 211, 395, "The forces of evil have been vanquished once more.\n\nSavor the victory, but rest not; it is only a matter of time until darkness rises again.", 12);
        descriptionText.alignment = FlxTextAlign.CENTER;
        descriptionText.font = "assets/data/PressStart2P.ttf";
        descriptionText.camera = PlayState.cameraHUD;
        add(descriptionText);

        buttonLeft = new FlxButton(427, 300, "", onButtonLeft);
        buttonLeft.label.text = "Restart";
        buttonLeft.label.font = "assets/data/PressStart2P.ttf";
        buttonLeft.label.size = 12;
        buttonLeft.label.alignment = FlxTextAlign.CENTER;
        buttonLeft.label.offset.y = -20;
        buttonLeft.label.color = 0xffffffff;
        buttonLeft.loadGraphic("assets/images/continue_button.png", true, 153, 67);
        buttonLeft.camera = PlayState.cameraHUD;
        add(buttonLeft);
    }

    override public function update(elapsed:Float) {
        super.update(elapsed);

        
    }

    function onButtonLeft() {
        FlxG.switchState(new PlayState());
        close();
    }

}