Ejemplo n.º 1
0
    private void updateFile(int newFileIndex)
    {
        selectedFile = newFileIndex;

        Vector2[] highlightPositions = new Vector2[] {
            new Vector2(132, 143),
            new Vector2(147, 143),
            new Vector2(162, 143)
        };
        fileSelected.pixelOffset = highlightPositions[selectedFile];
        fileSelected.text        = "" + (selectedFile + 1);

        if (SaveLoad.savedGames[selectedFile] != null)
        {
            int badgeTotal = 0;
            for (int i = 0; i < 12; i++)
            {
                if (SaveLoad.savedGames[selectedFile].gymsBeatTime[i] != null)//SaveLoad.savedGames[selectedFile].gymsBeaten[i]
                {
                    badgeTotal += 1;
                }
            }

            /*string playerTime = "" + SaveLoad.savedGames[selectedFile].playerMinutes;
             * if (playerTime.Length == 1)
             * {
             *  playerTime = "0" + playerTime;
             * }
             * playerTime = SaveLoad.savedGames[selectedFile].playerHours + " : " + playerTime;*/

            mapNameText.text       = SaveLoad.savedGames[selectedFile].mapName;
            mapNameTextShadow.text = mapNameText.text;
            Debug.Log(PokemonDatabase.LoadPokedex().Length);
            Debug.Log(SaveLoad.savedGames[selectedFile].pokedexCaught + "/" + SaveLoad.savedGames[selectedFile].pokedexSeen);
            dataText.text = SaveLoad.savedGames[selectedFile].playerName
                            + "\n" + badgeTotal
                            + "\n" + "0" //Pokedex not yet implemented
                            + "\n" + System.String.Format("{0} : {1:00}", SaveLoad.savedGames[selectedFile].playerTime.Hours, SaveLoad.savedGames[selectedFile].playerTime.Minutes);
            dataTextShadow.text = dataText.text;

            for (int i = 0; i < 6; i++)
            {
                if (SaveLoad.savedGames[selectedFile].PC.boxes[0][i] != null)
                {
                    pokemon[i].texture = SaveLoad.savedGames[selectedFile].PC.boxes[0][i].GetIcons();
                }
                else
                {
                    pokemon[i].texture = null;
                }
            }
        }
    }