Skip to content

Commit

Permalink
Auto detect rp mode in vsc ext
Browse files Browse the repository at this point in the history
  • Loading branch information
DEVTomatoCake committed May 18, 2024
1 parent 6fe5f97 commit 4a37f81
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
7 changes: 3 additions & 4 deletions assets/jszip.js
Original file line number Diff line number Diff line change
Expand Up @@ -9428,8 +9428,8 @@ https://github.com/nodeca/pako/blob/main/LICENSE
//---

if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
(state.mode < CHECK || flush !== Z_FINISH))) {
updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)
(state.mode < CHECK || flush !== Z_FINISH))) {
updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out);
}
_in -= strm.avail_in;
_out -= strm.avail_out;
Expand Down Expand Up @@ -9481,7 +9481,6 @@ https://github.com/nodeca/pako/blob/main/LICENSE

var state;
var dictid;
var ret;

/* check state */
if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }
Expand All @@ -9502,7 +9501,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
}
/* copy dictionary to window using updatewindow(), which will amend the
existing dictionary if appropriate */
ret = updatewindow(strm, dictionary, dictLength, dictLength);
updatewindow(strm, dictionary, dictLength, dictLength);
state.havedict = 1;
// Tracev((stderr, "inflate: dictionary set\n"));
return Z_OK;
Expand Down
2 changes: 1 addition & 1 deletion vscExtension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pack-analyzer",
"displayName": "Minecraft Data and Resource pack Analyzer",
"description": "Allows you to analyze and generate stats for [Minecraft](https://minecraft.net) Java Edition data and resource packs.",
"version": "1.0.0",
"version": "1.1.0",
"publisher": "tomatocake",
"main": "./out/extension",
"browser": "./out/extension",
Expand Down
13 changes: 11 additions & 2 deletions vscExtension/src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,20 @@ class PackAnalyzer {
this.onDidChangeTreeData = this._onDidChangeTreeData.event
}

refresh() {
async refresh() {
files = 0
done = 0
error = 0
rpMode = false //document.getElementById("radiorp").checked

rpMode = false
try {
if (await vscode.workspace.fs.readDirectory("assets") && !await vscode.workspace.fs.readDirectory("data")) {
rpMode = true
log("Resource pack mode enabled")
}
} catch (e) {
log("Resource pack mode disabled (" + e.message + ")")
}

filetypes = {}
filetypesOther = {}
Expand Down

0 comments on commit 4a37f81

Please sign in to comment.