Package dotaSoundEditor.Helpers

Examples of dotaSoundEditor.Helpers.CacheManager


    //Delete scratch.wav and scratch.mp3 if they exist. Not 100% reliable
    //Should probably do this on load too, just to be nice
    private void formWindowClosing(java.awt.event.WindowEvent evt)//GEN-FIRST:event_formWindowClosing
    {//GEN-HEADEREND:event_formWindowClosing
        deleteScratchFiles();
        CacheManager cm = CacheManager.getInstance();
        try
        {
            cm.saveCache();
        }
        catch (IOException | SecurityException | URISyntaxException | NullPointerException ex)
        {
            JOptionPane.showMessageDialog(this, "Error: Unable to save scripts cache."
                    + "\nDetails: " + ex.getMessage(), "Error saving cache", JOptionPane.ERROR_MESSAGE);
View Full Code Here


        }
    }

    public boolean validateScriptFile(String scriptKey, String scriptPath)
    {
        CacheManager cm = CacheManager.getInstance();
        cm.putScriptPath(scriptKey, scriptPath);
        long crc = cm.getSessionCrc(scriptKey);
        if (crc == 0)
        {
            return false;
        }
        return validateScriptFile(scriptKey, crc);
View Full Code Here

        return validateScriptFile(scriptKey, crc);
    }

    public boolean validateScriptFile(String scriptKey, long internalCrc)
    {
        CacheManager cm = CacheManager.getInstance();
        if (!cm.isUpToDate(scriptKey, internalCrc))
        {
            return false;
        }
        else
        {
View Full Code Here

        }
        ScriptParser parser = new ScriptParser(scriptFile);
        TreeModel scriptTree = parser.getTreeModel();
        if (needsValidation)
        {
            CacheManager cm = CacheManager.getInstance();
            boolean isUpToDate = this.validateScriptFile(scriptKey, "scripts/" + scriptKey);
            if (!isUpToDate)
            {
                this.writeItemScriptFile(cm.getCachedVpkEntry(), true);
                mergeNewChanges(scriptTree, scriptFile);
                this.updateCache(cm.getCachedVpkEntry().getName() + ".txt", cm.getCachedVpkEntry().getCRC32());
            }
        }
        this.currentTreeModel = scriptTree;

        //TODO: Break this out into a separate method
View Full Code Here

    }

    @Override
    void updateCache(String scriptKey, long internalCrc)
    {
        CacheManager cm = CacheManager.getInstance();
        String internalPath = "scripts/game_sounds_items.txt";
        cm.putScript(scriptKey, internalPath, internalCrc);
    }
View Full Code Here

        }
        ScriptParser parser = new ScriptParser(scriptPath.toFile());
        TreeModel scriptTree = parser.getTreeModel();
        if (needsValidation)
        {
            CacheManager cm = CacheManager.getInstance();
            boolean isUpToDate = this.validateScriptFile(scriptKey, "scripts/game_sounds_heroes/" + scriptKey);
            if (!isUpToDate)
            {
                this.writeHeroScriptFile(cm.getCachedVpkEntry(), true);
                mergeNewChanges(scriptTree, scriptPath);
                this.updateCache(cm.getCachedVpkEntry().getName() + ".txt", cm.getCachedVpkEntry().getCRC32());
            }
        }
        this.currentTreeModel = scriptTree;

        //TODO: Break this out into separate method
View Full Code Here

    }

    @Override
    void updateCache(String scriptKey, long internalCrc)
    {
        CacheManager cm = CacheManager.getInstance();
        String internalPath = "scripts/game_sounds_heroes/game_sounds_" + ((NamedHero) currentDropdown.getSelectedItem()).getInternalName() + ".txt";
        cm.putScript(scriptKey, internalPath, internalCrc);
    }
View Full Code Here

TOP

Related Classes of dotaSoundEditor.Helpers.CacheManager

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.