Examples of VPKArchive


Examples of info.ata4.vpk.VPKArchive

    private VPKEntry getHeroScriptFile(String heroName)
    {
        heroName = heroName.toLowerCase();
        String internalScriptPath = "scripts/game_sounds_heroes/game_sounds_" + heroName + ".txt";
        File vpkFile = new File(vpkPath);
        VPKArchive vpk = new VPKArchive();
        try
        {
            vpk.load(vpkFile);
        }
        catch (Exception ex)
        {
            JOptionPane.showMessageDialog(this,
                    "Error: Unable to open VPK file.\nDetails: " + ex.getMessage(),
                    "Error opening VPK", JOptionPane.ERROR_MESSAGE);
            ex.printStackTrace();
            return null;
        }

        VPKEntry entry = vpk.getEntry(internalScriptPath);
        return entry;
    }
View Full Code Here

Examples of info.ata4.vpk.VPKArchive

            //First go in and delete the sound in customSounds  
            deleteSoundFileByWaveString(selectedWaveString);

            //Get the relevant wavestring from the internal scriptfile                   
            VPKArchive vpk = new VPKArchive();
            try
            {
                vpk.load(new File(this.vpkPath));
            }
            catch (IOException ex)
            {
                ex.printStackTrace();
            }
            String scriptDir = this.getScriptPathByHeroName(((NamedHero) currentDropdown.getSelectedItem()).getInternalName());
            scriptDir = scriptDir.replace(Paths.get(installDir, "/dota/").toString(), "");
            scriptDir = scriptDir.replace("\\", "/");                           //Match internal forward slashes
            scriptDir = scriptDir.substring(1);                                 //Cut off leading slash
            scriptDir = scriptDir.substring(0, scriptDir.lastIndexOf("/") + 1); //Cut off file extension           

            String scriptFileString = null;
            byte[] bytes = null;
            for (VPKEntry entry : vpk.getEntriesForDir(scriptDir))
            {
                if (entry.getName().contains("game_sounds_" + ((NamedHero) currentDropdown.getSelectedItem()).getInternalName()))
                {
                    try
                    {
View Full Code Here

Examples of info.ata4.vpk.VPKArchive

        if (sessionCrcs.containsKey(scriptKey + SESSION_CRC_SEP))
        {
            return sessionCrcs.get(scriptKey + SESSION_CRC_SEP);
        }
        String vpkPath = UserPrefs.getInstance().getVPKPath();
        VPKArchive vpk = new VPKArchive();
        long internalCrc = 0;
        try
        {
            vpk.load(new File(vpkPath));
            String scriptPath = scriptsProperties.getProperty(scriptKey + PATH_SEP);
            VPKEntry scriptEntry = vpk.getEntry(scriptPath);
            if (scriptEntry != null)
            {
                internalCrc = scriptEntry.getCRC32();
            }
            else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.