/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.petez.decisions.Controllers;

import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Modality;
import javafx.stage.Stage;

/**
 * FXML Controller class
 *
 * @author petez
 */
public class GameViewController implements Initializable {

    @FXML
    private Button backButton;
    @FXML
    private Button option1Button;
    @FXML
    private Button option2Button;
    
    

    /**
     * Initializes the controller class.
     * @param url
     * @param rb
     */
    @Override
    public void initialize(URL url, ResourceBundle rb) {
    }    

    /**
     * Action to go back to the Main menu
     * @param event
     */
    @FXML
    private void backToMenu(ActionEvent event) throws IOException {
        Stage window = (Stage) backButton.getScene().getWindow();
        Stage popUpWindow = new Stage();
        popUpWindow.initModality(Modality.APPLICATION_MODAL);
        popUpWindow.setTitle("Are you sure?");
        Parent popUp = FXMLLoader.load(getClass().getResource("/fxml/PopUpView.fxml"));
        popUpWindow.initOwner(window);
        Scene scene = new Scene(popUp);
        scene.getStylesheets().add("/styles/popupview.css");
        popUpWindow.setScene(scene);
        popUpWindow.showAndWait();
    }

    @FXML
    private void gameOver(ActionEvent event) throws IOException {
        Stage window = (Stage) option2Button.getScene().getWindow();
        Stage popUpWindow = new Stage();
        popUpWindow.initModality(Modality.APPLICATION_MODAL);
        popUpWindow.setTitle("Game Over");
        Parent popUp = FXMLLoader.load(getClass().getResource("/fxml/GameOverPopUpView.fxml"));
        popUpWindow.initOwner(window);
        Scene scene = new Scene(popUp);
        scene.getStylesheets().add("/styles/gameoverpopupview.css");
        popUpWindow.setScene(scene);
        popUpWindow.showAndWait();
    }
    
}

@@ -220,16 +220,56 @@
 llers;%0A%0A
+import com.petez.decisions.Models.User;%0A
 import j
@@ -284,24 +284,24 @@
 OException;%0A
-
 import java.
@@ -552,24 +552,137 @@
 rol.Button;%0A
+import javafx.scene.control.Label;%0Aimport javafx.scene.control.ProgressBar;%0Aimport javafx.scene.image.ImageView;%0A
 import javaf
@@ -965,24 +965,662 @@
 ion2Button;%0A
+    @FXML%0A    private Label cashLabel;%0A    @FXML%0A    private ProgressBar coinProgress;%0A    @FXML%0A    private ProgressBar peopleProgress;%0A    @FXML%0A    private ProgressBar funProgress;%0A    @FXML%0A    private ProgressBar businessProgress;%0A    @FXML%0A    private ImageView coinPotionImageView;%0A    @FXML%0A    private Label coinPotionLabel;%0A    @FXML%0A    private ImageView businessPotionImageView;%0A    @FXML%0A    private Label businessPotionLabel;%0A    @FXML%0A    private ImageView peoplePotionImageView;%0A    @FXML%0A    private Label peoplePotionLabel;%0A    @FXML%0A    private ImageView funPotionImageView;%0A    @FXML%0A    private Label funPotionLabel;%0A
     %0A    %0A%0A 
@@ -1781,16 +1781,144 @@
 e rb) %7B%0A
+        User user = new User(1, %22Petez%22, 0);%0A        System.out.println(user.getName());%0A        bindComponents(user);%0A        %0A
     %7D   
@@ -2599,16 +2599,113 @@
 %0A    %7D%0A%0A
+    %0A    /**%0A     * Initializes the controller class.%0A     * @param url%0A     * @param rb%0A     */%0A
     @FXM
@@ -3260,32 +3260,32 @@
 etScene(scene);%0A
-
         popUpWin
@@ -3314,10 +3314,821 @@
  %7D%0A    %0A
+    %0A    /**%0A     * Initializes the controller class.%0A     * @param url%0A     * @param rb%0A     */%0A    public void bindComponents(User user)%7B%0A        cashLabel.textProperty().bind(user.getCash());%0A        %0A        coinProgress.progressProperty().bind(user.getSkills().get(0));%0A        businessProgress.progressProperty().bind(user.getSkills().get(1));%0A        peopleProgress.progressProperty().bind(user.getSkills().get(2));%0A        funProgress.progressProperty().bind(user.getSkills().get(3));%0A        %0A        coinPotionLabel.textProperty().bind(user.getPotions().get(0));%0A        businessPotionLabel.textProperty().bind(user.getPotions().get(1));%0A        peoplePotionLabel.textProperty().bind(user.getPotions().get(2));%0A        funPotionLabel.textProperty().bind(user.getPotions().get(3));%0A        %0A    %7D%0A    %0A
 %7D%0A

Use Properties to bind