<commit_before>package com.seancheey.scene.controller

import com.seancheey.game.Config
import com.seancheey.gui.ModelSlot
import com.seancheey.resources.Resources
import com.seancheey.scene.Scenes
import com.seancheey.scene.Stages
import javafx.fxml.FXML
import javafx.fxml.Initializable
import javafx.scene.control.Label
import javafx.scene.image.Image
import javafx.scene.image.ImageView
import javafx.scene.layout.VBox
import java.net.URL
import java.util.*


/**
 * Created by Seancheey on 29/05/2017.
 * GitHub: https://github.com/Seancheey
 */
class Menu : Initializable {

    @FXML
    var botGroupBox: VBox? = null
    @FXML
    var playerLabel: Label? = null
    @FXML
    var titleImageView: ImageView? = null


    override fun initialize(location: URL?, resources: ResourceBundle?) {
        playerLabel!!.text = "${Config.player.name}'s Robots"
        val group = Config.player.robotGroups[0]
        for (model in group) {
            botGroupBox!!.children.add(ModelSlot(model))
        }
        titleImageView!!.image = Image(Resources.getResourceInStream("dat/test_title.png"))
    }

    fun startGame() {
        Stages.switchScene(Scenes.bot_battle)
        if (Config.fullScreen)
            Stages.primaryStage!!.isFullScreen = true
    }

    fun editRobots() {
        Stages.switchScene(Scenes.bot_edit, 1080.0, 670.0)
        if (Config.fullScreen)
            Stages.primaryStage!!.isFullScreen = true
    }

    fun settings() {<commit_msg>handle error if there is no title image.<commit_after>package com.seancheey.scene.controller

import com.seancheey.game.Config
import com.seancheey.gui.ModelSlot
import com.seancheey.resources.Resources
import com.seancheey.scene.Scenes
import com.seancheey.scene.Stages
import javafx.fxml.FXML
import javafx.fxml.Initializable
import javafx.scene.control.Label
import javafx.scene.image.Image
import javafx.scene.image.ImageView
import javafx.scene.layout.VBox
import java.net.URL
import java.util.*


/**
 * Created by Seancheey on 29/05/2017.
 * GitHub: https://github.com/Seancheey
 */
class Menu : Initializable {

    @FXML
    var botGroupBox: VBox? = null
    @FXML
    var playerLabel: Label? = null
    @FXML
    var titleImageView: ImageView? = null


    override fun initialize(location: URL?, resources: ResourceBundle?) {
        playerLabel!!.text = "${Config.player.name}'s Robots"
        val group = Config.player.robotGroups[0]
        for (model in group) {
            botGroupBox!!.children.add(ModelSlot(model))
        }
        val imageInputStream = Resources.getResourceInStream("dat/title.png")
        if (imageInputStream != null)
            titleImageView!!.image = Image(imageInputStream)
    }

    fun startGame() {
        Stages.switchScene(Scenes.bot_battle)
        if (Config.fullScreen)
            Stages.primaryStage!!.isFullScreen = true
    }

    fun editRobots() {
        Stages.switchScene(Scenes.bot_edit, 1080.0, 670.0)
        if (Config.fullScreen)
            Stages.primaryStage!!.isFullScreen = true
    }

    fun settings() {
{'fraction_non_alphanumeric': 0.10798429319371727, 'fraction_numerical': 0.011780104712041885, 'mean_word_length': 3.1033557046979867, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2000433', 'n_tokens_mistral': 984, 'n_tokens_neox': 937, 'n_words': 193}