Package info.ata4.unity.cli.cmd

Examples of info.ata4.unity.cli.cmd.Command


    private VPKEntry getMusicScriptFile(String fileName)
    {
        File vpkFile = new File(vpkPath);
        VPKArchive vpk = new VPKArchive();
        VPKEntry entryToReturn = null;
        try
        {
            vpk.load(vpkFile);
        }
        catch (Exception ex)
View Full Code Here


    {
        currentTree.setEditable(false);
        inAdvancedMode = false;
        File scriptFile = new File(getCurrentScriptString());
        String scriptKey = ((NamedMusic) currentDropdown.getSelectedItem()).getInternalName().toLowerCase() + ".txt";
        VPKEntry entry;
        boolean needsValidation = false;
        if (!scriptFile.isFile())
        {
            String currentMusicPath = ((NamedMusic) currentDropdown.getSelectedItem()).getFilePath().toString();
            entry = getMusicScriptFile(currentMusicPath);
            writeMusicScriptFile(entry);
            scriptFile = new File(getCurrentScriptString());
            this.updateCache(scriptKey, entry.getCRC32());
        }
        else
        {
            needsValidation = true;
        }
View Full Code Here

            }
            String scriptDir = ((NamedMusic) currentDropdown.getSelectedItem()).getFilePath().toString();
            scriptDir = scriptDir.replace("\\", "/");

            byte[] bytes = null;
            VPKEntry entry = vpk.getEntry(scriptDir);
            try
            {
                ByteBuffer scriptBuffer = null;
                scriptBuffer = entry.getData();
                bytes = new byte[scriptBuffer.remaining()];
                scriptBuffer.get(bytes);
            }
            catch (IOException ex)
            {
View Full Code Here

            catch (Exception ex)
            {
                System.err.println("Can't open archive: " + ex.getMessage());
            }
            waveSubstring = "sound/" + waveSubstring;
            VPKEntry entry = vpk.getEntry(waveSubstring.toLowerCase());

            entryFile = entry.getType().contains("wav")
                    ? new File(Paths.get(System.getProperty("user.dir") + "/scratch/scratch.wav").toString())
                    : new File(Paths.get(System.getProperty("user.dir") + "/scratch/scratch.mp3").toString());

            try (FileChannel fc = FileUtils.openOutputStream(entryFile).getChannel())
            {
                fc.write(entry.getData());
            }
            catch (IOException ex)
            {
                ex.printStackTrace();
            }
View Full Code Here

        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
            {
                throw new ScriptNotFoundException("Unable to locate VPKEntry at " + scriptPath);
            }
View Full Code Here

                    "Error opening VPK", JOptionPane.ERROR_MESSAGE);
            ex.printStackTrace();
            return null;
        }

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

    {
        inAdvancedMode = false;
        currentTree.setEditable(false);
        String scriptKey = "game_sounds_items.txt";
        File scriptFile = new File(getCurrentScriptString());
        VPKEntry entry;
        boolean needsValidation = false;

        if (!scriptFile.isFile())
        {
            entry = getItemScriptFile("");
            this.writeItemScriptFile(entry, false);
            this.updateCache(scriptKey, entry.getCRC32());
            scriptFile = new File(getCurrentScriptString());
        }
        else
        {
            needsValidation = true;
View Full Code Here

        NamedHero selectedHero = (NamedHero) currentDropdown.getSelectedItem();

        Path scriptPath = Paths.get(this.installDir, "/dota/scripts/game_sounds_heroes/game_sounds_" + selectedHero.getInternalName() + ".txt");
        File scriptFile = new File(scriptPath.toString());
        String scriptKey = "game_sounds_" + selectedHero.getInternalName() + ".txt".toLowerCase();
        VPKEntry entry;
        boolean needsValidation = false;

        //if it doesn't exist yet, don't bother validating, and just write it out
        if (!scriptFile.isFile())
        {
            entry = this.getHeroScriptFile(selectedHero.getInternalName());
            this.writeHeroScriptFile(entry, false);
            this.updateCache(scriptKey, entry.getCRC32());
        }
        else //if it exists, we need to validate it
        {
            needsValidation = true;
        }
View Full Code Here

                    "Error opening VPK", JOptionPane.ERROR_MESSAGE);
            ex.printStackTrace();
            return null;
        }

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

        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
            {
                throw new ScriptNotFoundException("Unable to locate VPKEntry at " + scriptPath);
            }
View Full Code Here

TOP

Related Classes of info.ata4.unity.cli.cmd.Command

Copyright © 2018 www.massapicom. 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.